Storing NULL here on failure is brittle and was only necessary when the
typechecker was leaking type variables in expressions. Now that we're
better about this, it's best to preserve the damaged AST.
Propagates the VFS to the SemanticInfo that gets used when then
original editor.open is syntactic only.
Removes unnecessary filesystem arg (get filesystem from class field
instead).
Adds test for the VFS being propagated into the SemanticInfo.
Refactors test/SourceKit/CursorInfo/injected_vfs.swift to use
-print-raw-response for all its tests, for consistency.
The backing property for 'foo' is now '_foo', and the projected value '$foo'.
This updates Indexing to report occurrences of foo within both $foo and
_foo occurrences (rather than just $foo - the old _foo).
FindRelatedIdents was similarlar updated, so it reports 'foo' ranges in both
_foo and $foo.
CursorInfo now reports the USR, documentation, and location of foo when invoked
occurrences of $foo or _foo, but now leaves the name, type, and annotated
declaration of _foo/$foo as is. Having the same USR ensures rename invoked on
any of them will still rename via foo. Reporting foo's documentation comment
instead is just to present something more useful to the user.
Make sure they handle the case when a property wrapper type's constructor is
called with the first argument coming from the var initializer, and the rest
from the custom attribute's argument.
This is the final piece to get rename and findRelatedIdents to include all foo
and $foo occurrences, for example, in the set of occurrences to be renamed or
shown, regardless of whether they were initiated on a foo or $foo.
Resolves rdar://problem/51695783.
Previously, requests would fail silently by returning an empty struct
in the response.
With this change, responses will properly report fail with the internal
error.
Previously 'isSystemModule()' returns true only if the module is:
- Standard library
- Clang module and that is `IsSystem`
- Swift overlay for clang `IsSystem` module
Now:
- Clang module and that is `IsSystem`; or
- Swift overlay for clang `IsSystem` module
- Swift module found in either of these directories:
- Runtime library directoris (including stdlib)
- Frameworks in `-Fsystem` directories
- Frameworks in `$SDKROOT/System/Library/Frameworks/` (Darwin)
- Frameworks in `$SDKROOT/Library/Frameworks/` (Darwin)
rdar://problem/50516314
Previously, requests would fail silently by returning an empty struct
in the response.
With this change, responses will properly report fail with the internal
error.
Ensure the various entity walkers handle the implicit subscript
reference correctly (usually by ignoring it) and fall through to the
underlying declarations.
rdar://49028895
For now, this means USRs of ParamDecls. Soon, default argument generators
for subscripts will need this too.
Fixes <https://bugs.swift.org/browse/SR-8660>, <rdar://problem/44435221>.
When CursorInfo finds a reference to a VarDecl that's implicit but has a parent
VarDecl (according to VarDecl::getParentVarDecl), act as if we found the parent
instead.
When printing its annotated decl, we would would assume the param's default
value is present if the default value kind was "Normal". The type checker
explicitly sets the default value to nullptr if it doesn't type check though, so
we were crashing for that case. Added the check.
Resolves rdar://problem/46694149
The right way is findBufferContainingLoc. getBufferIdentifierForLoc is
both slower and wrong in the presence of #sourceLocation.
I couldn't come up with a test for the change in IDE/Utils.cpp because
refactoring still seems to be broken around #sourceLocation. I'll file
bugs for that.
This allows us to dump it in the generated interface, though it's
still not syntax-highlighted. This is necessary for textual module
interfaces, but it's also just a longstanding request for Xcode's
"Generated Interface" / "Jump to Definition" feature.
rdar://problem/18675831