Commit Graph

256 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis
4b1d99fcc3 [index] Relate extension members with the extension symbol. 2017-02-19 20:10:33 -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
Argyrios Kyrtzidis
459a5c604d [index] Make sure hasUsefulRoleInSystemModule() checks if 'any' of the listed SymbolRoles is present. 2017-02-06 08:48:02 -08:00
practicalswift
e2f8af7762 [gardening] Fix clang-tidy warnings 2017-02-04 09:23:10 +01:00
practicalswift
0193f2b872 [gardening] Fix typos 2017-02-04 09:22:38 +01: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
Argyrios Kyrtzidis
9dc03b4442 [index] Avoid using getSatisfiedProtocolRequirements() when indexing the stdlib.
This is quite expensive and not worth the cost for indexing purposes of system modules.
2017-01-31 21:13:40 -08:00
Argyrios Kyrtzidis
a3919f5352 [index] Add testing for indexing a system overlay module, along with fine-grained control on the relations we want to index. 2017-01-31 11:14:21 -08:00
Nathan Hawes
e0ffbfb91b [indexer] Rename initCallRefIndexSymbol -> initFuncRefIndexSymbol as its now more general 2017-01-26 10:51:16 -08:00
Nathan Hawes
8ccccc6f74 [indexer] Fix crash in initVarRefIndexSymbols by handling func/var references in ImportDecls
IndexSwiftASTWalker::initVarRefIndexSymbols wasn't handling getCurrentExpr() returning a nullptr
as it does when processing a reference to someVar in the below import:
import var SomeModule.someVar

This patch fixes rdar://problem/30118572 and adds tests for import var/func references.
2017-01-26 09:15:42 -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
Bob Wilson
c765d5e3a5 Merge remote-tracking branch 'origin/master' into master-next 2017-01-12 15:58:19 -08:00
Argyrios Kyrtzidis
4c7e04becd Merge pull request #6745 from akyrtzi/index-switch-to-general-accessor-kinds
[index] Switch to using the general accessor getter/setter symbol kinds.
2017-01-11 18:25:04 -08:00
Argyrios Kyrtzidis
7076ebbf72 [index] Switch to using the general accessor getter/setter symbol kinds. 2017-01-11 17:09:17 -08:00
Nathan Hawes
92f6d81455 [indexer] Fix incorrect RelationCalledBy for pseudo accessors 2017-01-11 16:07:09 -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
Bob Wilson
cf3a0458f2 Merge remote-tracking branch 'origin/master' into master-next 2017-01-10 09:05:23 -08:00
Nathan Hawes
563bc04da1 Merge pull request #6677 from nathawes/swift-indexing
Add roles and relations for Swift indexing
2017-01-09 14:48:35 -08:00
Bob Wilson
37e7d1c627 Merge remote-tracking branch 'origin/master' into master-next 2017-01-08 17:07:46 -08:00
Brian Gesiak
663b92ece9 [AST] Completely replace Module with ModuleDecl
The typedef `swift::Module` was a temporary solution that allowed
`swift::Module` to be renamed to `swift::ModuleDecl` without requiring
every single callsite to be modified.

Modify all the callsites, and get rid of the typedef.
2017-01-08 00:36:08 -05:00
Nathan Hawes
4bc7435bb1 [indexer] provide names for pseudo accessors too 2017-01-06 14:26:12 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01: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
Nathan Hawes
7f582c420d [indexer] When visiting a NominalTypeDecl, cover the type references in the where clause and generic param inheritance too.
Also rename ASTWalker::shouldWalkIntoFunctionGenericParams() to shouldWalkIntoGenericParams() since it's now used when walking NominalTypeDecl (not just AbstractFunctionDecl).
2017-01-05 14:54:59 -08:00
Bob Wilson
78b28243ff Merge remote-tracking branch 'origin/master' into master-next 2017-01-03 14:22:59 -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
practicalswift
38be6125e5 [gardening] C++ gardening: Terminate namespaces, fix argument names, ...
Changes:
* Terminate all namespaces with the correct closing comment.
* Make sure argument names in comments match the corresponding parameter name.
* Remove redundant get() calls on smart pointers.
* Prefer using "override" or "final" instead of "virtual". Remove "virtual" where appropriate.
2016-12-17 00:32:42 +01:00
Bob Wilson
deddf19aae Merge remote-tracking branch 'origin/master' into master-next 2016-12-13 10:23:03 -08:00
Slava Pestov
e59cdc8610 AST: Remove TypeBase::getDirectlyReferencedTypeDecl() 2016-12-04 21:15:02 -08:00
Bob Wilson
13da3fa8b1 Merge remote-tracking branch 'origin/master' into master-next 2016-12-04 18:16:09 -08:00
Hugh Bellamy
3a57546370 Fix warnings building swift/Index on Windows using MSVC 2016-12-02 12:18:09 +00:00
Slava Pestov
f6e692198c AST: Remove FuncDecl::getResultType() 2016-11-29 03:05:23 -07:00
Graydon Hoare
7c1dc18b64 Revert "Give all declarations an explicit interface type" 2016-11-24 09:55:27 -08:00
Slava Pestov
5b8524a9d1 AST: Remove FuncDecl::getResultType() 2016-11-24 02:35:35 -05:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Bob Wilson
f10ae47b9f Merge remote-tracking branch 'origin/master' into master-next 2016-11-15 17:32:28 -08:00
Ben Langmuir
780b857a7f [index] Fix assertion failure when indexing func import
We were implicitly assuming that a function reference could only happen
in an expression, ignoring the case of
        import func Module.fooFunc

For now, this doesn't actually add the reference to the index because
initCallRefIndexSymbol doesn't allow references without a parent
expression.  We can look at adding the reference, or maybe doing
something special to the import itself separately.

rdar://problem/26496135
2016-11-15 10:56:22 -08:00
Xi Ge
d58d097004 [SourceKit] While indexing, give accessors distinguishable names. rdar://28395479 (#5502) 2016-10-28 12:18:18 -07:00
Bob Wilson
5c4f517824 Checkpoint fixes for llvm r284966 (TimeValue) 2016-10-28 12:09:57 -07:00
Brian Croom
29af9f889a Fix ObjC-interop logic in the isTestCandidate indexing method
A compile-time conditional had previously been introduced to prevent
`private` test methods from being considered test candidates. This
conditional was not working as intended, however, because the header
providing the required preprocessor flag was not being included.

Several number of issues with the non-Objc-interop test case have also
been fixed.
2016-06-20 10:40:09 -04:00
Ben Langmuir
5525319d5c [index] Add finish() hook to the index consumer API
Since the memory underlying returned USRs is guaranteed to last until
the indexing action completes, add a finish() hook so that clients can
trigger an action at the end of indexing but before the memory goes
away.
2016-06-09 09:43:41 -07:00
Brian Gesiak
22fb093525 [SR-710][Index] isTestCandidate access for Linux
The goal for https://bugs.swift.org/browse/SR-710 is to automatically
generate a list of tests to run for XCTest on Linux. The prevailing
approach is to generate this list using SourceKit, which is to be
ported to Linux.

SourceKit uses libIndex's concept of `isTestCandidate` to determine
what constitutes a test. `isTestCandidate` is tested via
`test/SourceKit/Indexing/index.swift`.

On Linux, however, the list of tests to be run will be generated by
some tool and placed in a file that is separate from the source file
that defines the test method. Therefore, the test method must not be
"private", since it needs to be accessed from a separate file.

This commit adds two test files: one that verifies the behavior on
Linux, and one that verifies the behavior on platforms with Objective-C
interop. It also (1) simplifies the `isTestCandidate` function, and (2)
adds the interop-specific logic.

This commit does not remove the existing `isTestCandidate` tests in
`test/SourceKit/Indexing/index.swift`; that is left for a future commit.
2016-05-13 18:30:34 -04:00
Argyrios Kyrtzidis
281b9cafc6 [IDE/index] We only need to get the group name for declarations, not references. 2016-05-08 16:31:38 -07:00
Argyrios Kyrtzidis
ec042460fe [SourceKit] Report attributes of decls for the indexing request. 2016-05-05 16:44:34 -07:00
Ben Langmuir
ad34f89d5b [index] Add UnitTest SymbolSubKind and collapse the IndexSymbol inheritance
Fold UnitTest into the subkind, now that it's a bitself, and then remove
the unnecessary inheritance for IndexSymbol and its SourceKit indexing
equivalent.
2016-04-29 19:04:27 -07:00
Ben Langmuir
6096b8b93c [index] Make IndexSymbol's subkind into a bitset
This follows a similar change to clang indexing, and will allow us to
add overlapping sub kinds such as "UnitTest", etc.
2016-04-29 19:04:26 -07:00
Ben Langmuir
ef4e84b8d6 [index] Subsume CallRefIndexSymbol into IndexSymbol
Eventually we should just have one IndexSymbol, with all the
information. Once we kill FuncDeclIndexSymbol and can get rid of the
enum,  we will regain most of the bytes we lost by inlining receiverUSR.
2016-04-29 19:04:26 -07:00
Ben Langmuir
50eeeb7430 [index] Add 'call' and 'isDynamic' roles 2016-04-29 19:04:25 -07:00