Commit Graph

3174 Commits

Author SHA1 Message Date
Xi Ge
f7edb4cbee cmake: build swift-swiftsyntax-test only when SwiftSyntax is built. (#18558)
Resolves: rdar://43024275
2018-08-08 12:12:55 -07:00
Slava Pestov
b67752a15f Minor NFC cleanups 2018-08-08 10:18:49 -07:00
Xi Ge
d1e02604fa SwiftSyntax: make Swift test utilities build on linux. (#18496) 2018-08-07 15:40:01 -07:00
Jordan Rose
061204c704 Remove "IFK_" prefix from enum class InputFileKind
I suspect this was converted from a non-scoped enum in the past.
No functionality change.
2018-08-07 08:54:31 -07:00
Jordan Rose
fc9ea1e329 Add Lexer::IsHashbangAllowed, drop SourceManager::getHashbangBufferID (#18534)
Having this be a single buffer hardcoded in the SourceManager and set
by all clients is silly. SourceFiles with the 'Main' kind are allowed
to have hashbang lines (`#!`), other files are not. And anyone
manually setting up a Lexer can decide for themselves.

No intended behavioral change.
2018-08-07 08:25:05 -07:00
Huon Wilson
7753383223 [AST] Add @_hasInitialValue to var/lets that have initializers.
The information about whether a variable/property is initialized is lost in the
public interface, but is, unfortunately, required because it results in a symbol
for the initializer (if a class/struct `init` is inlined, it will call
initializers for properties that it doesn't initialize itself). This is
important to preserve for TBD file generation.

Using an attribute rather than just a bit on the VarDecl means this fits into
the scheme for module interfaces: textual/valid Swift.
2018-08-07 09:54:35 +10:00
Mishal Shah
772d07e6f8 Merge pull request #18504 from shahmishal/master-next
Merge master-next into master branch to support stable-next
2018-08-06 13:07:08 -07:00
Xi Ge
7542f991c1 Re-apply "SourceKit: make SwiftLang build in linux. (#18455)" (#18506) 2018-08-06 11:37:09 -07:00
swift-ci
71f0248b0a Merge remote-tracking branch 'origin/master' into master-next 2018-08-06 11:07:55 -07:00
Doug Gregor
199bf6eabf Merge pull request #18425 from DougGregor/extended-nominal
[Name lookup] Introduce a request for "extended nominal type decl"
2018-08-06 08:23:36 -07:00
swift-ci
67e4f3d49d Merge remote-tracking branch 'origin/master' into master-next 2018-08-03 11:29:48 -07:00
eeckstein
76965d7dee Merge pull request #18495 from nkcsgexi/revert-sourcekit-linx
Revert "SourceKit: make SwiftLang build in linux. (#18455)"
2018-08-03 11:27:20 -07:00
Doug Gregor
bd5f5d80e4 [AST] Add ExtensionDecl::getExtendedNominal().
Introduce ExtensionDecl::getExtendedNominal() to provide the nominal
type declaration that the extension declaration extends. Move most
of the existing callers of the callers to getExtendedType() over to
getExtendedNominal(), because they don’t need the full type information.

ExtensionDecl::getExtendedNominal() is itself not very interesting yet,
because it depends on getExtendedType().
2018-08-03 11:26:48 -07:00
Xi Ge
960d7642cf Revert "SourceKit: make SwiftLang build in linux. (#18455)"
We revert it for failures in

https://ci.swift.org/job/oss-swift_tools-RA_stdlib-RD_test-simulator/1237/consoleFull#-20795171483122a513-f36a-4c87-8ed7-cbc36a1ec144
2018-08-03 11:24:51 -07:00
swift-ci
9743eceeda Merge remote-tracking branch 'origin/master' into master-next 2018-08-03 11:09:49 -07:00
Alex Hoppen
285b337cf5 Merge pull request #18424 from ahoppen/incremental-classification
[swiftSyntax] Incremental syntax classification
2018-08-03 11:09:28 -07:00
swift-ci
e35eb8a5a4 Merge remote-tracking branch 'origin/master' into master-next 2018-08-02 19:09:51 -07:00
Xi Ge
084286eb5a SourceKit: make SwiftLang build in linux. (#18455) 2018-08-02 18:49:01 -07:00
swift-ci
08a913e7ac Merge remote-tracking branch 'origin/master' into master-next 2018-08-02 17:29:47 -07:00
Alex Hoppen
b75dd68180 [SourceKit] Pass reused node IDs by reference 2018-08-02 14:33:55 -07:00
Alex Hoppen
729e0e23fc [libSyntax] Add logging for how long syntax tree serialization took 2018-08-02 14:32:12 -07:00
Alex Hoppen
85f1c5e7a1 [incrParse] Fix issue because of which the syntax tree always got serialized completely 2018-08-02 14:31:35 -07:00
Alex Hoppen
082a9878d1 [SourceKit] Reserve 4KB for the syntax tree buffer
Heuristics have shown that this prevents several new mallocs and speeds
incremental syntax tree transfer up.
2018-08-02 14:30:58 -07:00
Alex Hoppen
15b1559e06 [SourceKit] Move syntax tree serialization to separate function
This will allow us to experiment with other serialization formats in the
future more easily.
2018-08-02 14:30:58 -07:00
swift-ci
39d8d2a79a Merge remote-tracking branch 'origin/master' into master-next 2018-08-02 13:49:46 -07:00
Xi Ge
3121af26e1 swift-api-digester: keep track of all decl attribute kinds in module dump. (#18473)
The tool should use decl attribute kinds from AST rather than defining
its own list of attributes. Thus we can keep track of all attributes kinds
rather than the selected ones.
2018-08-02 13:39:32 -07:00
swift-ci
ade797f277 Merge remote-tracking branch 'origin/master' into master-next 2018-08-02 10:10:04 -07:00
Alex Hoppen
99b1ce7ab7 Merge pull request #18416 from ahoppen/editorconsumer-return-values
[SourceKit] Change return value of functions in EditorConsumer to void
2018-08-02 09:53:44 -07:00
Alex Hoppen
38c62cf766 Merge pull request #18426 from ahoppen/sourcekit-raw-data
[sourcekitd] Add support for transferring raw data
2018-08-02 09:52:41 -07:00
swift-ci
efe71ee472 Merge remote-tracking branch 'origin/master' into master-next 2018-08-02 09:09:54 -07:00
Alex Hoppen
ac41a53730 Merge pull request #18421 from ahoppen/absolute-position-refactor
[SwiftSyntax] Refactor AbsolutePosition
2018-08-02 09:07:32 -07:00
swift-ci
b60e24a162 Merge remote-tracking branch 'origin/master' into master-next 2018-08-01 18:29:04 -07:00
Rintaro Ishizaki
335e913bed Merge pull request #18439 from rintaro/sourcekit-editoffset-rdar34206143
[SourceKit] Defensive guard for invalid offset and length in edit request
2018-08-02 10:19:33 +09:00
Rintaro Ishizaki
399fece7f5 [SourceKit] Dedicated error message for 'offset' + 'length' out of range 2018-08-02 09:29:28 +09:00
Alex Hoppen
9bbe441160 [SourceKit] Change return value of functions in EditorConsumer to void
We were always returning true from those functions in  SKEditorConsumer
and false in the test consumers. On the client side we would then ignore
the return value. So it's clearer to have the functions not return
anything.
2018-08-01 15:17:13 -07:00
Alex Hoppen
d920a664be [sourcekitd] Add support for transferring raw data
We will need this to transfer a binary encoded syntax tree in the future
2018-08-01 14:34:30 -07:00
swift-ci
89b25738be Merge remote-tracking branch 'origin/master' into master-next 2018-08-01 12:29:14 -07:00
Alex Hoppen
56bf9a3469 [SwiftSyntax] Refactor AbsolutePosition
AbsolutePosition being a mutable reference type easily leads to bugs
where an AbsolutePosition is modified. Making it immutable eliminates
this issue. Furthermore, the introduction of SourceLength should allow
easier manipulation of AbsolutePositions on the client side.

We still cannot make AbsolutePosition a value type since it is used
inside AtomicCache, but the immutability gives the same safety.
2018-08-01 11:55:35 -07:00
Alex Hoppen
a38d7c525e [SourceKit] Fix compile error on Ubuntu 14 2018-08-01 10:30:16 -07:00
swift-ci
506def6dc1 Merge remote-tracking branch 'origin/master' into master-next 2018-08-01 09:49:54 -07:00
Alex Hoppen
293e8bd0bd Merge pull request #18373 from ahoppen/sourcekit-improvements
[SourceKit] Serialize the syntax tree in the EditorConsumer
2018-08-01 09:30:11 -07:00
Rintaro Ishizaki
930d4342cd [SourceKit] Defensive guard for invalid offset and length in edit request
Otherwise, hits assertion, or crashes in no-assertion build.

Added 'EditableTextBuffer::getSize()' for getting size after previous updates
without actually applying them.

rdar://problem/34206143
2018-08-01 20:02:15 +09:00
swift-ci
8192816dcd Merge remote-tracking branch 'origin/master' into master-next 2018-07-31 17:09:17 -07:00
Xi Ge
571b29b64f SwiftSyntaxTest: refactor command-line argument parsing into a test utility module. NFC (#18418) 2018-07-31 17:05:47 -07:00
Alex Hoppen
bffa15ba63 [SwiftSyntax] Don't reclassify nodes that haven't changed since last transfer 2018-07-31 15:41:07 -07:00
Alex Hoppen
49e9f824bf [SwiftSyntax] Record the nodes that have been reused during an incremental transfer
This way we will be able to avoid reclassifying these nodes for syntax
highlighting since we know they haven't changed.
2018-07-31 15:41:07 -07:00
swift-ci
f66e55653f Merge remote-tracking branch 'origin/master' into master-next 2018-07-31 14:29:50 -07:00
Davide Italiano
a7f36075ff Merge pull request #17571 from dcci/existentialremoteast
[RemoteAST] Initial support for projecting the type out of an existen…
2018-07-31 14:27:50 -07:00
Alex Hoppen
b48f740712 [SourceKit] Serialize the syntax tree in the EditorConsumer
This will allow us to switch to a more efficient serialization format in
the future.
2018-07-31 13:51:16 -07:00
swift-ci
7a25818d82 Merge remote-tracking branch 'origin/master' into master-next 2018-07-31 13:49:49 -07:00