Consolidate ThrowsKeyword, RethrowsKeyword, and AsyncKeyword to
EffectsSpecifierKeyword.
Abolish 'key.throwsoffset' and 'key.throwslength' as they aren't used.
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
These tests relied on timing between completion runs in order to check
that fast completion was working properly for completions in VFS files.
That is, they would assume that two runs happening one after another
without a sleep inbetween would always run fast completion.
However, that's not necessarily the case and there have been cases where
a dependency check happens despite its interval being fairly long
(multi-second).
This change emulates the same behaviour by changing the interval
between 0/100, which should prevent any timing issues.
Resolves rdar://72144331
A previous change updated the checkdep tests to move the sleep before
copying over files. This fixed cases where the modification time would
be the same second as the dependency check. Unfortunately this
introduced a slightly different form of flakiness - if the sleep went
too long, the completion that was meant to re-use the AST would see that
it's time to check dependencies and thus skip the fast completion path.
One fix for that would be to add a smaller sleep before, a longer sleep
after, and increase the dependency check time. That increases the
runtime of the tests even further though, so instead just update the
timestamps manually to be in the past/future in order to invoke the path
we want to test. This also allows a 0 dependency check time (ie. always
check), which makes the tests even faster.
Resolves rdar://71861446
Also, continue trying opening files even if any of primary files are
missing so that the caller can know all files failed to open.
rdar://problem/33757793
We checked for an import of a module named 'Foundation' before
checking if Objective-C interoperability was enabled, which
would lead to hilarious results.
Fixes <https://bugs.swift.org/browse/SR-13713> / <rdar://problem/70140319>.
This test was intended to catch a crash on invalid offset, but in rare
cases it was failing spuriously, because the error message depends on
non-deterministic behaviour. It's sufficient for this test that it
doesn't crash.
rdar://63187529
Adds a new frontend option
"-experimental-allow-module-with-compiler-errors". If any compilation
errors occur while generating the .swiftmodule, this mode will skip SIL
entirely and only serialize the (likey invalid) AST.
This existence of this option during generation is serialized into the
resulting .swiftmodule. Errors found in deserialization are only allowed
if it is set.
Primarily intended for IDE requests (eg. indexing and code completion)
to ensure robust cross-module results, despite possible errors.
Resolves rdar://69815975
"Function builders" are being renamed to "result builders". Add the
corresponding `@resultBuilder` attribute, with `@_functionBuilder` as
an alias for it, Update test cases to use @resultBuilder.
This was happening in the error recovery path when parsing accessors
on a pattern binding declaration that does not bind any variables, eg
let _: Int { 0 }
Calculate and set the type relation in each result building logic which
knows the actual result type.
CodeCompletionResultBuilder couldn't know the actual result type. From
the declaration alone, it cannot know the correct result type because it
doesn't know how the declaration is used (e.g. calling? referencing by
compound name? curried?)
This flag is a GNU extension, and would cause misleading test failures
on other platforms where this extension is not available. However, the
necessity to switch line endings is only required on Windows when
testing. We could use sed to canonicalize line endings before comparing,
but that may cause higher amounts of filesystem traffic on Windows which
would slow down testing.
Instead, move the substitution for diff in SourceKit's lit.local.cfg up
to the top level, and conditionalize the substitution which has the flag
on Windows, but not on other platforms (where it should not be required).
The tests were matching the previous implementation's output, which sometimes produced 'unknown' and sometimes 'unrelated' in cases where there was no expected type from the context.
This was not needed. The list of depenencies should not be changed
during fast-completion sessions.
This was also harmful because it calls stat(2) for all the dependency
files.
rdar://problem/67773257
When the multi-line string is unterminated, the indentation of a line
will be the same as the first previous line that had contents, unless
that line is the line containing the start quotes. In that case the
indentation will be:
- the same as the start quote indentation, if the quotes are the only
contents on the line, or
- an extra indentation level to the start quote line otherwise
Lines within a terminated multi-line string or lines with content will
only ever be indented if their current indentation is invalid (ie. their
indentation level is less than that of their end quotes).
This rule is to prevent any signficant (and possibly unintended)
whitespace being added to existing strings during a whole file/range
format - Xcode does not remove whitespace from whitespace-only lines by
default. This could be improved if the reformat was sent the actual
range rather than a line at a time. Different indentation could then be
chosen if the range was in fact a single line.
Resolves rdar://32181422
'SM.getCodeCompletionBufferID()' returns the buffer ID of the previous
code completion. 'CI.getCodeCompletionFile()->getBufferID()' always
returns the original source buffer ID of the current file in the main
module. The latter is needed for excluding buffer ID for dependency checking.
rdar://problem/66301353
The Base class already includes them, so don't duplicate them in its
subclasses. Also stops us including members from extensions of the base class
itself.
Resolves rdar://problem/50960433
`PreCheckFunctionBuilderRequest` applies `PreCheckExpression` to the
expressions inside the function body. Previously it used to receive only
`AnyFunctionRef` (`FunctionDecl` or `ClosureExpr`) as the parameter.
However, when fast-completion kicks-in, it replaces the body of the
function, then tries to call `PreCheckFunctionBuilderRequest` again, with
the same function decl as before. It used to return cached "Success"
result, but it didn't actually apply `PreCheckExpression`. So any
`UnresolvedDeclRefExpr` remained unresolved.
In this patch, make `PreCheckFunctionBuilderRequest` receive "body" of the
function as well, so it doesn't return the cached result for the *previous*
body.
rdar://problem/65692922