Allow macro expansions to be viewed through `GetReferenceDocumentRequest` instead of storing in temporary files
This PR eliminates the storage of temporary macro expansion files for PeekDocumentsRequest by introducing a new LSP Extension GetReferenceDocumentRequest.
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 a GetReferenceDocumentRequest.
Custom Scheme for Macro Expansions:
`sourcekit-lsp://macro-expansion/LaCb-LcCd.swift?sourceFileURL=&fromLine=&fromColumn=&toLine=&toColumn=&bufferName=`
References:
Previous PR which implemented PeekDocumentsRequest: https://github.com/swiftlang/sourcekit-lsp/pull/1479
Accompanying PR in vscode-swift repository: https://github.com/swiftlang/vscode-swift/pull/971
Expansion of Swift Macros in Visual Studio Code - Google Summer Of Code 2024 @lokesh-tr @ahoppen @adam-fowler
@ahoppen I have updated the PR and fixed the rebase issue with package specifiers. Ready for full review now. 👍🏻
@ahoppen ready for review
@ahoppen Ready for review.
@ahoppen Fixed everything as you suggested 🙂
@swift-ci Please test
@swift-ci Please test Windows