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

Clear All Decorations in dispose #608

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

Baricus
Copy link
Contributor

@Baricus Baricus commented Mar 23, 2024

This PR fixes issue #600, by calling dispose for the decorationType member of InactiveRegionsFeature objects during their own disposal. Doing so removes the applied decorations, preventing them from persisting after the the extension is stopped or restarted.

Disposes of the decoration when the InactiveRegionsFeature
is itself disposed.
Copy link
Contributor

@HighCommander4 HighCommander4 left a comment

Choose a reason for hiding this comment

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

Thanks for the fix! I confirmed with a local test that this fixes #600.

It would be nice in principle to add an automated test for this, but looking at https://github.com/clangd/vscode-clangd/blob/master/test/inactive-regions.test.ts that doesn't seem straightforward to do using the existing mocks, and I feel a bit out of depth with typescript testing to suggest a way to do it that involves new mocks. If someone would like to write a test as a follow-up, please feel free :)

@HighCommander4 HighCommander4 merged commit 6839c06 into clangd:master Mar 25, 2024
1 check 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.

2 participants