Commit Graph

15 Commits

Author SHA1 Message Date
Steffeeen aa3497e96c Rename DocumentSnapshot.absolutePositionRange() to positionRange()
This matches the naming of the `position` and `absolutePosition`
methods.
2026-04-07 10:47:59 +02:00
Alex Hoppen 07f8686456 Sort code actions in SyntaxRefactoringCodeActionProvider alphabetically
Also move them to the end of the file, where it’s easier to extend the list in the future.
2026-02-28 19:32:19 +01:00
Alex Hoppen 8920d78f3b Report convert-to-computed and convert-to-stored refactoring actions
These were implemented in swift-syntax but never added to the list of refactoring actions reported by SourceKit-LSP.

While at this, also fix two other things:
- Report an error if we non-exhaustively checked that we had an empty array of code actions, since this was a tautology
- Allow ignoring code actions that we don’t want to check for (needed to write sensible exhaustive checks)
- Fixed a bug that caused convert-to-zero-parameter-function to be reported when on a return statement in an accessor block
2026-02-28 19:31:36 +01:00
Alex Hoppen bc58ce982b Add infrastructure to allow easier implementation of code actions that have a non-Void context
Not really needed at the moment but may become useful in the future.
2026-02-28 19:13:32 +01:00
Karan 7435345133 Add RemoveRedundantParentheses refactoring action
Signed-off-by: Karan <karanlokchandani@protonmail.com>
2026-02-23 01:07:05 +05:30
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
Divya Prakash a9331eacea restored extensions and removed functions 2026-01-08 14:45:43 +05:30
Divya Prakash e987d9478b removed: helper extension 2026-01-08 09:59:57 +05:30
Divya Prakash 88e4d02b24 Made changes based on review 2026-01-07 21:59:46 +05:30
Divya Prakash f095486c91 Fix #2430: Hide 'Convert to computed property' for Void functions 2026-01-06 14:15:00 +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
Pavel Yaskevich 061c7a094b [SwiftLanguageService] CodeActions: Use asWorkspaceEdit in more places 2025-08-26 14:04:36 -07:00
Pavel Yaskevich 28ec028ef5 [SwiftLanguageService] Adopt to throwing refactoring actions
`EditRefactoringProvider.textRefactor` and `EditRefactoringProvider.refactor`
requirements are now throwing and produce a non-optional type.
2025-08-22 23:27:39 -07:00
Alex Hoppen c14f5dd7fd Move SwiftLanguageService into its own module 2025-08-14 11:12:31 +02:00