Commit Graph

174 Commits

Author SHA1 Message Date
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
Max Moiseev
bb3eaaf308 Merging in latest master 2016-02-24 15:10:25 -08:00
Ben Langmuir
3e9bfa137d [SourceKit] Add decl.var.parameters entries to the fully annotated decl
This is the first part of adding parameter substructure so that clients
can reason about more of the function declaration.

rdar://problem/24292226
2016-02-24 11:39:47 -08:00
Ben Langmuir
184efb5e1c [SourceKit] Differentiate decl.var.local from decl.var.parameter
For decls it can be interesting to know when a decl is a parameter vs. a
local. This will be needed for the new fully annotated decls. For refs
it's usually not interesting.

rdar://problem/24292226
2016-02-24 11:37:00 -08:00
Max Moiseev
0b759a409c Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-23 14:26:14 -08:00
Xi Ge
b812efa4cc Module groups: Make 'lazy views' a sub-group of the 'collection' group. 2016-02-23 13:57:48 -08:00
Jordan Rose
0ab43e125b Merge pull request #1282 from dduan/SR771_stmt_in_type_body_2
[Parser][SR-711] Couple "expected declaration" Diagnose With A Note
2016-02-22 13:39:55 -08:00
Max Moiseev
fcad164e18 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-22 12:59:57 -08:00
Xi Ge
845304a90d Module group: Address @natecook1000 and @dabrahams's comments. 2016-02-22 11:50:34 -08:00
Dmitri Gribenko
f27315b6f8 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-20 15:36:04 -08:00
Dmitri Gribenko
3d3d4540e1 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-20 14:37:49 -08:00
Xi Ge
0fc0f6dd23 Module groups: partially address @gribozavr and @natecook1000's comments. 2016-02-20 13:10:06 -08:00
Argyrios Kyrtzidis
10dfe5ab5a [SourceKit] Fix issue where the offset of diagnostic fixits is not updated after an edit request.
rdar://23919223
2016-02-19 19:18:44 -08:00
Xi Ge
450391f28f [Serialization] Use the new group mechanism and update tests accordingly. 2016-02-19 17:21:28 -08:00
Daniel Duan
e0cc095063 [Parser] updated tests for "expected declaration" companion note 2016-02-19 11:05:03 -08:00
Dmitri Gribenko
f39b443e24 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-19 01:16:19 -08:00
Dmitri Gribenko
0f36bec31f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-18 16:41:35 -08:00
Ben Langmuir
9418b32b2a [SourceKit] Don't forget to check for nullptr
After 7400d484 we tried to walk into enum elements, but forgot to check
for missing types (which caused an assertion in getType) or element
decls (which caused an assertion or crash inside passReference).

rdar://problem/24634223
2016-02-18 14:08:44 -08:00
Xi Ge
c5408c8beb [SourceKit] Indentation: indent the first element in a collection expression according to the position of the left bracket, if they are not in the same line.
We treat this as a mutated version of sibling-based indentation, where an extra level is needed. rdar://24630624
2016-02-18 13:28:44 -08:00
Xi Ge
4e85583718 add test 2016-02-18 13:28:44 -08:00
Dmitri Gribenko
dd75aed67a Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-17 14:40:05 -08:00
Argyrios Kyrtzidis
bc21bbe806 [SourceKit] Add a 'mangle simple classes' request, intended to supersede _swift_mangleSimpleClass.
rdar://23525281
2016-02-16 18:32: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
Argyrios Kyrtzidis
6cbcb7b56f [SourceKit] Introduce a new request for demangling symbol names.
This is SourceKit support for the swift_demangle_getDemangledName/swift_demangle_getSimplifiedDemangledName APIs.
rdar://23525281
2016-02-16 12:16:56 -08:00
Argyrios Kyrtzidis
99f691c2cd [test] Add a SourceKit test about the protocol version request. 2016-02-16 10:03:41 -08:00
Dmitri Gribenko
efaa39ea79 stdlib: add first argument labels and some other changes to conform to API guidelines 2016-02-15 23:47:54 -08:00
Max Moiseev
3a3984877a Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-15 15:43:34 -08:00
Ben Langmuir
63667ce852 [SourceKit] Move generic parameters out of struct/class/enum decl.name
And add tests for this and for function generic parameters.

rdar://problem/24292226
2016-02-15 10:40:00 -08:00
Argyrios Kyrtzidis
95ee932e0c [SourceKit] For sourcekitd_variant_json_description_copy, make sure to not escape the unicode characters in a string.
Otherwise it will be invalid json.
rdar://24617070
2016-02-15 10:37:56 -08:00
Ben Langmuir
f3ca9dc992 [SourceKit] Move bang/question-mark out of annotated name for init
rdar://problem/24292226
2016-02-15 10:07:49 -08:00
Ben Langmuir
bb90b38ae8 [ASTPrinter] Remove extra space after deinit
We already know to print one before printing the body brace (if we're
printing function bodies), and it certainly doesn't belong in the
*name* portion of the decl.

Also add a cursor info test with a deinit.
2016-02-12 16:40:53 -08:00
Ben Langmuir
efafb7e98a [ASTPrinter] Remove space between subscript and parameter list
To match the style of TSPL, documentation, the stdlib, etc. Found by
inspection.
2016-02-12 16:23:41 -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
abbbb66073 Remove some unnecessary reliance on stdlib details in code-completion test
We won't try to avoid the stdlib completely, but at least try not to
check method names on types that might change in the future.

For rdar://problem/24621131
2016-02-12 15:00:48 -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
Xi Ge
d5cdbaaee6 [Test] Lessen some tests to make stdlib easier to update. 2016-02-12 11:32:00 -08:00
Nate Cook
c36fad553b Fix tests with updated documentation. 2016-02-12 11:48:28 -06:00
Xi Ge
c97f115219 [ModulePrinter] When printing decls in a module group, we print them according to their source order.
Source order preserves semantic information better than printing alphabetically.
2016-02-10 17:46:49 -08:00
Max Moiseev
55fde4c923 making tests pass 2016-02-10 16:08:40 -08:00
Xi Ge
ad33048af9 [test] Add a test for indenting class var. 2016-02-10 10:18:58 -08:00
Xi Ge
8b6c6af573 [SourceKit] Teach module interface generator to respect the given module group name.
Input:
  Request Id: 'source.request.editor.open.interface'
  Required Field: 'key.modulename'
  Optional Field: 'key.groupname'

Output:
  If the group name is specified, SourceKit generates interface for the
  module group; otherwise does for the entire module.
2016-02-09 11:49:16 -08:00
Xi Ge
329345077b [SourceKit] Add a new query to collect all group names from a module.
Input:
  Request Id: 'source.request.module.groups'
  Required field: 'key.modulename'

Output:
  Array of group names in that module, if any.
2016-02-08 17:22:10 -08:00
Xi Ge
a25551e54d [SourceKit] Surface group names via cursor info query. 2016-02-05 16:56:41 -08:00
Ted Kremenek
2b55fc8cbb Merge pull request #1209 from johnno1962/master
Fixes missing Xcode "Quick Help" for enum values as switch case patterns
2016-02-05 16:06:30 -08:00
John Holdsworth
7400d48426 Fixes missing Xcode "Quick Help" for enum values as switch case patterns 2016-02-05 11:07:27 +00:00
Max Moiseev
61c837209b Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-04 16:13:39 -08:00
Chris Lattner
8dedfb31e3 Add support for #file/#line, etc according to SE-0028. __FILE__ and friends
are still accepted without deprecation warning as of this patch.
2016-02-04 14:22:22 -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
Ben Langmuir
5da0906089 [CodeCompletion] Add optional top-N results that precede literals
Experiment with having some locals or nominal members come first, but
only a few so that the literals are still predictably near the top.

Part of rdar://problem/23865118
2016-02-03 16:31:26 -08:00
Ben Langmuir
a927dc8a5a [CodeCompletion] Hide literals that don't match the type context in SourceKit
If there is a type context, hide literal suggesetions that don't match
it, unless they are keywords and we have filtered to their names.

Incidentally fix an output buffering issue when combining filtering with
the -raw flag in complete-test.

Part of rdar://problem/23865118
2016-02-03 10:51:07 -08:00