Commit Graph

278 Commits

Author SHA1 Message Date
Alex Hoppen
3e432c495a Merge pull request #965 from joehsieh/cache-diagnostics 2024-01-11 23:41:21 -08:00
Alex Hoppen
1e72500f1a Merge pull request #1017 from ahoppen/ahoppen/secondary-cursor-info-results
Report secondary cursor info results
2024-01-11 09:30:10 -08:00
Alex Hoppen
7572fb96ee Report secondary cursor info results
rdar://119163908
2024-01-10 21:05:31 -08:00
Alex Hoppen
7f59f6f4f0 Merge pull request #1016 from ahoppen/ahoppen/ignore-trigger-from-incomplete-completions
Ignore `triggerFromIncompleteCompletions` when performing code completion
2024-01-10 20:41:03 -08:00
joehsieh
8dcfb30cdb Add cache to avoid requesting diagnostics from sourcekitd frequently
Move the responsibility of sending requests to get diagnostics from SwiftLanguageServer to DiagnosticReportManager

Make buildSettings as part of the key to the cache

Add ReportTask and refine the code

Reset cache for reportTasks if needed

Finetune the wordings and logics

Solve conflicts

Only remove necessary items from cache

Refine the code
2024-01-11 10:36:37 +09:00
Alex Hoppen
53a07b3b9f Ignore triggerFromIncompleteCompletions when performing code completion
See comment in added test case.

rdar://117711597
2024-01-10 16:12:14 -08:00
Alex Hoppen
e1612d5003 Merge pull request #1018 from ahoppen/ahoppen/toolchain-registry
Migrate `ToolchainRegistry` to be an actor
2024-01-10 15:28:11 -08:00
Alex Hoppen
e8e4fb2106 Merge pull request #1011 from krzyzanowskim/marcin/fix-array-decoding
Fix decoding Array of LSPAnyCodable
2024-01-09 18:13:26 -08:00
Alex Hoppen
6f342e2b82 Remove static shared toolchain registry
Global state is never a good thing and we needed to modify it in tests. The design becomes a lot cleaner if we explicitly pass the toolchain registry around.
2024-01-09 17:17:31 -08:00
Alex Hoppen
3e73f11de0 Migrate ToolchainRegistry to be an actor 2024-01-09 17:17:31 -08:00
Alex Hoppen
03a122dd23 Ensure rename tests don’t fail if running with a sourcekitd that doesn’t support rename yet
Just another case of making sure that sourcekit-lsp’s tests don’t fail after checking out the repo and running its tests using eg. Xcode 15.1 without an open source toolchain snapshot.
2024-01-09 12:05:21 -08:00
Alex Hoppen
e0fe9d6aa1 Merge pull request #1012 from krzyzanowskim/marcin/semantictokentypes
Refactor SemanticTokenTypes, SemanticTokenModifiers
2024-01-08 18:14:28 -08:00
Alex Hoppen
73ec32537d Merge pull request #1006 from ahoppen/ahoppen/prepare-rename
Support the prepare rename request
2024-01-08 17:03:47 -08:00
Marcin Krzyzanowski
79ca4c0ac6 Remove redundant typealias 2024-01-08 23:51:09 +01:00
Marcin Krzyzanowski
01e939094a Test semantic tokens legend response 2023-12-27 00:23:25 +01:00
Marcin Krzyzanowski
2c616f7838 Refactor SemanticTokenTypes, SemanticTokenModifiers 2023-12-26 22:55:12 +01:00
Alex Hoppen
527600e977 Support the prepare rename request
This allows us to return the current compound decl name when renaming a function, which will get populated as the default value for the text field in which the user enters the new symbol name.

rdar://118995649
2023-12-20 09:43:26 -08:00
Alex Hoppen
f88c241714 Refactor multi-file rename tests to specify expected renamed source instead of asserting on edits 2023-12-19 10:54:35 -08:00
Alex Hoppen
f32e7dd51c Merge pull request #999 from ahoppen/ahoppen/folding-range-improvements
Improve code folding
2023-12-15 07:43:49 -08:00
Alex Hoppen
ca8805a4be Merge pull request #993 from ahoppen/ahoppen/global-rename 2023-12-14 17:13:23 -08:00
Alex Hoppen
be0dd73135 Support folding of function parameter clauses
Fixes #898
rdar://116877123
2023-12-14 09:03:10 -08:00
Alex Hoppen
fbb77c6ce4 Don’t report empty folding ranges 2023-12-13 16:38:08 -08:00
Alex Hoppen
2bae1f0d75 Improve folding of calls that span multiple lines 2023-12-13 16:34:07 -08:00
Alex Hoppen
796138be5e Support folding of switch cases 2023-12-13 16:14:04 -08:00
Alex Hoppen
cc4cfac73b Support folding of collection literals 2023-12-13 16:10:14 -08:00
Alex Hoppen
fc3c51989f Consider trivia symetrically when folding braced blocks 2023-12-13 16:05:38 -08:00
Alex Hoppen
1432390244 Refactor folding range tests
Instead of one big test fixture, create multiple smaller test cases checking individual functionality.
2023-12-13 16:01:04 -08:00
Alex Hoppen
c2705a0872 Add an XCTest that performs the same testing logic as test-sourcekit-lsp.py in swift-integration-tests
This has two advantages: (1) We catch failures in this test setup more quickly and (2) it’s easier to debug because you can just attach a debugger to the test execution.
2023-12-13 11:28:17 -08:00
Alex Hoppen
86553d98ab Allow rename when the new name is missing the ) or if it has text after ) 2023-12-12 17:34:34 -08:00
Alex Hoppen
2b9a99e3cb Increase test coverage of rename
- Invoke the rename request from multiple marker locations within a test file
- Add more test cases to test compound decl name references
2023-12-12 17:34:34 -08:00
Alex Hoppen
997ef38916 Support rename across Swift files
rdar://118995700
2023-12-12 17:34:34 -08:00
Alex Hoppen
34a36b44e6 Refactor rename to support index-based discovery of rename locations 2023-12-12 17:34:34 -08:00
Alex Hoppen
ce9fdf9258 Merge pull request #990 from ahoppen/ahoppen/rename
Implement local rename within the current file
2023-12-11 19:39:35 -08:00
Alex Hoppen
6b5842f0a2 Send source text for find-syntactic-rename-ranges 2023-12-09 08:35:14 -08:00
Alex Hoppen
777f1dc463 Add support for rename within the current file
rdar://117822427
2023-12-09 08:35:13 -08:00
Alex Hoppen
96905aaf16 Add a request to get all tests within a file 2023-12-06 17:40:21 -08:00
Alex Hoppen
446f9280da Add a request to list all the tests within the current workspace
Fixes #611
rdar://98710526
2023-12-06 17:40:21 -08:00
Alex Hoppen
17eca18f47 Merge pull request #989 from ahoppen/ahoppen/dont-use-local-loc-for-c-definition
Don’t use the best local declaration when jumping to definition of a C function
2023-12-06 17:38:58 -08:00
Alex Hoppen
2d01d5d146 Merge pull request #983 from ahoppen/ahoppen/parameter-highlighting
Add semantic highlighting for function parameter labels
2023-12-06 14:25:24 -08:00
Alex Hoppen
4077ce360d Don’t use the best local declaration when jumping to definition of a C function
For non-Swift symbols, we need to perform an index lookup because the best local declaration will point to a header file but jump-to-definition should prefer the implementation (there's the declaration request to jump to the function's declaration).

rdar://119243893
2023-12-06 11:08:44 -08:00
Alex Hoppen
742455833b Add semantic highlighting for function parameter labels 2023-12-06 10:02:39 -08:00
Alex Hoppen
ed410e6503 Merge pull request #977 from ahoppen/ahoppen/jump-to-override
Show overriden functions when performing jump-to-definition on a dynamic call
2023-12-05 16:18:46 -08:00
Alex Hoppen
c7bd8c9e8f Consider all symbol replies from clangd dynamic 2023-12-04 18:49:36 -08:00
Alex Hoppen
84fdea9e05 Filter overrides in DefinitionRequest by receiver types 2023-11-29 09:03:36 -08:00
Alex Hoppen
4052465905 Show overriden functions when performing jump-to-definition on a dynamic call
Fixes #809
rdar://114864256
2023-11-29 09:02:02 -08:00
Alex Hoppen
49d4db32d3 Merge pull request #974 from ahoppen/ahoppen/build-settings-for-workspace-folder
Add support for different arguments per workspace
2023-11-28 18:57:40 -08:00
Alex Hoppen
33f4612243 Add support for different arguments per workspace
Fixes #663
rdar://101815704
2023-11-28 11:19:09 -08:00
Alex Hoppen
b85f3afc10 Report MARK comments in the document symbols request
Fixes #963
rdar://117811210
2023-11-27 15:55:50 -08:00
Alex Hoppen
9595498dae Don’t include local variables in document symbols
Fixes #962
rdar://117810784
2023-11-27 15:38:36 -08:00
Alex Hoppen
e6cf72317d Merge pull request #975 from ahoppen/ahoppen/normalize-identifier-start
Support cursor info-based requests when cursor is placed at the end of an identifier
2023-11-27 15:36:19 -08:00