Commit Graph

2325 Commits

Author SHA1 Message Date
Rintaro Ishizaki
31b1820322 Merge pull request #62425 from rintaro/sourcekit-macroexpand-rdar102739026
[SourceKit/Refactoring] Macro expansion
2022-12-07 14:48:35 -08:00
Rintaro Ishizaki
9f137074af [SourceKit/Refactoring] Macro expansion
Add refactoring "Expand Macro" that expands macro expressions.

rdar://102739026
2022-12-06 16:20:07 -08:00
swift-ci
663df4a9e2 Merge remote-tracking branch 'origin/main' into rebranch 2022-12-06 15:53:28 -08:00
Rintaro Ishizaki
a28b92e7ff Merge pull request #62308 from rintaro/sourcekitd-rdar102765542
[SourceKit] Don't link 'sourcekitd' to service related code
2022-12-06 15:41:30 -08:00
swift-ci
e0abefd949 Merge remote-tracking branch 'origin/main' into rebranch 2022-12-06 09:34:41 -08:00
Ben Barham
5b9aef91f8 Merge pull request #62416 from bnbarham/fix-sourcekit-rpath
[SourceKit] Add required rpath back to sourcekitd RPATH_LIST
2022-12-06 09:19:32 -08:00
swift-ci
40bb6d650d Merge remote-tracking branch 'origin/main' into rebranch 2022-12-05 21:53:52 -08:00
Doug Gregor
1b8b706dac Merge pull request #62405 from DougGregor/macro-diagnostics 2022-12-05 21:37:27 -08:00
Ben Barham
c8e092d078 [SourceKit] Add required rpath back to sourcekitd RPATH_LIST
This was modified to `.../swift/host` in
b338472a2b, but the SourceKit libraries
are not under `swift/host`.

Resolves rdar://103006159.
2022-12-05 20:24:49 -08:00
Doug Gregor
f0fc1c51bb Remove compiler plugin support library
The functionality of the compiler plugin support library has been
subsumed into parts of the compiler. Remove the functionality and its
last test.
2022-12-05 12:54:36 -08:00
swift-ci
4eaff05e0f Merge remote-tracking branch 'origin/main' into rebranch 2022-12-02 01:57:21 -08:00
Alex Hoppen
8e857d55c3 Merge pull request #62292 from ahoppen/ahoppen/solver-based-cursor-info-prep
[SourceKit] Preparation for solver-based cursor info
2022-12-02 10:52:30 +01:00
swift-ci
21b2cf9c50 Merge remote-tracking branch 'origin/main' into rebranch 2022-12-01 20:14:31 -08:00
Alex Hoppen
9f6bc90d6d [SourceKit] Accept a file system in SwiftASTManager::getMemoryBuffer 2022-12-01 12:11:39 +01:00
Alex Hoppen
04ff291ae0 [SourceKit] Allow executing a completion-like operation without inserting a code completion token into the buffer
We will use this for solver-based cursor info, which doesn’t use code completion tokens.
2022-12-01 12:11:39 +01:00
Alex Hoppen
1485fe554f [SourceKit] Add print and dump methods for cursor info results
We will be using the string serialized results to verify that solver-based cursor info results match the old implementation. This is necessary because cursor info results on their own contain stack references that cannot be stored.
2022-12-01 12:11:39 +01:00
Alex Hoppen
54360ad0fb [SourceKit] Remove unused MainModule param from cursor info results 2022-12-01 12:11:39 +01:00
Alex Hoppen
652686034c [IDE] Split ResolvedCursorInfo into subclasses
This way, each kind of `ResolvedCursorInfo` can define its own set of properties and it’s obvious which properties are used for which kind. Also switch to getters and setters because that makes it easier to search for usages of properties by looking at the call hierarchy of the getter / setter.
2022-12-01 12:11:39 +01:00
Doug Gregor
b338472a2b Start building libswift_CompilerPluginSupport into lib/swift/host. 2022-11-30 13:54:03 -08:00
Doug Gregor
20013181e1 [CMake] Link to swift-syntax libriares from lib/swift/host. 2022-11-30 13:54:03 -08:00
Rintaro Ishizaki
0a791e8827 Don't link 'sourcekitd' to service related code
Separate 'sourcekitd/lib/API/Requests.cpp' to a library
'sourcekitdService' so the XPC client libary (i.e.
sourcektid.framework/sourcekid) doesn't include unnecessary code.

rdar://102765542
2022-11-30 09:06:34 -08:00
swift-ci
1acf8b039b Merge remote-tracking branch 'origin/main' into rebranch 2022-11-29 10:14:02 -08:00
Doug Gregor
af6b30a195 [Code completion] Add code completion support for macro expansions. 2022-11-28 18:33:10 -08:00
Erik Eckstein
ab1b343dad use new llvm::Optional API
`getValue` -> `value`
`getValueOr` -> `value_or`
`hasValue` -> `has_value`
`map` -> `transform`

The old API will be deprecated in the rebranch.
To avoid merge conflicts, use the new API already in the main branch.

rdar://102362022
2022-11-21 19:44:24 +01:00
Rintaro Ishizaki
d458c8b74a Merge remote-tracking branch 'origin/main' into rebranch
Conflicts:
	include/swift/Sema/ConstraintSystem.h
	include/swift/Syntax/AbsoluteRawSyntax.h
	include/swift/Syntax/Syntax.h
	include/swift/Syntax/SyntaxData.h
	lib/DependencyScan/ModuleDependencyCacheSerialization.cpp
	lib/Syntax/SyntaxFactory.cpp.gyb
	lib/Syntax/SyntaxNodes.cpp.gyb
	tools/SourceKit/lib/SwiftLang/SwiftEditor.cpp
	tools/swift-syntax-test/swift-syntax-test.cpp
2022-11-18 09:37:38 -08:00
Alexis Laferrière
888fe84013 Merge pull request #62073 from xymus/module-alias-disambiguate-more
[ModuleInterface] AliasModuleNames workaround support for indirect dependencies and missing imports
2022-11-17 10:33:56 -08:00
Robert Widmann
9ff5d88847 Remove SourceKit Support for the libSyntax Tree 2022-11-16 14:52:28 -08:00
Robert Widmann
4c162b2aeb Delete libSyntax 2022-11-16 14:52:28 -08:00
Robert Widmann
91c262bcb7 Move TokenKinds.def.gyb to AST 2022-11-16 13:38:25 -08:00
swift-ci
601e353c81 Merge remote-tracking branch 'origin/main' into rebranch 2022-11-16 00:34:21 -08:00
Doug Gregor
52b64e53ae [SourceKit] Make sure we link the compiler plugin support library 2022-11-15 20:52:40 -08:00
Doug Gregor
70323dd318 Link _CompilerPluginSupport into the compiler and SourceKit.
Ensure that we link `swift_CompilerPluginSupport` into the compiler and
SourceKit, and set the rpath appropriately to find the library in its
installed location.

A number of driver tests copy the driver executable into a temporary
directory to isolate it from the build tree. Also copy the plugin
support library into its appropriate place near the driver executable
to ensure these tests keep working. To help with this, add a
`swift_swift_parser` lit feature, which we can use in tests that
involve the new parser's capabilities.
2022-11-15 19:32:20 -08:00
Alexis Laferrière
81c19b5107 [ASTPrinter] Move up the logic printing the module disambiguation 2022-11-15 16:20:25 -08:00
Erik Eckstein
4c65062bdf rebranch: change some uses of Optional to the new API
`getValue` -> `value`
`getValueOr` -> `value_or`
`hasValue` -> `has_value`
`map` -> `transform`

This change does not cover all uses of the old API. Other warnings are worked around in llvm by https://github.com/apple/llvm-project/pull/5618

rdar://102362022
2022-11-15 17:23:07 +01:00
swift-ci
c6a647ae06 Merge remote-tracking branch 'origin/main' into rebranch 2022-11-13 20:33:41 -08:00
Doug Gregor
3a172fb892 [Macros] Miscellaneous build fixes for macros. 2022-11-13 17:09:12 -08:00
swift-ci
b3d9c1efd3 Merge remote-tracking branch 'origin/main' into rebranch 2022-11-07 09:35:16 -08:00
Alexis Laferrière
e550944826 Merge pull request #61941 from xymus/module-alias-disambiguate
[ModuleInterface] Avoid ambiguities in swiftinterfaces by writing aliases for module names
2022-11-07 08:46:32 -08:00
Erik Eckstein
e292d17672 llvm::array_lengthof -> std::size 2022-11-04 20:44:19 +01:00
Alexis Laferrière
6d5e1b26fa [ASTPrinter] Pass down PrintOptions to printModuleRef 2022-11-04 12:29:55 -07:00
Rintaro Ishizaki
45828af5ed [Refactoring] Separate refactoring files to its own library
IDE/Refactoring had dependencies to libswiftIndex, but libswiftIndex
also depends on libswiftIDE (SourceEntityWalker, etc.)

To break libswiftIndex <-> libswiftIDE dependency cycle, move
"refactoring" related files to a new library 'libswiftRefactoring'

rdar://101692282
2022-11-02 12:39:26 -07:00
Allan Shortlidge
d663c11df7 IDE: Move compiler invocation utils to break cycle with Frontend.
Move compiler invocation utilities up into the IDETool library which is designed to be dependent on the Frontend and FrontendTool libraries.
2022-10-29 17:51:53 -07:00
Allan Shortlidge
58d82f03f6 IDE: Break CMake cycle involving IDE, FrontendTool, Frontend, and Migrator.
These libraries formed a strongly connected component in the CMake build graph. The weakest link I could find was from IDE to FrontendTool and Frontend, which was necessitated by the `CompileInstance` class (https://github.com/apple/swift/pull/40645). I moved a few files out of IDE into a new IDETools library to break the cycle.
2022-10-27 15:56:26 -07:00
Doug Gregor
77dfffc49e [CMake] Use an absolute path when adding Swift runtime paths.
The SourceKit version of these operations takes an absolute path, whereas
the primary one takes a relative path.

Fixes rdar://100976577
2022-10-10 11:28:20 -07:00
Doug Gregor
7478df009d [CMake] Ensure that the SourceKit framework links Swift as needed 2022-10-07 15:47:29 -07:00
Doug Gregor
4da85ea091 Clean up build logic for ASTGen library.
Only introduce it and its dependency when the new Swift parser is being
built, and rely more on existing logic to make sure we get the right
build/link flags.
2022-10-07 10:19:05 -07:00
zoecarver
73a7c0ecc6 Apply Doug's review comments
(cherry picked from commit ddede209c7)
2022-10-07 10:18:40 -07:00
zoecarver
80200ec23a Add Swift-side infrastructure for ASTGen.
(cherry picked from commit 7bc67c9f12)
2022-10-07 10:18:40 -07:00
Alex Hoppen
0ab44d577d Merge pull request #61246 from skrtks/SourceKit_qualified_types
[SourceKit] add qualified types in type requests
2022-10-04 12:30:59 +02:00
Sam Kortekaas
1bd0d9753e [SourceKit] Add option for returning fully qualified types in variable type request 2022-09-29 09:32:09 +02:00