Skip to content
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

Clean up live preview VS Code event handlers #1284

Merged
merged 3 commits into from
Dec 18, 2024

Conversation

matthewbastien
Copy link
Member

Switch to using vscode.workspace.onDidChangeTextDocument() instead of listening for text editor selection changes. This reduces the number of unnecessary requests made to SourceKit-LSP. Additionally, check the language of the editor before we send a request as SourceKit-LSP can only handle Markdown, Tutorial, and Swift files. Anything else we can safely assume will not succeed.

@matthewbastien matthewbastien merged commit 9d1c700 into swiftlang:main Dec 18, 2024
15 checks passed
@matthewbastien matthewbastien deleted the live-preview-events branch December 18, 2024 18:01
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