-
Notifications
You must be signed in to change notification settings - Fork 305
Allow macro expansions to be viewed through GetReferenceDocumentRequest
instead of storing in temporary files
#1567
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
Allow macro expansions to be viewed through GetReferenceDocumentRequest
instead of storing in temporary files
#1567
Conversation
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.
Wow, this was easier than I expected.
Sources/LanguageServerProtocol/Requests/GetReferenceDocumentRequest.swift
Show resolved
Hide resolved
c9e559b
to
58a1d7d
Compare
58a1d7d
to
f49c429
Compare
f49c429
to
df712a5
Compare
@ahoppen I have updated the PR and fixed the rebase issue with package specifiers. Ready for full review now. 👍🏻 |
Sources/SourceKitLSP/Swift/MacroExpansionReferenceDocument.swift
Outdated
Show resolved
Hide resolved
7f495e1
to
a8f496d
Compare
@ahoppen ready for review |
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.
Looks much better with the split for the URL data in my opinion.
Sources/SourceKitLSP/Swift/MacroExpansionReferenceDocumentURLData.swift
Outdated
Show resolved
Hide resolved
Sources/SourceKitLSP/Swift/MacroExpansionReferenceDocumentURLData.swift
Outdated
Show resolved
Hide resolved
Sources/SourceKitLSP/Swift/MacroExpansionReferenceDocumentURLData.swift
Outdated
Show resolved
Hide resolved
a8f496d
to
c9f9d23
Compare
@ahoppen Ready for review. |
Sources/SourceKitLSP/Swift/MacroExpansionReferenceDocumentURLData.swift
Outdated
Show resolved
Hide resolved
Sources/SourceKitLSP/Swift/MacroExpansionReferenceDocumentURLData.swift
Outdated
Show resolved
Hide resolved
87026f7
to
b6d9a02
Compare
…est` instead of storing in temporary files
b6d9a02
to
0522e1a
Compare
@ahoppen Fixed everything as you suggested 🙂 |
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.
Very nice
@swift-ci Please test |
@swift-ci Please test Windows |
This PR eliminates the storage of temporary macro expansion files for
PeekDocumentsRequest
by introducing a new LSP ExtensionGetReferenceDocumentRequest
.The implementation is made in such a way that the URI passed for macro expansions through
PeekDocumentsRequest
is customised with a new scheme, and expects the client to resolve the contents of this new URI by making aGetReferenceDocumentRequest
.References:
Previous PR which implemented
PeekDocumentsRequest
: #1479Accompanying PR in vscode-swift repository: swiftlang/vscode-swift#971
Expansion of Swift Macros in Visual Studio Code - Google Summer Of Code 2024
@lokesh-tr @ahoppen @adam-fowler