Alex Hoppen
949968a182
Adjust printing to take into account special DeclNames
...
Print DeclBaseNames using a new userFacingStr() method to prepare for
DeclBaseNames that are not backed by Identifiers
2017-06-24 11:39:09 +02:00
Xi Ge
1ea4d9ff98
CursorInfo: Teach SemaLocResolver to recognize the start of an expression, if the location cannot be further refined to other kind, e.g. a reference. rdar://32749670
2017-06-19 13:28:36 -07:00
Robert Widmann
abd5aa8e6d
Rename some X-Value-related entities
...
* Rename coerceToMaterializableValue to coerceToRValue
* Rename isLValueType to hasLValueType to better match the
intended semantics of the member.
2017-06-14 13:18:45 -07: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
04eb001c9d
RangeInfo: Avoid analyzing orphan kind if the given node list is empty; tentatively fixing rdar://32533734.
2017-06-09 15:44:08 -07:00
Alex Hoppen
73c524ca5e
[IDE] Preparations for removal of getName on ValueDecl
...
With the introduction of special decl names, `Identifier getName()` on
`ValueDecl` will be removed and pushed down to nominal declarations
whose name is guaranteed not to be special. Prepare for this by calling
to `DeclBaseName getBaseName()` instead where appropriate.
2017-05-28 19:13:24 -07:00
Xi Ge
d6b4c3e77b
RangeInfo: unbox switch statement to ensure all branches agree on return information. rdar://32289109 ( #9788 )
2017-05-19 14:36:56 -07:00
Xi Ge
83183abc38
RangeInfo: Add a new range info kind that describes part of a parent expression. rdar://32039874 ( #9707 )
2017-05-17 14:21:47 -07:00
Xi Ge
9c6e3bd398
RangeInfo: Use CharSourceRange to represent the selected range, NFC. rdar://32225277 ( #9660 )
2017-05-16 15:45:30 -07:00
Xi Ge
058d7f62e8
[migrator] Various quality improvement on type-hoist API migrations. rdar://32186526 ( #9600 )
2017-05-14 19:25:01 -07:00
Xi Ge
65b9043eb1
migrator: handle function hoist API changes and several its varieties. rdar://31234806 ( #9544 )
2017-05-12 21:34:06 -07:00
Xi Ge
166d388de0
RangeInfo: stuff a bit about whether the selected range exits. ( #9389 )
2017-05-08 13:28:32 -07:00
Xi Ge
38991ca83f
RangeInfo: unbox ifstmt to get the agreed-upon return type from selected statements. rdar://31691723 ( #9380 )
2017-05-07 19:08:47 -07:00
Xi Ge
a14953809a
[SourceKit] When cursor points to an external argument name in a function-like decl, we should return the information about the function-like decl instead of being empty. rdar://32018814 ( #9356 )
2017-05-05 17:12:34 -07:00
practicalswift
492f5cd35a
[gardening] Remove redundant repetition of type names (DRY): RepeatedTypeName foo = dyn_cast<RepeatedTypeName>(bar)
...
Replace `NameOfType foo = dyn_cast<NameOfType>(bar)` with DRY version `auto foo = dyn_cast<NameOfType>(bar)`.
The DRY auto version is by far the dominant form already used in the repo, so this PR merely brings the exceptional cases (redundant repetition form) in line with the dominant form (auto form).
See the [C++ Core Guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es11-use-auto-to-avoid-redundant-repetition-of-type-names ) for a general discussion on why to use `auto` to avoid redundant repetition of type names.
2017-05-05 09:45:53 +02:00
Xi Ge
57fa43c9af
[RangeInfo] Avoid analyzing implicit ASTNodes. rdar://31773556 ( #9210 )
2017-05-02 21:19:46 -07:00
Argyrios Kyrtzidis
40c89048ba
[index] Make sure that we index implicit constructors
...
These can be explicitely referenced so we should index their definitions as well
2017-04-29 19:14:03 -07:00
practicalswift
ab5aaeb359
Merge pull request #9001 from practicalswift/gardening-20170425
...
[gardening] Unused variables. Unused diagnostics. Namespace comments. Typos.
2017-04-26 09:28:24 +02:00
Xi Ge
7163a40ffb
[Migrator] Support framework API function renames. rdar://31766131 ( #9013 )
2017-04-25 15:50:40 -07:00
practicalswift
861f70e13d
[gardening] Use consistent spacing
2017-04-25 21:03:43 +02:00
Xi Ge
cbd62cb721
IDE: Expose a utility to collect argument label ranges from either tuple or paren exprs. ( #8982 )
2017-04-24 17:26:32 -07:00
practicalswift
7eb7d5b109
[gardening] Fix 100 typos.
2017-04-18 17:01:42 +02:00
practicalswift
40cf4d183d
[gardening] Use consistent spacing after if, for and while
2017-04-14 17:35:36 +02:00
practicalswift
5e255e07d7
[gardening] Remove redundant logic
2017-04-11 23:04:55 +02: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
034170a348
RangeInfo: simplify some code by using STL extra. NFC
2017-03-15 20:46:06 -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
Xi Ge
f76ed374a7
RangeInfo: Treat comments transparently when resolving a given range. rdar://30926193 ( #8052 )
2017-03-13 14:47:02 -07:00
practicalswift
0c137fa458
[gardening] Remove unused variables
2017-02-22 09:31:19 +01:00
Xi Ge
c62ec0c116
SourceKit: Introduce a new enum class to describe the kind of resolved sema token kind. NFC ( #7657 )
2017-02-20 23:18:54 -08:00
Xi Ge
3afb5572c0
[RangeInfo] Add a field in ResolvedRangeInfo to indicate whether the range throws uncatched errors. rdar://30586209 ( #7574 )
2017-02-17 17:49:00 -08:00
Xi Ge
6b699d8855
SourceEntityWalker: keep track of type reference in extension declarations' openings. ( #7192 )
...
This is necessary when we want to differentiate between type reference
on extension declaration's start, e.g "extension A {}", and other
references of "A". NFC on existing functionality.
2017-02-01 17:09:01 -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
practicalswift
30a88d38e6
[gardening] Fix recently introduced typos
2017-01-06 21:16:02 +01:00
practicalswift
6d1ae2a39c
[gardening] 2016 → 2017
2017-01-06 16:41:22 +01: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
14f968a5ed
SourceEntityWalker: Add a parameter to visitDeclReference() describing the kind of the reference under visit. NFC
2016-12-20 14:30:02 -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
practicalswift
5bc293cc09
[gardening] Add missing licensing headers.
2016-11-28 21:40:06 +01:00
Xi Ge
5e8d8da380
[Test] Add range-info test driver to swift-ide-test. NFC
2016-11-15 13:48:15 -08:00
Xi Ge
0e7b13a96e
[SourceKit] Lessen assertion in the range resolver walker to allow early stop. rdar://29159963
2016-11-08 11:22:24 -08:00