Commit Graph

21 Commits

Author SHA1 Message Date
Anthony Latsis
8c1f391878 Gardening: Migrate test suite to GH issues: IDE 2022-08-31 03:00:06 +03:00
Alex Hoppen
16baf61601 [RangeInfo] Acknowledge that SemaAnnotator walks the tree in source order *excluding* attributes
`SemaAnnotator` walks the tree in source order with respect to the source ranges *excluding* attributes, but `RangeResolver` considers attributes part of their declaration. Thus they disagree on what “walking in source order means”. `SemaAnnotator` will visit the attributes *before* the decl they are on, while `RangeResolver` as currently implemented expects them *as part of* the decl they are on.

Thus, for the purpose of `RangeResolver`, we need to assume that nodes are visited in arbitrary order and we might encounter enclosing nodes after their children.

Thus, when we find a new node, remove all nodes that it encloses from `ContainedASTNodes`.

Fixes rdar://64140713 [SR-12958]
2021-03-31 13:32:02 +02:00
Rintaro Ishizaki
1fa04208e0 [IDE] Fix visiting DeferStmt
* Call balanced walkToStmtPost() for DeferStmt.
* In walkToStmtPre(), return DeferStmt itself instead of the body.

rdar://problem/39948168
2018-05-08 16:32:52 +09:00
Xi Ge
673d04f240 Range-info: when checking if a decl reference is contained in the selected range, consider only the start location. rdar://32415952 (#10207) 2017-06-12 13:52:28 -07:00
Xi Ge
57fa43c9af [RangeInfo] Avoid analyzing implicit ASTNodes. rdar://31773556 (#9210) 2017-05-02 21:19:46 -07:00
Xi Ge
1827fb1436 RangeInfo: Report RValue type if a decl reference is of read-only LValue type. (#8300) 2017-03-23 15:52:54 -07:00
Xi Ge
8e0aaa6886 RangeInfo: fix a crash when a var decl doesn't have a patternbindingdecl as parent. (#8255) 2017-03-21 16:41:34 -07:00
Xi Ge
4df0d03e2b RangeInfo: Unbox brace statement to figure out the type it returns. (#8154) 2017-03-16 11:38:39 -07:00
Xi Ge
1ef97c0024 RangeInfo: Rework the criterion for valid selection of multiple statements, i.e. they should have a common brace statement as parent. (#8129) 2017-03-15 18:23:24 -07:00
Xi Ge
ed56e493f1 RangeInfo: disallow expressions with non-void type at the start or the end of multi-statement selections. (#8092) 2017-03-14 16:59:28 -07:00
Jordan Rose
845017cc81 Improve how DeclContext chains are printed in AST dumps. (#7786) 2017-02-28 10:37:21 -08:00
Xi Ge
602235ed52 [RangeInfo] Report the case when a continue/break statement is in the given range however the containing target is not. (#7157) 2017-01-31 11:37:24 -08:00
Xi Ge
e7a16bf246 [RangeInfo] Include a boolean value in the resolved range info to indicate whether the given range has more than one entry point. (#7150)
A classic multi-entry range is several case statements.
2017-01-30 13:42:34 -08:00
Xi Ge
46eb3971f5 [RangeInfo] Some enrichment on reported range info. (#6475)
* [RangeInfo] Perform complete walk on the last node in a given range to avoid missing information due to early abort.

* [RangeInfo] For declared decls in a given range, report whether they are referenced outside of the range.

* [RangeInfo] Report the contained (topmost) ASTNodes inside a selected range.
2017-01-03 16:33:39 -08:00
Xi Ge
94851e25d7 [RangeInfo] Report the innermost decl context for the range under selection. (#6448) 2016-12-21 16:50:39 -08:00
Xi Ge
2312ccecac [RangeInfo] When reporting referenced decls in a given range, exclude those references accessed as members. 2016-12-20 17:11:22 -08:00
Xi Ge
dbefa60605 [RangeInfo] Report the type the selected code should be evaluated to. 2016-12-20 11:37:39 -08:00
Xi Ge
ba930deff2 [RangeInfo] When reporting referenced decls, also report the types of these references. 2016-12-19 17:16:17 -08:00
Xi Ge
87a4b8a07e [RangeInfo] When reporting referenced decls in a given range, exclude those whose decl context is out of the current file. 2016-12-19 16:01:44 -08:00
Xi Ge
eb80cdd8ce [RangeInfo] Report declared and referenced decls in a given range. 2016-12-19 13:27:20 -08:00
Xi Ge
5e8d8da380 [Test] Add range-info test driver to swift-ide-test. NFC 2016-11-15 13:48:15 -08:00