Skip to content

Management of swiftinterface files #538

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

Merged
merged 7 commits into from
May 9, 2023

Conversation

adam-fowler
Copy link
Contributor

@adam-fowler adam-fowler commented May 4, 2023

Currently if you right click on the import module text you can jump to a cleaned up version of its swift interface file with documentation. Eventually I hope SourceKit-LSP will be able to do this for any symbol from a framework we don't have source code for.

In the meantime this PR helps this process by first adding a readonly document provider and using this when displaying swift interface files. A middleware is added to the LSP client to redirect the swiftinterface files to the read-only document provider. This means of course the user can't edit the files but also has the added bonus that sourcekit-lsp will not try to compile them (and most likely complain). Secondly I have also associated the extension .swiftinterface with the swift language so we get proper highlighting.

@adam-fowler adam-fowler force-pushed the feature/swift-module branch from 209475f to fbfb4f1 Compare May 4, 2023 15:44
@@ -1,6 +1,6 @@
# Changelog

## 1.3.0 - 2023-05-02
## 1.3.0 - 2023-05-03
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This PR has caught my date update for the CHANGELOG

(client: langclient.LanguageClient, cancellationToken: vscode.CancellationToken): Return;
}) {
if (!this.languageClient) {
(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I cleaned up useLanguageClient a little because I was originally using this in the PR, but I'm not anymore. But the clean up is still valid I feel.

@adam-fowler adam-fowler merged commit de12d9a into swiftlang:main May 9, 2023
@adam-fowler adam-fowler deleted the feature/swift-module branch May 9, 2023 10:44
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.

2 participants