1799 Commits

Author SHA1 Message Date
Alex Hoppen
ad4b87ce6b Merge pull request #2467 from Steffeeen/selection-range 2026-03-01 08:17:54 +01:00
Steffeeen
d748f80896 Implement support for textDocument/selectionRange
This enables hierarchical selection expansion in supported editors.

Selection ranges are computed from the AST by walking upward from the
smallest enclosing node to the root. This is implemented by AST nodes
conforming to the `SelectionRangeProvider` protocol. Most nodes use a
default implementation which returns the node's `trimmedRange`.
Other nodes are special-cased to adjust the returned selection ranges
based on other factors.
2026-02-26 09:15:01 +01:00
Alex Hoppen
5440f6d5ee Merge pull request #2471 from Steffeeen/docc-topic-test
Add a test for the topic section in the DocC preview
2026-02-26 08:25:59 +01:00
Steffen
2699838a3c Add a test for the topic section in the DocC preview 2026-02-25 09:41:49 +01:00
Steffen
1558368226 Support a list of tuples for expectedResponses in DoccDocumentationTests
This is useful in cases where we want to check for multiple nodes at a
single position.
2026-02-25 09:41:49 +01:00
Alex Hoppen
2f472da57b Merge pull request #2443 from loveucifer/multiline-string-interpolation
add support for multi-line string literals when converting string concatenation to string interpolation
2026-02-16 15:51:23 +01:00
loveucifer
5b4af90a81 Apply .indented(by:) 2026-02-15 21:53:01 +05:30
Alex Hoppen
109613dbb4 Merge pull request #2479 from glessard/filter-with-typed-throws
[test] change to expect the updated signature of `filter()`
2026-02-13 18:08:53 +01:00
Alex Hoppen
0ad0ac4f15 Merge pull request #2445 from loveucifer/type-definition-request
Implement textDocument/typeDefinition request
2026-02-11 19:05:51 +01:00
Guillaume Lessard
9ef5e64731 [test] change to expect the updated signature of filter() 2026-02-09 18:26:09 -08:00
loveucifer
e1f1e08cc9 some fixes 2026-02-09 16:44:58 +05:30
loveucifer
c6e54fb46a Fix multiline string support in string concatenation to interpolation refactoring 2026-02-05 13:11:40 +05:30
Steffen
4e807a4e70 Fix compile warnings in Sources and Tests 2026-01-30 15:07:44 +01:00
loveucifer
250f6f62aa Fix multiline string indentation stripping and remove duplicate test 2026-01-30 02:58:25 +05:30
loveucifer
cf56bf2ce6 Address PR review feedback
- Add DefinitionLocations.swift to CMakeLists.txt
- Add proper documentation comments to functions in DefinitionLocations.swift
- Make indexToLSPLocation private since it's only used within the file
- Revert unrelated comment changes in InlayHintResolve.swift
- Use .only instead of .first in InlayHintResolve to avoid ambiguous types
- Refactor TypeDefinition.swift to use cleaner control flow with guard/else
- Add test for jumping to generated interface (String)
2026-01-19 17:12:33 +05:30
loveucifer
4770e0c73e address reviewer feedback: use IndentationRemover for trivia-only indentation handling
- Replace custom stripIndentation with IndentationRemover
- Update test expectations to preserve content indentation (trivia-only)
- Add clarifying comment for trailing trivia removal
- Use Swift commas in conditions
- Simplify trailing trivia removal code
2026-01-19 16:44:37 +05:30
loveucifer
e0dcca98c4 merge upstream main 2026-01-18 16:37:39 +05:30
loveucifer
82a7726297 fix type annotation 2026-01-17 16:17:59 +05:30
loveucifer
2a360c046e address comments 2026-01-17 16:17:59 +05:30
loveucifer
4d08603e30 fix trivia handling 2026-01-17 15:12:27 +05:30
loveucifer
94ad50d2cf some improvements 2026-01-16 18:30:49 +05:30
loveucifer
d8b8d71fae Implement textDocument/typeDefinition request 2026-01-16 18:13:12 +05:30
Alex Hoppen
61ba0c92a4 Merge pull request #2436 from loveucifer/inlay-hint-go-to-definition 2026-01-16 13:16:45 +01:00
Alex Hoppen
155b0ce003 Merge pull request #2432 from ahoppen/suppress-superseded-sourcekitd-refactorings
Don’t show sourcekitd refactoring actions that have been superseded by swift-syntax refactoring actions
2026-01-16 07:42:33 +01:00
loveucifer
4ece7f9eea fix trailing trivia handling 2026-01-15 08:02:34 +05:30
Karan Lokchandani
473088afe6 Add position markers in the expected ranges (#2449)
this should make tests more readable, follow up to this pr
https://github.com/swiftlang/sourcekit-lsp/pull/2435
reference comment here
https://github.com/swiftlang/sourcekit-lsp/pull/2435#discussion_r2670161613

---------

Signed-off-by: Karan <karanlokchandani@protonmail.com>
2026-01-13 23:06:06 +01:00
Karan Lokchandani
55d75954e5 Add if let to guard transform (#2420)
fixes: https://github.com/swiftlang/sourcekit-lsp/issues/1569

mostly works but not sure what to do with many edge cases and has a todo
for switch statements, also this will probably have conflicts with
https://github.com/swiftlang/sourcekit-lsp/pull/2406 marking as draft
till that merges and i can resolve the conflicts.


https://github.com/user-attachments/assets/a6d07f9d-6f09-4330-8cd0-2d24bd6973fb

---------

Signed-off-by: Karan <karanlokchandani@protonmail.com>
2026-01-13 22:46:54 +01:00
Alex Hoppen
3b2ff3226f Merge pull request #2448 from PhantomInTheWire/fix/demorgan
Fix bugs in demorgan implementation
2026-01-12 15:02:04 +01:00
loveucifer
ceaf87b6df Run swift-format 2026-01-12 06:15:38 +05:30
Ahmad Ayman Mansour
53e247457b running swift formate 2026-01-11 20:46:51 +02:00
loveucifer
22e7ac048f Add generated interface support for SDK types in inlay hints 2026-01-11 17:04:39 +05:30
loveucifer
81610b3665 Simplify InlayHintResolveData using Position LSPAnyCodable 2026-01-11 16:52:41 +05:30
Karan
babb3eaae2 Fix try fusion bug 2026-01-11 08:38:14 +05:30
Karan
04ca5078cc Fix indentation and trivia not being attached to new negation
Signed-off-by: Karan <karanlokchandani@protonmail.com>
2026-01-11 08:28:02 +05:30
Karan
e6c9e6dc0a add regression tests 2026-01-11 01:49:55 +05:30
Ahmad Ayman Mansour
b8e4d2def2 Merge remote-tracking branch 'upstream/main'
# Conflicts:
#	Tests/SourceKitLSPTests/DefinitionTests.swift
2026-01-10 18:27:01 +02:00
Ahmad Ayman Mansour
80c9e43250 Skip jump-to-definition for literal values
Return empty response when cursor is on literal tokens (strings,
integers, floats, booleans, nil) since they have no declaration.

Resolves #2368

Co-Authored-By: clemo97 <lumumbaclement@gmail.com>
2026-01-10 18:21:29 +02:00
loveucifer
9e12af1f45 Add cross-module inlay hint resolve test 2026-01-10 07:05:01 +05:30
loveucifer
3630ab970c Address review feedback for inlay hint go-to-definition
- Use cursorInfo USR lookup instead of index (more accurate)
- Add document version tracking to reject stale resolve requests
- Make InlayHintResolveData conform to LSPAnyCodable
- Reference swiftlang/swift#86432 for mangled type workaround
- cursorInfoFromTypeUSR takes DocumentSnapshot for version safety
- Remove TypeDefinition.swift (defer to follow-up PR)
- Remove unnecessary comments
- Tests work without index
2026-01-10 07:00:43 +05:30
loveucifer
564a45b03c Add go-to-definition for inlay type hints 2026-01-09 23:46:58 +05:30
loveucifer
d465ba967a multiline string interpolation 2026-01-09 16:09:33 +05:30
Alex Hoppen
29a0bdd15f Merge pull request #2395 from PhantomInTheWire/feat/add-parameterLabel-modifier 2026-01-09 10:51:23 +01:00
Alex Hoppen
2d8a44af76 Merge pull request #2422 from loveucifer/fix-language-service-shutdown-2211 2026-01-09 08:46:25 +01:00
Alex Hoppen
69c864b762 Merge pull request #2407 from Kila2/feature/optimize_swift_definition_locations
Fallback to swiftmodule interface when index lookup fails
2026-01-08 19:19:16 +01:00
Alex Hoppen
fc876d01a4 Merge pull request #2433 from DPrakashhh/fix/no-computed-property-for-void-2430
Fix #2430: Hide 'Convert to computed property' for Void functions
2026-01-08 16:59:14 +01:00
loveucifer
f46a31ba3d Use new cursorInfo type declaration fields for inlay hints
update inlay hint resolution to use the new type declaration location

fields from cursorInfo, with fallback to index lookup using the new

typeDeclUsr (a proper declaration USR).

Changes i made :

- Regenerated sourcekitd_uids.swift with new keys

- InlayHintResolve.swift: Try direct location first, fallback to index

- InlayHintTests.swift: Fixed test to properly verify location

This Requires: swift/swiftlang PR## #86381  for compiler changes
2026-01-08 21:00:17 +05:30
Kila2
cbfe166e24 Update Tests/SourceKitLSPTests/DefinitionTests.swift
Co-authored-by: Alex Hoppen <alex@alexhoppen.de>
2026-01-08 19:16:09 +08:00
Alex Hoppen
69785ccb0a Merge pull request #2435 from PhantomInTheWire/fix/indenation-codeable-structs
Fix JSON base indentation in Create Codable structs
2026-01-08 10:58:58 +01:00
loveucifer
97ceb675ee tiny fix 2026-01-08 13:18:17 +05:30
loveucifer
2019ab711a mark SwiftLanguageService as immortal to skip shutdown 2026-01-08 05:01:42 +05:30