Commit Graph

10 Commits

Author SHA1 Message Date
Alex Hoppen
63aeedecbd [SourceKit] Only report textual results inside comments and strings from syntactic rename ranges 2024-02-29 15:37:29 -08:00
Alex Hoppen
d0f9346efa [SourceKit] Change rename-mismatch to define input spec and expected output inline with the test file 2023-11-10 11:46:59 -08:00
Alex Hoppen
4c1d875cf8 Remove the syntacticrename request
`source.request.find-syntactic-rename-ranges` should be used instead.
2023-11-10 11:46:47 -08:00
Ben Barham
e811c028f1 [IDE] Use the passed in Action for setting up an invocation
There was a recent change to error early if the stdlib couldn't be
loaded when semantic functionality is required. Since
`ide::initCompilerInvocation` was ignoring the given `Action` and just
setting to `Typecheck` instead, this would cause an error even if
semantic functionality *wasn't* required.

Resolves rdar://88968608.
2022-02-15 18:06:37 -08:00
Nathan Hawes
bce68fa4e5 [IDE][Refactoring] Handle 'callAsFunction' specially in syntactic rename.
This change makes us treat it exactly as we do 'init'. We don't allow renaming the base name,
and don't fail if the basename doesn't match for calls.

Also:
  - explicit init calls/references like `MyType.init(42)` are now reported with
    'init' as a keywordBase range, rather than nothing.
  - cursor info no longer reports rename as available on init/callAsFunction
    calls without arguments, as there's nothing to rename in that case.
  - Improved detection of when a referenced function is a call (rather than
    reference) across syntactic rename, cursor-info, and indexing.

Resolves rdar://problem/60340429
2020-04-12 17:14:15 -07:00
Nathan Hawes
91ec9982a8 [refactoring] Avoid producing empty categorised edit ranges when renaming init. Also disallow renaming inits with no arguments. 2018-03-05 18:38:35 -08:00
Nathan Hawes
c4e87f0861 [Refactoring] Fix local rename missing occurrences in string interpolations
NameMatcher checked if a StringLiteralExpr was a string segment in an
interpolated string by checking if the parent expression was an
InterpolatedStringLiteralExpr. That's only true pre-type-checking, and unlike
global rename, local rename  uses the type-checked AST.
2017-11-17 20:16:59 -08:00
Nathan Hawes
7403e779ad [ASTWalker|Refactoring] Walk generic params and requirements in source order for subscript decls
Also handle requirements in non-trailing where clauses (for -swift-version 3)
Resolves rdar://problem/34859742
2017-11-16 16:02:12 -08:00
Nathan Hawes
708c55607c [ASTWalker] When walking a NominalTypeDecl, walk any generic param requirements after its inherited/conformed-to TypeLocs to maintain a source-order walk. 2017-10-25 14:57:12 -07:00
Argyrios Kyrtzidis
60a91bb736 [refactoring] Upstreaming the implementation for Swift local refactoring (#11568)
[refactoring] Upstreaming the implementation for Swift local refactoring
2017-08-22 16:50:16 -07:00