Skip to content

Retrieve macro expansions for PeekDocumentsRequest through GetReferenceDocumentRequest instead of showing temporary files #971

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

lokesh-tr
Copy link
Contributor

@lokesh-tr lokesh-tr commented Jul 17, 2024

This PR utilises the newly introduced GetReferenceDocumentRequest to resolve the contents of macro expansion obtained from PeekDocumentRequest through a new scheme.

This change doesn't cause any behavioural changes facing the user.
The GetReferenceDocumentRequest implemented in sourcekit-lsp allows it to not create temporary files whenever it makes a PeekDocumentRequest.

References:

Accompanying PR in sourcekit-lsp repository: swiftlang/sourcekit-lsp#1567


Expansion of Swift Macros in Visual Studio Code - Google Summer Of Code 2024
@lokesh-tr @ahoppen @adam-fowler

Copy link
Contributor

@adam-fowler adam-fowler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, mainly looking to not make this macro specific because it could be used in other situations. @ahoppen perhaps this could be used for generated swiftinterface files

@lokesh-tr lokesh-tr force-pushed the macro-expansions-get-reference-document branch from 7e8bb7a to 4528b4a Compare July 25, 2024 14:49
…renceDocumentRequest` instead of showing temporary files
@lokesh-tr lokesh-tr force-pushed the macro-expansions-get-reference-document branch from 4528b4a to d856f0c Compare July 25, 2024 14:52
@lokesh-tr lokesh-tr requested a review from adam-fowler July 25, 2024 14:55
@lokesh-tr
Copy link
Contributor Author

@adam-fowler The sourcekit-lsp PR got merged just a few hours back. Can you review this PR now?

Copy link
Contributor

@adam-fowler adam-fowler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@adam-fowler
Copy link
Contributor

@swift-server-bot test this please

@adam-fowler adam-fowler merged commit a596d31 into swiftlang:main Aug 1, 2024
8 checks passed
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

Successfully merging this pull request may close these issues.

3 participants