Commit Graph

41 Commits

Author SHA1 Message Date
Max Moiseev
1fae0d1325 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-08 12:48:48 -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
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
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
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
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
71384c7322 Removing unnecessary test command 2016-02-29 12:13:56 -08:00
Max Moiseev
a49dab6bf8 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-29 12:08:52 -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
Chris Lattner
f43b76bcc2 Rearrange test to avoid having a hard coded filepath in the response. 2016-02-26 11:30:47 -08:00
Chris Lattner
dfaaebc0a0 Merge pull request #1333 from dduan/SE-0031
[SE-0031] Adjusting 'inout' Declarations for Type Decoration
2016-02-26 10:41:58 -08:00
Daniel Duan
780b58a9a5 [Parser] update tests for 'inout' syntax adjustment 2016-02-26 01:33:22 -08:00
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
Dmitri Gribenko
dd75aed67a Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-17 14:40:05 -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
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
Max Moiseev
61c837209b Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-04 16:13:39 -08:00
Argyrios Kyrtzidis
5b2531848d [sourcekit/test] Remove absolute paths for the test output of SourceKit/DocSupport/doc_clang_module.swift. 2016-01-22 15:08:28 -08:00
Argyrios Kyrtzidis
7a982d6b8e [sourcekit] When printing requests/responses make sure to escape the strings.
This makes it more clear what the response string contains, plus you can copy the
printed request directly for passing to sourcekitd_request_create_from_yaml.
2016-01-22 13:29:32 -08:00
Doug Gregor
7d70b704e4 Merge commit '5e11e3f7287427d386636a169c4065c0373931a8' into swift-3-api-guidelines 2016-01-19 23:18:20 -08:00
Doug Gregor
38c1de69e4 Reinstate "[SR-511][Parse] Add 'associatedtype' keyword and fixit"
This reverts commit ce7b2bcf09, tweaking
a few validation tests appropriately (1 crasher fixed, two -verify
tests that needed updating).
2016-01-14 00:21:48 -08:00
Erik Eckstein
ce7b2bcf09 Revert "[SR-511][Parse] Add 'associatedtype' keyword and fixit"
This reverts commit 2b2e9dc80e.

It broke some compiler crasher tests
2016-01-13 20:42:58 -08:00
gregomni
2b2e9dc80e [SR-511][Parse] Add 'associatedtype' keyword and fixit
Adds an associatedtype keyword to the parser tokens, and accepts either
typealias or associatedtype to create an AssociatedTypeDecl, warning
that the former is deprecated. The ASTPrinter now emits associatedtype
for AssociatedTypeDecls.

Separated AssociatedType from TypeAlias as two different kinds of
CodeCompletionDeclKinds. This part probably doesn’t turn out to be
absolutely necessary currently, but it is nice cleanup from formerly
specifically glomming the two together.

And then many, many changes to tests. The actual new tests for the fixits
is at the end of Generics/associated_types.swift.
2016-01-13 17:54:31 -08:00
Max Moiseev
08e1e4a043 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-01-11 16:51:11 -08:00
Xi Ge
d53c91c087 [SourceKit][DocInfo] Being consistent of the printed source and the reported annotation when the decl under request is an extension to a name alias type. rdar://22098995 2016-01-07 12:13:40 -08:00
Max Moiseev
a7339e67ac Merge remote-tracking branch 'origin' into swift-3-api-guidelines 2015-12-22 11:36:07 -08:00
Chris Lattner
d4c60aa7a7 Update another test to work with += instead of ++ 2015-12-21 22:10:25 -08:00
Doug Gregor
2f5f94a12c Merge remote-tracking branch 'origin/swift-3-api-guidelines' into swift-3-omit-needless-words 2015-12-15 17:11:37 -08:00
Doug Gregor
06c5e9cd5b Enable "omit needless words" by default.
Most of this is in updating the standard library, SDK overlays, and
piles of test cases to use the new names. No surprises here, although
this shows us some potential heuristic tweaks.

There is one substantive compiler change that needs to be factored out
involving synthesizing calls to copyWithZone()/copy(zone:). Aside from
that, there are four failing tests:

    Swift :: ClangModules/objc_parse.swift
    Swift :: Interpreter/SDK/Foundation_test.swift
    Swift :: Interpreter/SDK/archiving_generic_swift_class.swift
    Swift :: Interpreter/SDK/objc_currying.swift

due to two independent remaining compiler bugs:
  * We're not getting partial ordering between NSCoder's
  encode(AnyObject, forKey: String) and NSKeyedArchiver's version of
  that method, and
  * Dynamic lookup (into AnyObject) doesn't know how to find the new
  names. We need the Swift name lookup tables enabled to address this.
2015-12-11 14:46:50 -08:00
Max Moiseev
7c4a693c3c fixing OptionSetType related tests 2015-12-10 16:59:18 -08:00
Max Moiseev
2d2d8ff1ea fixing tests after massive renaming 2015-12-09 17:11:29 -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