-
Notifications
You must be signed in to change notification settings - Fork 440
Implement editor placeholder parsing logic in SwiftSyntax #2878
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
Conversation
swiftlang/sourcekit-lsp#1746 |
} | ||
|
||
@_spi(RawSyntax) | ||
public func parseEditorPlaceholder(syntaxText: SyntaxText) -> RawEditorPlaceholderData? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be an initializer on RawEditorPlaceholderData
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made this function private
and introduced RawEditorPlaceholderData.init?(syntaxText:)
case typed(text: Substring, type: TypeSyntax) | ||
private struct EditorPlaceholderExpansionData { | ||
let displayText: String | ||
let type: TypeSyntax? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be typeForExpansion
to match the member name in RawEditorPlaceholderExpansionData
?
cdb1228
to
7cde6c3
Compare
swiftlang/sourcekit-lsp#1746 |
7cde6c3
to
58a2cbb
Compare
swiftlang/sourcekit-lsp#1746 |
swiftlang/sourcekit-lsp#1746 |
swiftlang/swift#76943 |
1 similar comment
swiftlang/swift#76943 |
So it can be used from other clients.
58a2cbb
to
d908703
Compare
swiftlang/sourcekit-lsp#1746 |
swiftlang/sourcekit-lsp#1746 |
swiftlang/sourcekit-lsp#1746 |
1 similar comment
swiftlang/sourcekit-lsp#1746 |
So it can be used from other clients.
RawEditorPlaceholderData(syntaxText:)
Parse a placeholder text<#...#>
and instantiateSwiftSyntax.RawEditorPlaceholderData
.RawEditorPlaceholderData
holds the parsed data, similar to C++ compiler'sEditorPlaceholderData