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 invocation options are not an appropriate place to put this state,
since it can change between requests. This moves it to the editor
document, allowing us to change the specific VFS instance without
causing a rebuild (unless the contents/timestamps for a dependency
change).
Comparing "false" > "true" will return 0, which when returned by compare
indicates the two are equal which will result in a non deterministic
ordering of "false" and "true". Using .compare returns a negative number
as expected.
Update the PlaceholderFinder ASTWalker to walk into the clauses of
IfConfigDecls. It wasn't previously, resulting in any placeholders there not
being expanded.
Also update CallExprFinder (used to determine if expansions should use trailing
closure syntax) to walk into inactive if-config clauses. Previously it only
walked into active regions, so expansions never used trailing closure syntax in
inactive regions.
Resolves rdar://problem/51995648
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.
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.
This has been an unnecessary code path for a long time now and should be removed particularly because it triggers wasteful `stat` calls.
rdar://51523161
Since Dispatch threads have a 64k stack size, tests were failing due to
blowing the stack on Windows. This runs the tests in thread with a
larger stack size. This fixes some 90ish sourcekit tests on Windows.
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.
When sanitizing the documentation comments for synthesized extensions,
we expect some text like "<declaration>extension". This isn't the case
when use-facing attributes are present.
rdar://50913510
This lets us make some more assumptions in the next commit, but I
think it's also just a nice cleanup to /not/ allow random predicates
here.
There were three callers of this API:
- PrintAST, which was using PrintOptions::shouldPrint but /also/
incorrectly notifying listeners that a declaration would be skipped.
- (IDE) Interface generation, which uses PrintOptions::shouldPrint to
count how many "inherits" there will be.
- SwiftDocSupport's reportRelated, which does no filtering at all.
Creating a PrintOptions here is a little more expensive, but still.
No intended functionality change.
The llvm::ArrayRef constructor should be passed the actual length of the
resulting string, not MAX_PATH, else the StringRef that results has an
incorrect length of MAX_PATH.