Files
swift-mirror/test/SourceKit/SyntaxTree/basic.swift
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

10 lines
244 B
Swift

// RUN: %swift-syntax-test -input-source-filename %s -serialize-raw-tree > %t.emit
// RUN: %sourcekitd-test -req=syntax-tree %s > %t.sourcekit
// RUN: diff %t.emit %t.sourcekit
struct Foo {
let bar : Int
let baz : Array < Int >
}