Commit Graph

428 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
403fc5e92f Merge pull request #1021 from ahoppen/ahoppen/retroactive-5.11
Guard usages of `@retroactive` by Swift 5.11, not 5.10
2024-01-11 13:14:21 -08:00
Alex Hoppen
4b32dfe121 Guard usages of @retroactive by Swift 5.11, not 5.10
I incorrectly thought that `@retroactive` gets introduced by Swift 5.10 but it’s only available in Swift 5.11.
2024-01-11 09:41:18 -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
d55e2a2b88 Merge pull request #1007 from ahoppen/ahoppen/concurrent-map
Add a `concurrentMap` function to `Collection`
2024-01-10 15:52:39 -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
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
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
a73d0df77b Add a concurrentMap function to Collection
I find this a lot more intuitive to use than `TaskGroup`.
2024-01-08 18:34:24 -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