Commit Graph

30 Commits

Author SHA1 Message Date
Nathan Hawes
77f3cb013f [Index] Fix pseudo accessor USRs generation to distinguish instance vs static accessors
It was hard-coding IsStatic to false rather than passing it through from the
VarDecl, giving the same USR for the two getters in the below:

class FixtureClass95 {
    private static var someVar: String!
    private var someVar: String!
}

Resolves rdar://problem/44531531
2019-11-21 15:11:47 -08:00
Argyrios Kyrtzidis
f752844ccd [index] Make sure to walk the accessor bodies of local properties (#19102)
[index] Make sure to walk the accessor bodies of local properties

Otherwise we'll miss global symbols references.
rdar://42301005
2018-09-01 08:27:27 -07:00
Doug Gregor
363ef63409 [Code completion] Split out tests that require Objective-C interop.
A bunch of tests that technically require Objective-C interop were
not labeled as such, and worked in the absence of Objective-C interop
due to bugs in the type checker.
2018-07-18 21:17:12 -07:00
Mark Lacey
8ee52763f0 Remove the '++' and '--' operators.
We still had unavailable versions of these for floating-point types
only. We shouldn't need to keep these around, and can instead just
emit a helpful diagnostic for anyone that attempts to use them.

Unfortunately I don't see any way for the diagnostic to produce an
actual fix-it, so it just suggests '+= 1' or '-= 1' without actually
producing a fix.
2018-07-12 15:46:57 -07:00
Davide Italiano
b4a19cc6ac [Mangler] Fix mangling for associated types. 2018-03-27 11:06:15 -07:00
Pavel Yaskevich
170ccbd36d [Mangling/ABI] NFC: Fix Frontend/APINotes/Index tests to reflect label mangling changes 2017-12-18 15:45:50 -08:00
Alex Hoppen
1c7e289b96 [Mangling] Adjust subscript mangling to not include "subscript"
Change the mangling of accessors to have a variable or subscript node
as their only child node, while subscript nodes no longer contain a decl
name.
2017-09-10 19:44:07 +02:00
Nathan Hawes
6c128c2788 [index] Add missing parameter and return type references in subscript declarations
Resolves rdar://problem/32314185.
2017-06-22 23:29:51 -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
swift-ci
84f533a4b7 Merge pull request #8862 from akyrtzi/index-mark-methods-dynamic 2017-04-19 12:27:14 -07:00
Argyrios Kyrtzidis
e152d4ac1f [index] Mark indexed methods as 'dynamic' when appropriate
'dynamic' for indexing purposes means the method is overridable.
2017-04-19 11:48:52 -07:00
Ben Langmuir
85240ffa80 [index] Bring back unnamed parameter indexing
This was disabled in 5c80f1edaf but should be working. This allows the
indexer to see the full set of parameters even when some are unnamed.
2017-04-18 12:49:55 -07:00
Jordan Rose
2d84981fc2 Improve the mangling of typealiases.
- Allow them to use substitutions.
- Consistently use 'a' as a mangling operator.
- For generic typealiases, include the alias as context for any generic
  parameters.

Typealiases don't show up in symbol names, which always refer to
canonical types, but they are mangled for debug info and for USRs
(unique identifiers used by SourceKit), so it's good to get this
right.
2017-04-17 11:31:15 -07:00
Jordan Rose
5c80f1edaf [IDE] Don't produce USRs for nameless parameters.
...and /do/ produce them for 'self' parameters in destructors when
they /are/ named. I suspect this was the cause of the original
problem.
2017-04-14 17:02:55 -07:00
Erik Eckstein
c4a11f4c92 tests: remove the now unused option -new-mangling-for-tests 2017-03-22 11:28:43 -07:00
Nathan Hawes
7b75cf792c [indexer] Index parameter definitions with a distinct external argument label too (but not their refs)
Parameter defs with a separate external argument label are marked with the 'Local' symbol property.
This ensures the indexer has enough information for clients to match up a function's argument labels with its child parameter definitions.
Resolves rdar://problem/31039915.
2017-03-14 16:12:48 -07:00
Argyrios Kyrtzidis
89c17cd9a0 [index] Also mark unit test classes and their extensions with SymbolProperty::UnitTest 2017-03-06 13:01:50 -08:00
Argyrios Kyrtzidis
2b9e102b75 [index] Move determination of SymbolProperty::UnitTest at index::getSymbolInfoForDecl()
Otherwise symbol info for relations of such methods does not contain this property.
2017-03-06 12:42:23 -08:00
Argyrios Kyrtzidis
154765293d [swift-ide-test/test] Print out symbol-info for index symbol relations
This is to make sure we get the right symbol-info when forming a symbol relation
2017-03-06 11:29:12 -08:00
Erik Eckstein
a04a29af4f mangling: efficient mangling of repeated substitutions
Instead of appending a character for each substitution, we now prefix the substitution with the repeat count, e.g.
AbbbbB -> A5B

The same is done for known-type substitutions, e.g.
SiSiSi -> S3i

This significantly shrinks mangled names which contain large lists of the same type, like
  func foo(_ x: (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int))

rdar://problem/30707433
2017-03-05 17:41:43 -08:00
Argyrios Kyrtzidis
c5456e38ed [index] Handle properly typealiases as inherited types
Report the typalias as reference and its underlying nominal type as an 'implicit' base relation.
2017-03-04 19:23:02 -08:00
Nathan Hawes
583f74017b [indexer] Add RelationContainedBy from references to their containing functions
Resolves rdar://problem/30765261
2017-02-28 16:55:18 -08:00
Nathan Hawes
2684564590 [indexer] report defs/refs of parameters without a separate external name 2017-02-28 11:55:34 -08:00
Argyrios Kyrtzidis
a13289835e [index] For extensions, relate the symbol reference that gets extended and base references with the extension symbol.
They were getting related with the original extended symbol, which was incorrect.
2017-02-19 18:19:39 -08:00
Argyrios Kyrtzidis
560bb99c02 [index] Provide distinct USRs for extension symbols
For indexing purposes we need to be able to treat extensions as distinct symbols.
rdar://30512293
2017-02-14 11:15:45 -08:00
Erik Eckstein
1d3724666f tests: convert about 400 tests to the new mangling by using the -new-mangling-for-tests option
When the new mangling is enabled permanently, the option can be removed from the RUN command lines again.
2017-01-24 15:27:45 -08:00
Argyrios Kyrtzidis
cfa1749836 [index] Report @IB and @GKInspectable properties in the index info. 2017-01-24 08:58:51 -08:00
Argyrios Kyrtzidis
703382701e [index] Mark unit test methods if the class subclasses XCTestCase.
This takes advantage of semantic checking during indexing so that it is more accurate.
2017-01-24 02:30:29 -08:00
Argyrios Kyrtzidis
db8ec19f55 [index] Use the index symbol types and APIs from the clang header.
This avoids duplication and centralizes handling of symbols.
2017-01-10 14:49:07 -08:00
Nathan Hawes
8c45e20d3f [indexer] Add relations to IndexSymbol add a -print-indexed-symbols option to swift-ide-test for testing 2017-01-05 15:01:53 -08:00