Commit Graph

1541 Commits

Author SHA1 Message Date
swift-ci
2cd2bec970 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-02-21 14:55:39 -08:00
John Fairhurst
677491fc9b [SourceKit] Add syntaxtype for #error/#warning (#14742) 2018-02-21 14:48:18 -08:00
swift-ci
b45ac7f2c8 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-02-13 16:37:59 -08:00
swift-ci
964a38e619 Merge remote-tracking branch 'origin/master' into master-next 2018-02-13 16:29:32 -08:00
Xi Ge
37f352fe41 sourcekitd: build Swift syntax tree more lazily than collecting parsed tokens. (#14578)
Before this patch, we have one flag (KeepSyntaxInfo) to turn on two syntax
functionalities of parser: (1) collecting parsed tokens for coloring and
(2) building syntax trees. Since sourcekitd is the only consumer of either of these
functionalities, sourcekitd by default always enables such flag.
However, empirical results show (2) is both heavier and less-frequently
needed than (1). Therefore, separating the flag to two flags makes more
sense, where CollectParsedToken controls (1) and BuildSyntaxTree
controls (2).

CollectingParsedToken is always enabled by sourcekitd because
formatting and syntax-coloring need it; however BuildSyntaxTree should
be explicitly switched on by sourcekitd clients.

resolves: rdar://problem/37483076
2018-02-13 16:27:12 -08:00
swift-ci
58ba0b5d6f Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-02-13 12:38:05 -08:00
swift-ci
9f828c0652 Merge remote-tracking branch 'origin/master' into master-next 2018-02-13 12:29:49 -08:00
Huon Wilson
56cf07752d Merge pull request #14554 from huonw/doc-conditional-conformances
[IDE] Teach type checker about conditional conformance extensions.
2018-02-14 07:21:11 +11:00
Huon Wilson
cb60dbeee2 [IDE] Teach type checker about conditional conformance extensions.
Before conditional conformances, the archetypes in conformance
extensions (i.e. extension Foo: SomeProtocol) were equivalent to those
in the type decl, with the same protocol bounds and so on. The code for
printing "synthesized" members relied on this fact. This commit teaches
that code to deal with archetypes in the conditional conformance
extension when required.

Fixes rdar://problem/36553066 and SR-6930.
2018-02-13 17:37:15 +11:00
swift-ci
b8f31c1c40 Merge remote-tracking branch 'origin/master' into master-next 2018-02-06 10:29:36 -08:00
swift-ci
92b6a1f625 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-02-06 10:19:08 -08:00
Ben Langmuir
72bde687e4 [sourcekit] Use the driver to parse command line arguments
Stop parsing frontend arguments directly and use the driver instead. The
most intersting part of this change is that it forces us to consider
whether our compiler invocation will have inputs or not.  We have
several kinds of requests that need to create a compiler instance, but
not parse any inputs (interface-generation, doc-info, and indexing when
operating on a module instead of source files).

Incidentally, add an error when trying to do doc-info on multiple source
files. This was already very broken (assertion failures and bogus source
locations), so add an error for it.

rdar://problem/17897287
2018-02-05 15:49:17 -08:00
Ben Langmuir
9f3df20dbd [sourcekit] Change fallback module name to match driver
This will reduce test churn when we start using the driver to parse
arguments.  We don't really care what the module name is for these
fallback cases.
2018-02-02 10:26:58 -08:00
swift-ci
c8625a1df1 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-02-01 16:58:10 -08:00
swift-ci
33cd6c8829 Merge remote-tracking branch 'origin/master' into master-next 2018-02-01 16:49:08 -08:00
David Ungar
354a76ac4e Merge pull request #14198 from davidungar/PR-18-3c-exp2
[Batch mode] Move frontend main output files to FrontendInputsAndOutputs. (1)
2018-02-01 16:42:10 -08:00
swift-ci
35a2b40d53 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-31 02:38:12 -08:00
swift-ci
84f604002a Merge remote-tracking branch 'origin/master' into master-next 2018-01-31 02:29:14 -08:00
Rintaro Ishizaki
fced748790 [Syntax] Represent missing optioanl nodes as nullptr (#14300)
Allocating RawSyntax/SyntaxData for missing optional node is a waste of
resource.
2018-01-31 19:24:00 +09:00
David Ungar
a9819b6e60 Renaming FrontendInputs -> FrontendInputsAndOutputs
Fix comment in ArtsToFrontendOptionsConverter re getOutputFilenamesFromCommandLineOrFilelist
2018-01-30 18:54:38 -08:00
swift-ci
94e6c88fe0 Merge remote-tracking branch 'origin/master' into master-next 2018-01-30 13:49:38 -08:00
swift-ci
8848cd7540 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-30 13:38:06 -08:00
Xi Ge
98570550c3 [SourceKit] Report synthesized protocol conformances for DocSupport request. rdar://36882292 (#14248) 2018-01-30 13:32:50 -08:00
swift-ci
f5e81f6fa7 Merge remote-tracking branch 'origin/master' into master-next 2018-01-25 18:46:31 -08:00
swift-ci
8d00b9ff17 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-25 18:38:49 -08:00
Nathan Hawes
7ed4586f01 Merge pull request #14145 from nathawes/rdar35819975-cursor-info-crasher
[CursorInfo] Fix crash on init call of inner NTD with generic outer NTD
2018-01-25 18:35:35 -08:00
Nathan Hawes
cbf07dae19 [CursorInfo] Fix crash on init call of inner NTD with generic outer NTD
Resolves rdar://problem/35819975
2018-01-25 13:24:51 -08:00
swift-ci
3a521bfe2a Merge remote-tracking branch 'origin/master' into master-next 2018-01-23 20:29:47 -08:00
swift-ci
158eaeaa5e Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-23 20:18:53 -08:00
David Ungar
bf439cd2c6 Merge pull request #14090 from davidungar/PR-18-3b
[BatchMode] Rename FrontendInputs::AllFiles to AllInputs, etc
2018-01-23 20:14:46 -08:00
David Ungar
ec2a9573cc Rename FrontendInputs::AllFiles to AllInputs, getAllFiles to getAllInputs, etc. 2018-01-23 14:01:15 -08:00
swift-ci
fc2e2ee06e Merge remote-tracking branch 'origin/master' into master-next 2018-01-17 23:53:17 -08:00
swift-ci
85cef29e2b Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-17 23:24:08 -08:00
Xi Ge
4c172037e8 [libSyntax][SourceKit] Integrating libSyntax representation of a source file with several SourceKitd syntax requests (#14000)
The enhanced SourceKitd requests are EditorOpen and EdtiorReplaceText. In these two requests, the clients can specify a flag "key. enablesyntaxtree = 1" to get a serialize libSyntax tree with the response.

To help this integration, we added a function in SyntaxParsingContext to explicitly finalize the creation of a SourceFileSyntax to incorporate the fact that SourceKit needs the tree before its destroying the parser instance.

To test this integration, we diff the syntax tree serialized from the frontend action and the tree serialized from a SourceKitd response. They should be identical.
2018-01-17 21:13:22 -08:00
Davide Italiano
118962b034 [SourceKit] Catch up with upstream changes in llvm. 2018-01-16 11:25:06 -08:00
swift-ci
21343fd342 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-12 14:18:57 -08:00
swift-ci
957b3897d7 Merge remote-tracking branch 'origin/master' into master-next 2018-01-12 14:09:52 -08:00
John McCall
7f0f8830cd Split AccessorDecl out from FuncDecl. NFC.
This has three principal advantages:

- It gives some additional type-safety when working
  with known accessors.

- It makes it significantly easier to test whether a declaration
  is an accessor and encourages the use of a common idiom.

- It saves a small amount of memory in both FuncDecl and its
  serialized form.
2018-01-12 14:20:27 -05:00
swift-ci
14b5f2ad7b Merge remote-tracking branch 'origin/master' into master-next 2018-01-09 17:44:29 -08:00
swift-ci
bbc812c77f Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-09 17:35:51 -08:00
Marcelo Fabri
94465a38c0 [SourceKit] Add GenericTypeParam to structure (SR-5474) (#13616) 2018-01-09 17:28:52 -08:00
swift-ci
cc373f9c30 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-08 12:27:47 -08:00
swift-ci
fd9d91baa8 Merge remote-tracking branch 'origin/master' into master-next 2018-01-04 10:49:47 -08:00
Marcelo Fabri
b6ecf9c6d4 [SourceKit] Introduce "source.lang.swift.expr.closure" in structure (SR-6116) (#13617) 2018-01-04 10:45:29 -08:00
Bob Wilson
e614f1b4d4 master-next: attempt to fix Linux bots
After my PR 13591 to adjust for LLVM r321257, the Linux bots are failing with
errors about missing conversions. For some reason that I don't understand,
those errors do not reproduce when I build locally on macOS. I think this
change should fix them. I also cleaned up some const_casts that should now
be unnecessary when using WritableMemoryBuffer.
2017-12-21 20:14:17 -08:00
Bob Wilson
a214a4df9d master-next: use WritableMemoryBuffer::getNewUninitMemBuffer
llvm r321257 removed MemoryBuffer::getNewUninitMemBuffer. Change to use
WritableMemoryBuffer::getNewUninitMemBuffer instead.
2017-12-21 17:21:05 -08:00
Saleem Abdulrasool
62c9784d8e Merge pull request #13509 from compnerd/sourcekit++14
SourceKit: use explicit struct constructor for C++14
2017-12-18 17:53:54 -08:00
Ben Langmuir
36d7acd1fa [code-complete] Set call-arg-heuristics flag in SourceKit
In the new code-completion path, expose an option to control this
behaviour; in the old path turn it off.

rdar://31113161
2017-12-18 13:20:24 -08:00
Saleem Abdulrasool
aaeac4cb34 SourceKit: use explicit struct constructor for C++14
Explicitly instantiate the `CursorInfoData` instances when using it with
the default constructor rather than using the inline initializer list.
This is needed to build with C++14 mode.  Provide a default value for
the `Optional` type in the structure which prevents a non-copy default
constructor from being synthesized.  NFC.
2017-12-18 12:44:19 -08:00
Ben Langmuir
b6d5a1f1a5 [code-complete] Do not insert rparen after a call pattern completion
When completing
  Foo(<here>
We will now provide
  bar: <#value#>
instead of
  bar: <#value#>)

Inserting the rparen caused some problems in practice:
* the old behaviour optimized for typing Foo(<complete> instead of
  Foo(<complete>), which can conflict with user behaviours or ...
* in editors with automatic brace-matching, we often conflicted with the
  editor, leading to extraneous closing parens

And in general, it is much more predictable for tooling to either insert
matching ( and ) or to not insert either.  While this change may not be
ideal For users of editors that do not do automatic brace-matching, I
believe it is still better overall to have to type a missing paren than
to have to delete an extraneous one.

rdar://31113161
2017-12-18 11:59:49 -08:00