Commit Graph

173 Commits

Author SHA1 Message Date
Ben Langmuir
1a83912c4e [SourceKit] Add fully annotated declaration to DocInfo requests
Also expose the printing function as a SwiftLangSupport static method.
Ideally we could move this into libIDE, but it currently depends on the
UIdent visitor to get decl-specific tag names and it's not obvious how
we should hoist/abstract that out in a nice way.

rdar://problem/24292226
rdar://problem/24292304
2016-02-25 20:12:13 -08:00
Ben Langmuir
e9211c8e4f [SourceKit] Fix cursor-info crash with mismatched pre/post callbacks
The problem was that shouldPrint returned true, but shouldPrintInContext
returned false, so we called printDeclPost without ever printing
anything and therefore never calling the pending printDeclPre. Also
remove the avoidPrintDeclPost in the annotation printer, since it was
incorrectly assuming that avoidPrintDeclPost was paired with
printDeclPre (it's not clear to me that it isn't sometimes paired
though...).

Future work: remove or properly document the difference between the two
shouldPrint* variants; and ensure that callbacks will always be paired
even if we don't end up printing anything. Also verify that
avoidPrintDeclPost behaves correctly with respect to printDeclPre being
called (or not).
2016-02-25 19:40:26 -08:00
Ben Langmuir
dd29bace34 [SourceKit] Tag subscript element types like function return types
FIXME.count -= 1

rdar://problem/24292226
2016-02-25 13:05:06 -08:00
Ben Langmuir
36cc043481 [SourceKit] Be consistent about using the decl.var.parameter.name.local tag
FIXME.count -= 3

rdar://problem/24292226
2016-02-25 10:27:53 -08:00
Ben Langmuir
86bc29cfc6 [SourceKit] Add type tags for parameters and return types
When the type is not just a reference to a nominal type, we still need
to be able to delineate it.

rdar://problem/24292226
2016-02-25 09:07:16 -08:00
Ben Langmuir
0216eecf92 [SourceKit] Factor out getTagForPrintNameContext NFC
rdar://problem/24292226
2016-02-24 15:35:07 -08:00
Ben Langmuir
93f05fc101 [SourceKit] Update doc comment for FullyAnnotatedDeclarationPrinter
We annotate more structure now, so put it in the example.

rdar://problem/24292226
2016-02-24 15:26:46 -08:00
Ben Langmuir
d3e98f52ef [SourceKit] Add parameter.name.local and parameter.name.external tags
... for the fully annotated declarations. More substructure more better.
This has to go through a callback mechanism similar to printDeclLoc and
printDeclPre since it should be scheduled after both of those are
printed.

rdar://problem/24292226
2016-02-24 15:26:46 -08:00
Xi Ge
dfd0a86986 [SourceKit] Teach SourceKit to recognized USRs for synthesized extensions.
So that IDE can jump to the synthesized extensions instead of the actual extensions.
2016-02-16 17:22:58 -08:00
Ben Langmuir
e327378b24 [SourceKit] Add annotation tags for decl names
This splits the printDeclNamEndLoc callback into NameEndLoc and
NameOrSignatureEndLoc variants to differentiate whether or not
signatures are included.  All existing clients move to
NameOrSignatureEndLoc to maintain the current behaviour. I'm still not
completely happy with how these are named, but I dont' have any better
ideas right now.

rdar://problem/24292226
2016-02-12 15:57:28 -08:00
Ben Langmuir
29ce0fec1b [SourceKit] Stub in a new "fully_annotated_decl" field to cursor info
This will eventually replace the existing annoteded_decl for cursor
info, and be added to doc info as well.  For now put in under a
different field name to not break existing clients.

For now, just reimplement the existing annotations but put in tag names
that are specific to the kind of type/decl. The goal is to fill in a
lot more substructure/detail over time.

Incidentally flesh out some cursor info tests.

rdar://problem/24292226
2016-02-12 12:56:11 -08:00
Daniel Duan
efe230774b [AST] rename some isXXX methods to getAsXXX
There's a group of methods in `DeclContext` with names that start with *is*,
such as `isClassOrClassExtensionContext()`. These names suggests a boolean
return value, while the methods actually return a type declaration. This
patch replaces the *is* prefix with *getAs* to better reflect their interface.
2016-02-11 16:23:40 -08:00
Xi Ge
a25551e54d [SourceKit] Surface group names via cursor info query. 2016-02-05 16:56:41 -08:00
Xi Ge
77b7180f1a Rename CodeCompletionTypeChecking.h to IDETypeChecking.h since it's used by more clients now. NFC 2016-02-04 11:09:21 -08:00
Xi Ge
8ade928d84 Simplify some code found by Slava, NFC. 2016-02-04 11:09:21 -08:00
Xi Ge
6837c17c17 [SourceKit][CursorInfo] Replace archetypes in cursor info results to actual types. rdar://24494225 2016-02-03 17:14:13 -08:00
practicalswift
dfcece7960 Use consistent style for comment separators. 2016-01-04 01:41:33 +01:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
practicalswift
149b50d901 Fix typos in code (non-comment/documentation typos). 2015-12-28 11:42:15 +01:00
practicalswift
22e10737e2 Fix typos 2015-12-26 01:19:40 +01:00
Xi Ge
9beeb56a90 [TypeInterface] When printing type-specific interfaces, replace parameter and return types with instantiated types. 2015-11-17 19:12:30 -08:00
Argyrios Kyrtzidis
d19e4ae026 [SourceKit] Add license notices to all the source files. 2015-11-05 12:01:14 -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