Commit Graph

7 Commits

Author SHA1 Message Date
Alex Hoppen
a710111001 [SourceKit] Support building sourcekitd without building swift-syntax
This allows building sourcekitd and swift-refactor with `SWIFT_BUILD_SWIFT_SYNTAX=NO`. In these builds, the `relatedidents` and `find-syntactic-rename-ranges` requests will always return an error.
2023-12-04 19:14:01 -08:00
Alex Hoppen
5ed83ff616 [SourceKit] Update tests to use find-local-rename-ranges instead of invoking the local rename refactoring action
The local rename refactoring action will be removed in a follow-up commit.
2023-11-15 11:20:26 -08:00
Josh Soref
5bbb9489a5 spelling: capture
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-04-21 15:53:30 -04:00
Alex Hoppen
a535203096 [Refactoring] Only rename variables in capture lists once
Inside capture lists like `{ [test] in }`, `test` refers to both the newly declared, captured variable and the referenced variable it is initialized from. We currently try to rename it twice, yielding invalid, confusing results. Make sure to only record this situation once.

Fixes rdar://78522816 [SR-14661]
2021-07-09 11:38:37 +02:00
Nathan Hawes
9291201e32 [sourcekitd][Refactoring] Fix renaming of var decls in fallthrough case statements
We weren't renaming all occurrences of 'x' in the cases like the below:

  case .first(let x), .second(let x):
    print("foo \(x)")
    fallthrough
  case .third(let x):
    print("bar \(x)")

We would previously only rename occurrences within the case statement the query
was made in (ignoring fallthroughs) and for cases with multiple patterns (as in
the first case above) we would only rename the occurrence in the first pattern.
2019-03-20 14:38:08 -07:00
Rintaro Ishizaki
a6f7a8ea35 [Parser] Set local discriminator to ParamDecls
We have to discriminate between params and local variables.
2018-05-11 15:37:40 +09:00
Rintaro Ishizaki
df10afd1a2 [Parse] Discriminate local variables
Set local discriminator for all local `VarDecl`s. Otherwise, they cannot
be discriminated with USRs. This change is needed for rename refactoring which
uses USR for discrimiating variable names.

https://bugs.swift.org/browse/SR-7205,
rdar://problem/34701880
2018-05-11 15:34:42 +09:00