Commit Graph

1106 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
64d73f4c2c Merge pull request #1013 from krzyzanowskim/marcin/deprecated-serversidefiltering
Add deprecated serverSideFiltering for backward compatibility
2024-01-08 18:05:23 -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
1e799a8cd3 Document deprecated property 2024-01-08 23:44:11 +01:00
Marcin Krzyzanowski
c7b0a68b4f add deprecated serverSideFiltering for backward compatibility 2023-12-28 00:10:27 +01:00
Marcin Krzyzanowski
0797a361d8 Add files to CMake files 2023-12-27 20:23:44 +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
e4c2a3fe32 Merge pull request #1002 from krzyzanowskim/marcin/missing-initializers-2
More public initializers
2023-12-20 14:13:54 -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
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
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
Marcin Krzyzanowski
11d6e55f49 Update formatting 2023-12-16 16:18:11 +01: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
4f5186e1d2 Merge pull request #997 from krzyzanowskim/marcin/missing-initializer-worskapce-folders 2023-12-14 17:16:23 -08:00
Alex Hoppen
ca8805a4be Merge pull request #993 from ahoppen/ahoppen/global-rename 2023-12-14 17:13:23 -08:00
Marcin Krzyzanowski
a8cd9bfe05 More public initializers 2023-12-14 21:08:45 +01: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
Marcin Krzyzanowski
8eeec74904 Add public initializer 2023-12-13 21:46:45 +01:00
Alex Hoppen
5a7a91027a Merge pull request #995 from krzyzanowskim/marcin/missing-initializer
WillSaveTextDocumentNotification public initializer
2023-12-13 12:44:21 -08:00
Marcin Krzyzanowski
c614d6bd56 Public initializer 2023-12-13 15:31:13 +01: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
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