Commit Graph

202 Commits

Author SHA1 Message Date
Ben Barham
762532539e Revert "Make all the methods in ToolchainLanguageServer async"
This reverts commit a8b84256b3.
2023-09-28 15:51:21 -07:00
Ben Barham
7bc3f1710e Revert "Migrate SwiftLanguageServer to an actor"
This reverts commit 42ec5bba74.
2023-09-28 15:51:17 -07:00
Ben Barham
15bdcc42e1 Revert "Call into the BuildSystemManager from SwiftLanguageServer to get build settings"
This reverts commit 9dd38798bb.
2023-09-28 15:51:07 -07:00
Ben Barham
212c497eb0 Revert "Migrate ClangLanguageServerShim to be an actor"
This reverts commit d699645a5f.
2023-09-28 15:51:01 -07:00
Ben Barham
10937134b9 Revert "Call into the BuildSystemManager from ClangLanguageServerShim to get build settings"
This reverts commit c95d2ebea2.
2023-09-28 15:50:50 -07:00
Ben Barham
cd4e733de2 Revert "Wait for documents to be re-opened before setting the clangd status to be connected again"
This reverts commit b9fa20303d.
2023-09-28 15:50:45 -07:00
Ben Barham
ffcedc775d Revert "Fix typos"
This reverts commit aaa9bd49a1.
2023-09-28 15:50:28 -07:00
Alex Hoppen
aaa9bd49a1 Fix typos 2023-09-27 16:51:55 -07:00
Alex Hoppen
b9fa20303d Wait for documents to be re-opened before setting the clangd status to be connected again 2023-09-27 16:51:54 -07:00
Alex Hoppen
c95d2ebea2 Call into the BuildSystemManager from ClangLanguageServerShim to get build settings
The same kind of change that we did for `SwiftLanguageServer`. Instead of caching build settings inside `ClangLanguageServerShim`, always call into `BuildSystemManager` to get the build settings.
2023-09-27 16:20:53 -07:00
Alex Hoppen
d699645a5f Migrate ClangLanguageServerShim to be an actor
Fairly straightforward since we have all the infrastructure now.
2023-09-27 16:20:53 -07:00
Alex Hoppen
9dd38798bb Call into the BuildSystemManager from SwiftLanguageServer to get build settings
Instead of storing build settings inside the language servers based on update notifications from the build system, always call into the `BuildSystemManager` to get the build settings.

Overall, I think this is a much clearer separation of concerns and will allow us to remove `SourceKitServer.documentToPendingQueue` in a follow-up commit as `SwiftLanguageServer` can always directly call into `BuildSystemManager` to get build settings and we don’t need to wait for the initial notification to receive the first build settings.

This requies `BuildServerBuildSystem` to keep track of the build settings it has received from the BSP server.

`ClangLanguageServer` still caches build settings locally. `ClangLanguageServer` will change to the same pull-based model in a follow-up commit.
2023-09-27 16:20:53 -07:00
Alex Hoppen
42ec5bba74 Migrate SwiftLanguageServer to an actor 2023-09-27 16:20:53 -07:00
Alex Hoppen
a8b84256b3 Make all the methods in ToolchainLanguageServer async
This is a preparation step for making `SwiftLanguageServer` and `ClangLanguageServerShim` actors.
2023-09-27 16:20:52 -07:00
Alex Hoppen
351eaa2393 Make SourceKitServer an actor
Unfortuantely, we have a few potential out-of-order exeuction possibilities while we migrate everything else to also be asyncronous. But those should be low-probability issues that we can fix in follow-up commits, so I think it’s fine for now. All of these places are marked with `FIXME: (async)`
2023-09-27 09:48:21 -07:00
Alex Hoppen
11ccca183b Remove dynamic registration of request handlers 2023-09-19 17:32:54 -07:00
Alex Hoppen
7699d13bef Remove dynamic registration of notifications 2023-09-19 17:32:54 -07:00
Alex Hoppen
026d3cb1d6 Remove LanguageServerEndpoint
Since we moved `BuilderServerHandler` and `ClangLanguageServerShim` to directly conform to `MessageHandler`, `SourceKitServer` was the only type inheriting from `LanguageServerEndpoint` and we can thus remove the type.
2023-09-19 17:32:54 -07:00
Alex Hoppen
ae596c267b Remove LanguageServer
Was only used by `SourceKitServer` now.
2023-09-19 17:32:54 -07:00
Alex Hoppen
2e38b0a230 Make ClangLanguageServerShim conform to MessageHandler directly and not be a language server
This is the first step to eliminate `LanguageServer` as a class, which will allow us to make `SourceKitServer` an actor.
2023-09-19 17:32:53 -07:00
Zachary
6339c5a04c Fix typo in reloadPackage token name 2023-09-15 12:01:39 -04:00
Alex Hoppen
e9697d4a2d Merge pull request #791 from ahoppen/ahoppen/reload-progress-again 2023-08-29 21:12:51 -07:00
Alex Hoppen
fc646793e1 Improve folding of line comments
Previously, the folding range of a block of line comments was ended after the newline of the last line comment, which would usually be the line of the function’s start. That caused VS Code to not show a folding range for the function body itself since it started on the same line that the line comment folding range ended.

Rewrite the trivia folding logic so that the folding range of those line comments ends on the line of the last line comment.

Fixes #803
rdar://114428202
2023-08-25 09:53:10 -07:00
Ziyang Huang
86ee25418a Rename some SyntaxClassification 2023-08-10 22:50:45 +08:00
Alex Hoppen
7604a1d389 Show a progress indicator in the editor if SourceKit-LSP is reloading packages
I noticed that the initial package loading can take ~5s. It’s good behavior to inform the client that sourcekit-lsp is busy reloading the package, showing the user that semantic functionality might not be ready yet.

https://github.com/apple/sourcekit-lsp/issues/620
rdar://112498447
2023-08-03 18:25:47 -07:00
Alex Hoppen
7385eb7a41 Merge pull request #790 from ahoppen/ahoppen/swift-syntax-deprecations
Fix deprecation warnings
2023-08-03 16:56:51 -07:00
Alex Hoppen
c0c7589547 Fix deprecation warnings
Fix deprecation warnings from SwiftSyntax and SwiftPM.
2023-08-03 09:45:29 -07:00
stevenwong
36747fe8fd Remove SyntaxClassification.objectLiteral 2023-08-03 09:14:02 +08:00
Alex Hoppen
8cb76ba22a Merge pull request #777 from ahoppen/ahoppen/code-actions-for-pulled-diags
Register diagnostics in `currentDiagnostics` when performing a diagnostic pull request
2023-07-22 20:22:44 -07:00
Alex Hoppen
8804e957f9 Register diagnostics in currentDiagnostics when performing a diagnostic pull request
We were registering new diagnsotics in `currentDiagnostics` when the diagnostics got pushed to us by sourcekitd, but not when they were pulled using the diagnostic request.

Fixes #776
rdar://112539108
2023-07-20 09:35:49 -07:00
Kim de Vos
1030c9bdbb Merge pull request #764 from kimdv/kimdv/1834-drop-keyword-suffix-from-tokenkindpoundavailablekeyword-etc 2023-07-19 08:06:55 +02:00
Alex Hoppen
8c7c32da5b Merge pull request #770 from ahoppen/ahoppen/inlayhint-edits
Don’t offer text edits from inlay hints if they are syntactically invalid
2023-07-18 16:32:05 -07:00
Alex Hoppen
6c99034367 Don’t offer text edits from inlay hints if they are syntactically invalid
Don’t offer any text edits for inlay hints displayed in closure paramters or enum case items.

Fixes #759
rdar://111559715
2023-07-18 08:09:11 -07:00
Kim de Vos
9a8392fc38 Remove Keyword suffix from Pound* 2023-07-18 14:02:48 +02:00
Ben Barham
e540e169bc Revert "Show a progress indicator in the editor if SourceKit-LSP is reloading packages" 2023-07-17 21:56:35 -07:00
Alex Hoppen
499cacca05 Merge pull request #767 from ahoppen/ahoppen/reloadpackage-progress
Show a progress indicator in the editor if SourceKit-LSP is reloading packages
2023-07-17 12:52:00 -07:00
Alex Hoppen
24317f1e97 Show a progress indicator in the editor if SourceKit-LSP is reloading packages
I noticed that the initial package loading can take ~5s. It’s good behavior to inform the client that sourcekit-lsp is busy reloading the package, showing the user that semantic functionality might not be ready yet.

https://github.com/apple/sourcekit-lsp/issues/620
rdar://111917300
2023-07-17 11:08:20 -07:00
Alex Hoppen
ab289aacca Merge pull request #761 from StevenWong12/enable_incremental_parse 2023-07-14 18:53:07 +02:00
stevenwong
f1d182e1a5 Make sourcekit-lsp parse swift source files incrementally
This feature will be used when we call `changeDocument` in SwiftLanguageServer
2023-07-14 14:41:30 +08:00
Alex Hoppen
7c15ba8731 Highlight references to actors like references to classes
We weren’t semantically highlighting references to actors because we missed the `ref_actor` case from the sourcekitd `annotations` response.

Fixes #694
rdar://104573568
2023-06-27 20:57:04 +02:00
Tristan Labelle
e91c83fd72 Remove reporting diagnostic support at SourceKitServer initialization 2023-05-31 10:30:54 -04:00
Tristan Labelle
94a62c1e33 Fixed CodeCompletion build error 2023-05-31 07:38:13 -04:00
Tristan Labelle
22234a0c44 Compilation fixes 2023-05-26 10:35:26 -04:00
Tristan Labelle
0da6291d22 Use CapabilityRegistry in ToolchainLanguageServer implementations 2023-05-26 10:35:26 -04:00
Tristan Labelle
bc444519c8 Report diagnostics support in SourceKitServer. 2023-05-26 10:35:26 -04:00
Tristan Labelle
e778ca24a6 Remove testing code 2023-05-26 10:35:26 -04:00
Tristan Labelle
542a29db2b Implement pull-model documentDiagnostics 2023-05-26 10:35:26 -04:00
Adam Fowler
07b9cc21e4 Requested changes from PR
rename symbol to symbolUSR
Cleanup OpenInterfaceRequest.init
2023-05-22 22:37:45 +01:00
Adam Fowler
0da1d40a28 Move module name split into OpenInterfaceRequest
Use group names when running open interface request
2023-05-21 10:26:00 +01:00
Adam Fowler
bbc4eeea5d Syntax changes after review 2023-05-20 16:32:59 +01:00