Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request.syntaxTree not found "key.serialized_syntax_tree" in Apple Silicon M2 Xcode14.3 #768

Open
yanjinsheng opened this issue Apr 18, 2023 · 1 comment

Comments

@yanjinsheng
Copy link

let file = File(contents: "class A {}")
let result = try SourceKittenFramework.Request.syntaxTree(file: file, byteTree: false).send()
print(result)

apple silicon M2 xcode14.3, "key.serialized_syntax_tree" is not found in result

["key.diagnostic_stage": "source.diagnostic.stage.swift.parse"]

intel xcode14.1,is ok

["key.diagnostic_stage": "source.diagnostic.stage.swift.parse", "key.serialized_syntax_tree": "{"kind":"SourceFile","layout":[{"kind":"CodeBlockItemList","layout":[{"kind":"CodeBlockItem","layout":[{"kind":"ClassDecl","layout":[null,null,{"tokenKind":{"kind":"kw_class"},"leadingTrivia":"","trailingTrivia":" ","presence":"Present"},{"tokenKind":{"kind":"identifier","text":"A"},"leadingTrivia":"","trailingTrivia":" ","presence":"Present"},null,null,null,{"kind":"MemberDeclBlock","layout":[{"tokenKind":{"kind":"l_brace"},"leadingTrivia":"","trailingTrivia":"","presence":"Present"},{"kind":"MemberDeclList","layout":[],"presence":"Present"},{"tokenKind":{"kind":"r_brace"},"leadingTrivia":"","trailingTrivia":"","presence":"Present"}],"presence":"Present"}],"presence":"Present"},null,null],"presence":"Present"}],"presence":"Present"},{"tokenKind":{"kind":"eof","text":""},"leadingTrivia":"","trailingTrivia":"","presence":"Present"}],"presence":"Present"}"]

@jpsim
Copy link
Owner

jpsim commented Apr 18, 2023

I think SourceKit in Xcode 14.3 doesn't return a serialized syntax tree anymore. I think you're meant to use the SwiftSyntax library to get that instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants