Commit Graph

9 Commits

Author SHA1 Message Date
Ben Barham
cb81c1a1aa [SourceKit] Add structure node for SubscriptExpr
Arguments in `SubscriptExpr` are visited since the recent `ArgumentList`
refactoring, but were being added to the containing `CallExpr`. Add a
node for the `SubscriptExpr` itself so that its argument is added there
instead of the `CallExpr`.

Also remove `key.nameoffset` and `key.namelength` from the response when
both are 0 to match the rest of the offsets and lengths.

Resolves rdar://85412164.
2021-11-30 19:56:48 +10:00
fwcd
8d35ed0fe9 Update diags in SourceKit tests to include key.id
- Update SourceKit/DocumentStructure tests
- Update SourceKit/CursorInfo tests
- Update SourceKit/SyntaxMapData tests
- Update SourceKit/Sema tests
- Update SourceKit/CompileNotifications tests
2021-05-07 19:32:04 +02:00
Argyrios Kyrtzidis
b3b3cd3f81 [SourceKit] Avoid calling AbstractStorageDecl::isSettable during syntactic operations
`isSettable` can trigger typechecking and cause crashes during pure syntactic requests.

rdar://60441208
2020-03-17 18:30:33 -07:00
Nathan Hawes
11d20b8c92 [IDE] Avoid name binding in sourcekitd's syntactic requests
It looks like we recently started binding extensions to their nominals in order
to continue to compute access levels via ValueDecl::getFormalAccess() after an
assertion was added to enforce that bindExtensions had been called before
anything tried to call ExtensionDecl::getBoundNominal() - which
getFormalAccess() depends on. Sourcekitd's syntactic requests are made on every
keypress in the editor though, so we shouldn't do any name binding (which may
require module loading) to keep them as fast as possible.

This patch restores the old inferAccessLevel() functions we used prior to the
switch to ValueDecl::getFormalAccess() (plus a few fixes) that does as much as
it can syntactically, without any name binding, and simply doesn't report the
access level in cases where it couldn't be computed without name-binding.

This also fixes an assertion hit we were getting trying to bind extensions in
inactive ifconfig clauses, which ASTScope doesn't support.

Resolves rdar://problem/57202584
2019-11-16 13:41:20 -08:00
Slava Pestov
c51f884879 SourceKit: Just always call getFormalAccess() 2018-09-05 16:51:20 -07:00
Marcelo Fabri
b6ecf9c6d4 [SourceKit] Introduce "source.lang.swift.expr.closure" in structure (SR-6116) (#13617) 2018-01-04 10:45:29 -08:00
Argyrios Kyrtzidis
8e9c172f81 [sourcekitd] Fix crash in the document structure request when a class name starts with a number
rdar://33817431
2017-08-22 12:22:50 -07:00
Jacob Bandes-Storch
c98e515734 [QoI] Improvements to function call & closure diagnostics (#7224) 2017-02-07 17:36:11 -08:00
Argyrios Kyrtzidis
8ff6a98a99 [sourcekit] Merge SourceKit into the Swift repo.
The code goes into its own sub-tree under 'tools' but tests go under 'test',
so that running 'check-swift' will also run all the SourceKit tests.

SourceKit is disabled on non-darwin platforms.
2015-11-05 01:09:08 -08:00