Commit Graph

415 Commits

Author SHA1 Message Date
Alex Hoppen
7fb81deb23 Merge pull request #1015 from ahoppen/ahoppen/no-rename-failures
Ensure rename tests don’t fail if running with a sourcekitd that doesn’t support rename yet
2024-01-09 15:18:08 -08:00
Alex Hoppen
ca470335e6 Merge pull request #1008 from ahoppen/ahoppen/skd-array-dictionary-from-literal
Support creation of SKDRequest(Dictionary|Array) from literals
2024-01-09 13:26:00 -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
a6fe4848b6 Merge pull request #994 from ahoppen/ahoppen/log-clangd-build-server
Log messages from the build server and clangd
2024-01-08 21:38:28 -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
3991fae867 Define methods on SourceKitD to create arrays and dictionaries instead of using skd postfix syntax 2024-01-08 18:06:31 -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
Alex Hoppen
2f80ccae3b Merge pull request #1005 from ahoppen/ahoppen/global-rename-review
Address review comments from #993
2024-01-08 16:25:17 -08:00
Marcin Krzyzanowski
79ca4c0ac6 Remove redundant typealias 2024-01-08 23:51:09 +01:00
Marcin Krzyzanowski
2c616f7838 Refactor SemanticTokenTypes, SemanticTokenModifiers 2023-12-26 22:55:12 +01:00
Alex Hoppen
f901cc9250 Support creation of SKDRequest(Dictionary|Array) from literals
IMO this makes it a lot clearer which keys are present in the request dictionaries because we are no longer mutating them on the fly.
2023-12-22 22:29:11 -08: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
Marcin Krzyzanowski
25a1b4543d Convert SourceKitIndexDelegate to be an actor (#1003) 2023-12-19 13:48:07 -08:00
Alex Hoppen
bda1387a46 Refactor rename to avoid a force unwrap 2023-12-19 10:54:06 -08:00
Alex Hoppen
b381811710 Merge pull request #1000 from ahoppen/ahoppen/wrap-logging-category 2023-12-18 18:04:12 -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
be0dd73135 Support folding of function parameter clauses
Fixes #898
rdar://116877123
2023-12-14 09:03:10 -08:00
Alex Hoppen
c36a854e7a Wrap request and notification ID for the purpose of logging scopes
OSLog only allows the creation of 4000 logger objects, which means that logging will crash on the 4000th request to sourcekit-lsp (which would create the 4000th os_log object because it is the 4000th distinct category in which we are logging).

To circumvent this problem, only use the last two digits of the request and notification ID for the logging scope and wrap around afterwards. This should still allow us to tell apart log messages from concurrently handled requests/notifications while only using 200 os_log objects, which means we stay well clear of the 4000 limit.

rdar://119221355
2023-12-14 08:22:36 -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
c8b2f76adc Move FoldingRange to its own file
No code change here.
2023-12-13 16:00:35 -08:00
Alex Hoppen
e08f0a906a Set the renameProvider capability 2023-12-13 14:37:35 -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
052997a82c Address stylistic review comments from #990 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
757a029664 Log messages from the build server and clangd
Log messages sent to clangd and the build server in a similar way that we log requests to sourcekitd.

Fixes #886
rdar://116705677
2023-12-12 14:05:25 -08:00
Alex Hoppen
d931806c69 Merge pull request #988 from z2oh/configure-workspace-type
Allow configuring workspace type via flag
2023-12-12 10:50:52 -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
Jeremy Day
c31417ac92 Fix formatting 2023-12-11 14:05:04 -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
8857a08940 Parse information from related identiers that is needed to perform local rename 2023-12-09 08:34:41 -08:00
Alex Hoppen
8acc5bd999 Factor related identifiers request into a separate file
This allows use to re-use related identifiers when implementing rename
2023-12-09 08:34:40 -08:00
Jeremy Day
c006421667 Switch to more descriptive case names 2023-12-08 15:23:03 -08:00
Jeremy Day
3278ff0612 Enable per-workspace configuration of default workspace type 2023-12-08 11:06:11 -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
Jeremy Day
cafc63ea98 Add --workspace-type flag 2023-12-06 10:29:19 -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
f293741dca Merge pull request #981 from ahoppen/ahoppen/never-error-for-diagnostics-request
Never return error for diagnostics request
2023-12-05 10:03:45 -08:00
Alex Hoppen
c7bd8c9e8f Consider all symbol replies from clangd dynamic 2023-12-04 18:49:36 -08:00
Marcin Krzyzanowski
b7cc49bcfa Decode RegistrationOptions (#980) 2023-11-30 00:46:03 -08:00