81 Commits

Author SHA1 Message Date
loveucifer
5b4af90a81 Apply .indented(by:) 2026-02-15 21:53:01 +05:30
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
loveucifer
250f6f62aa Fix multiline string indentation stripping and remove duplicate test 2026-01-30 02:58:25 +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
4d08603e30 fix trivia handling 2026-01-17 15:12:27 +05:30
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
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
loveucifer
d465ba967a multiline string interpolation 2026-01-09 16:09:33 +05:30
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
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
Divya Prakash
88e4d02b24 Made changes based on review 2026-01-07 21:59:46 +05:30
Karan
d2ca6b9896 Fix indentation for failing tests to match expectations
Signed-off-by: Karan <karanlokchandani@protonmail.com>
2026-01-07 13:22:22 +05:30
Karan
bd66d48ea8 Use assertRefactor based declarative tests 2026-01-07 03:21:35 +05:30
Karan
f7e2bc9a94 Order markers ascendingly and use 4 as invocation marker 2026-01-07 01:35:17 +05:30
Karan
28fb997071 Minor test and header fix 2026-01-07 01:02:15 +05:30
Karan
97e278c57f Add test for JSON base indentation in Create Codable structs
Signed-off-by: Karan <karanlokchandani@protonmail.com>
2026-01-06 18:20:39 +05:30
Karan
874aeb0c88 collect all valid code actions 2026-01-06 16:47:22 +05:30
Karan
b2f8e1a0f1 use multi-line string literal for line comment test 2026-01-06 16:06:47 +05:30
Karan
8f08475a4c move assertDeMorganTransform to top-level 2026-01-06 15:40:37 +05:30
Karan
48097c13e7 Simplify DeMorgan test parsing 2026-01-06 15:36:25 +05:30
Karan
7ffacf5746 tests: remove comments, infavour of self documenting tests
Signed-off-by: Karan <karanlokchandani@protonmail.com>
2026-01-06 15:29:53 +05:30
Karan
4b996e8cc0 test(sourcekit-lsp): add unit tests for De Morgan's Law code action 2026-01-06 15:18:39 +05:30
Divya Prakash
f095486c91 Fix #2430: Hide 'Convert to computed property' for Void functions 2026-01-06 14:15:00 +05:30
Alex Hoppen
529c9fa7e2 Don’t show sourcekitd refactoring actions that have been superseded by swift-syntax refactoring actions
For now, this is only the action to add thousands separators to integer literals but hopefully this list will grow as we translate more refactoring actions to swift-syntax.
2026-01-06 09:07:38 +01:00
loveucifer
d64cc0b463 map semantic refactoring kinds to specific LSP code action kinds 2026-01-04 21:00:59 +05:30
Vladimir Gusev
9647dcc3dc Convert between computed properties and zero-parameters functions 2025-11-14 12:00:46 +03:00
Owen Voorhees
f04b971726 Adopt swift-tools-protocols 2025-10-31 14:11:11 -07:00
Alex Hoppen
4c957506e8 Add a code action to remove unused imports in a source file
The idea is pretty simple: When `MemberImportVisibility` is enabled, we know that imports can only affect the current source file. So, we can just try and remove every single `import` declaration in the file, check if a new error occurred and if not, we can safely remove it.
2025-10-22 23:56:09 +02:00
Pavel Yaskevich
0594744a93 [SwiftLanguageService] Adopt changes to package manifest refactoring actions
Previously package manifest refactoring actions conformed to a custom
refactoring provider and produced a `PackageEdit` that, in addition to
manifest file changes, included a list of auxiliary files. This is no
longer the case and all package manifest refactoring actions are now
responsible only for manifest file transformations, the rest is handled
separately.
2025-08-26 13:00:00 -07:00
Alex Hoppen
d5e254137c Make fulfillmentOfOrThrow take a variadic list of expectations
In almost all cases, we pass a single expectation and that looks a lot nicer with a variadic parameter.
2025-03-25 09:16:17 -07:00
Ben Barham
94ba7ea205 Merge pull request #1945 from bnbarham/revert-test-disable
Revert "Temporaily disable two crashing test cases"
2025-02-11 14:39:50 -08:00
Rintaro Ishizaki
fe5644bc36 Merge pull request #1929 from rintaro/swiftdiags-replace-trivia
[Tests] Update for swift-syntax FixIt changes
2025-01-22 09:32:57 -08:00
Ben Barham
21ca1ddb7b Revert "Temporaily disable two crashing test cases"
This reverts commit f0adee56b6.
2025-01-22 09:29:09 -08:00
Ben Barham
f0adee56b6 Temporaily disable two crashing test cases 2025-01-21 16:51:38 -08:00
Rintaro Ishizaki
58c6938acf [Tests] Update for swift-syntax FixIt changes 2025-01-16 15:06:33 -08:00
Alex Hoppen
1d7c27bc4b Adopt MemberImportVisibility 2024-11-05 21:04:01 -08:00
Alex Hoppen
79ca537a40 Pass the test name through assertCodeActions 2024-10-09 14:20:54 -07:00
Alex Hoppen
06f6f8f17b Remove references to the LanguageServerProtocol modules in that module itself 2024-10-02 14:16:33 -07:00
Alex Hoppen
d4ebf594f0 Add convenience accessor in tests to get a full diagnostic report
This simplifies tests a little bit
2024-08-15 16:31:07 -07:00
Alex Hoppen
1ef71cf663 Merge LSPTestSupport and SKTestSupport 2024-07-25 09:11:13 -07:00
Kai Lau
db3867bdbb fixed the issue that leading and trailing trivia are lost after string interpolation conversion 2024-07-20 16:45:40 -07:00
Kai Lau
17e33a672b Convert String Concatenation to String Interpolation
added `ConvertStringConcatenationToStringInterpolation` to convert string concatenation to string interpolation:
- the string concatenation must contain at least one string literal
- the number of pound symbols in the resulting string interpolation is determined by the highest number of pound symbols among all string literals in the string concatenation
- multiline string literals are not supported
registered in `SyntaxCodeActions.allSyntaxCodeActions`
registered in Sources/SourceKitLSP/CMakeLists
created a test in `CodeActionTests`
2024-07-17 14:57:30 -07:00
Alex Hoppen
122c2ae6ab Relax assertions about diagnostics from missing protocol requirements
In some Swift 6 toolchains, the diagnostic about missing protocol requirements is emitted on the protocol in the inheritance clause instead of the conforming type. Relax a few assertions in the tests.
2024-06-11 09:12:20 -07:00
Lokesh.T.R
2c407571f5 Change static method DocumentURI.for(_:testName:) to an initializer DocumentURI(for:testName:) 2024-05-24 16:40:25 +00:00
Alex Hoppen
9e49f67455 Rename TestSourceKitLSPClient.handleNextRequest to handleSingleRequest
Since `handleNextRequest` handling doesn’t have to be in the order that the request handlers were specified anymore, the naming was misleading.
2024-05-22 13:31:58 -07:00