Max Moiseev
02006f20bc
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
2016-03-09 16:05:03 -08:00
Chris Lattner
ae919bd447
implement mangling support for typealias archetypes, allowing them to get basic USRs.
2016-03-08 21:18:39 -08:00
Xi Ge
ce12c6dc95
ModulePrinting: Add an option to synthesize unconditional extensions; true by default.
2016-03-08 18:34:38 -08:00
Ben Langmuir
bac7521af7
[SourceKit] Fix crash with cursor info on generic typealias
...
For now, just skip mangling the name since we know the decl context will
crash the mangler.
2016-03-08 18:03:42 -08:00
Max Moiseev
1fae0d1325
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
2016-03-08 12:48:48 -08:00
Ben Langmuir
393550ee58
[SourceKit] Add a couple of missing tests for cursor info
2016-03-07 13:22:42 -08:00
Ben Langmuir
e752de0d20
[SourceKit] Print and annotate the raw value expression of enum elements
...
For now, only do this in SourceKit (printQuickHelpDeclaration), but
there are probably other printing modes that should do this.
rdar://problem/24292226
2016-03-07 12:36:47 -08:00
Max Moiseev
7fe6916bf6
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
2016-03-07 12:10:47 -08:00
Ben Langmuir
bd2f100868
[SourceKit] Add keyword tags to a couple of places I missed in TypeRepr printing
2016-03-07 10:37:03 -08:00
Ben Langmuir
d08bf6829e
[SourceKit] Add some tuple tests missed in previous commit NFC
2016-03-07 10:24:16 -08:00
Ben Langmuir
3d424b5e96
[SourceKit] Annotate tuple types and nested function types
...
Move the type callbacks into the respective type/typerepr printers so
taht we get these callbacks even when we print the type directly, or in
a nested fashion. Also make the returntype more explicit than just
"inside a function type", since visiting the function type currently
visits the input argument tuple (which is different than e.g. the
function *decl* printing, which walks the parameter list explicitly).
rdar://problem/24292226
2016-03-07 10:13:01 -08:00
Ben Langmuir
1ea2d46a04
[SourceKit] Add builtin attribute tags
...
As promised, tag the whole attribute include all of its 'parameters'.
rdar://problem/24292226
2016-03-03 21:20:14 -08:00
Ben Langmuir
9e3fc1ce74
Remove dead FIXME in cursor info test
2016-03-03 18:40:23 -08:00
Ben Langmuir
ba702b846f
[SourceKit] Add tags for attribute names
...
As a first foray into annotating attribute, add tags around attribute
names. For now, treat any decl-modifiers as keywords. We will also want
to wrap the whole attribute (including any parameters) into tags as
well, but that will require more work in the callback hanlding.
Also factor the attribute printing to handle any special cases early,
which will simplify wrapping attributes in tags, since we can then just
put the whole switch intside the pre/post callbacks.
rdar://problem/24292226
2016-03-03 18:39:21 -08:00
Ben Langmuir
65f0e7eb94
[SourceKit] Add annotation tags for generic type requirements
...
Each requirement gets tagged. We could also tag the whole where clause
if we need to, but so far it hasn't been interesting.
rdar://problem/24292226
2016-03-03 16:11:07 -08:00
Ben Langmuir
ceb1069199
Prefer original spelling of 'static' vs. 'class'
...
Try to match the original spelling of static/class in diagnostics and
when printing the AST. Also fixes cases with
PrintOptions.PrintImplicitAttrs = false, where we would just print
'class', which was not valid code.
2016-03-03 13:48:30 -08:00
Ben Langmuir
c934315315
[SourceKit] Update terminology in generic parameter tag names
...
And add a test that does cursor info on the generic parameter itself,
not just on the parent decl context.
rdar://problem/24292226
2016-03-03 13:34:16 -08:00
Max Moiseev
cf4bafe9e3
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
2016-03-03 13:22:03 -08:00
Ben Langmuir
1182e41e01
[SourceKit] Add tags for generic parameters to annotated decl
...
Like typerefs, we want to show the USR in the tag.
rdar://problem/24292226
2016-03-03 12:47:09 -08:00
Ben Langmuir
d88d5052aa
[SourceKit] Use keyword name context to add syntaxtype.keyword tags
...
We can now markup most keyword uses. Still missing access control
keywords.
rdar://problem/24292226
2016-03-02 18:20:59 -08:00
Xi Ge
65a3aade7e
[SourceKit] Cursor info: for extension decls, the cursor info query always returns the extended nominal's group name.
2016-03-02 17:30:11 -08:00
Xi Ge
8f1c239d01
[SourceKit] Cursor info: remove type interface since no clients are using it. rdar://24920331
2016-03-02 12:28:02 -08:00
Ben Langmuir
8955cdc644
[SourceKit] Add decl.var.type tags in property declarations
...
These Type::print can just reuse the printTypeLoc logic even if they
don't have a TypeRepr.
rdar://problem/24292226
2016-03-01 16:49:33 -08:00
Ben Langmuir
b4469d88dc
[SourceKit] Replace decl.name with syntaxtype.keyword as appropriate
...
We aren't ready to start marking up all keywords yet, but start by
replacing the cases where we currently have decl.name.
rdar://problem/24292226
2016-03-01 15:35:26 -08:00
Ben Langmuir
10c8250352
[SourceKit] Rename local/external to name/argument_label in annotation
...
rdar://problem/24292226
2016-03-01 15:16:40 -08:00
Max Moiseev
a49dab6bf8
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
2016-02-29 12:08:52 -08:00
Xi Ge
f195adba80
Module group: suggested by @gribozavr, move ExistentialCollection.swift to collection/type-erased group.
2016-02-27 21:14:38 -08:00
Ben Langmuir
dbd32f31b9
[SourceKit] Add cursor/doc info for enum elements
...
Similarly to pattern binding decls, we want to be able to explode a case
decl out into a synthesized enum case for each individual enum element.
2016-02-26 16:28:13 -08:00
Dmitri Gribenko
a257715fcc
Revert "[stdlib] [SE-0031] update stdlib for SE-0031 (inout adjustment)"
2016-02-26 11:17:10 -08:00
Daniel Duan
13b5c8f3bc
[SE-0031] update code base for SE-0031 (inout adjustment)
2016-02-26 10:52:10 -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
Xi Ge
48754aabfa
Module groups: Respect IDE's conventions, use '/' as sub-group indicators.
2016-02-25 18:03:39 -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
Xi Ge
95fe01d874
Module groups: Array is a sub-group of collection.
2016-02-25 12:35:27 -08:00
Max Moiseev
488b464f10
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
2016-02-25 12:21:56 -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
Xi Ge
a1d885c348
Module groups: if group name collector is enabled, we continuously serialize doc-comment table for comment-free decls to preserve the group information.
2016-02-24 21:05:26 -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
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
3d3d4540e1
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
2016-02-20 14:37:49 -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