Mangling a non-canonical type can run into
unexpected type sugar such as the newly introduced
LocatableType. USRs should be based on canonical
types anyway, so make sure we canonicalize before
mangling.
rdar://141168628
The implementation of `#if` configuration evaluation assumed that the
SourceFile instance within the `Parser` contained all of the source ranges
for code parsed within that `Parser` instance. This is not always the case,
so avoid using the SourceFile directly and instead use the source buffer
that directly contains the condition.
Fixes https://github.com/swiftlang/swift/issues/76137. Big thank you
to Alex Hoppen and the stress tester for finding this.
That way, when the request gets truncated by os_log in sourcekit-lsp, we see most of the request. Most likely the sourcetext and the compiler args wouldn't have made it into the log message completely anyway.
rdar://121322828
Adds a new 'key.retrieve_symbol_graph' option to the request. When set to 1 it
includes the JSON for a SymbolGraph containing a single node for the symbol at
the requested position.
This also extends the SymbolGraph library with a new entry point to get a graph
for a single symbol, and to additionally support type substitution to match the
existing CursorInfo behavior (e.g. so that when invoked on `first` in
`Array<Int>().first`, the type is given as `Int?` rather than `Element?`).
Resolves rdar://problem/70551509
This adjusts the tests for the difference between line endings on
different platforms. Windows uses CRLF while most Unicies use LF. This
was exposed during the update to the new LLVM snapshot.
`source.request.conformingmethods` is a new SourceKit request which
receives a source position and a list of protocol namses, returns a list
of methods whose return type conforms to the requested protocols.
rdar://problem/44699573