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

fix: update extmarks unconditionally #515

Closed
wants to merge 1 commit into from

Conversation

apollo1321
Copy link
Contributor

@apollo1321 apollo1321 commented Oct 30, 2024

Fixes #509
But I am not sure if it is a good solution. Maybe it is better to check if the virtual text has changed? It will be harder to implement and probably will require creating special namespace for extmarks or maintaining list of extmarks for each context window.
@lewis6991, what do you think?

@lewis6991
Copy link
Member

lewis6991 commented Oct 30, 2024

I'm not sure this is the best solution. My idea was just to have additional triggers, it won't catch everything, but the main one is just diagnostics which we can special case for now.

Maybe for the general case we can define a user autocmd which can be called?

@apollo1321
Copy link
Contributor Author

My idea was just to have additional triggers, it won't catch everything, but the main one is just diagnostics which we can special case for now.

Hm, I think we can support special case for Diagnostic. We can add force_update in render.open function. And set this flag in true only for DiagnosticChanged event. Also, it will be necessary to change throttling to support force_update.

Maybe for the general case we can define a user autocmd which can be called?

Are you suggesting providing an API that allows users to manually trigger a context update?

@lewis6991
Copy link
Member

Are you suggesting providing an API that allows users to manually trigger a context update?

Potentially. Need to know the use cases first.

@apollo1321 apollo1321 closed this Nov 17, 2024
@xzbdmw
Copy link

xzbdmw commented Nov 20, 2024

@lewis6991 Since this plugin no longer concat multi-line contexts, how about open a window directly with the parent buffer, so lsp semantic highlight, virtual-text, etc. stay consistent and can also reduce the code required to query ts-highligts.

@lewis6991
Copy link
Member

lewis6991 commented Nov 20, 2024

You'd need to open several windows so this would be more complicated.

Context already copies all the semantic tokens and extmarks.

@xzbdmw
Copy link

xzbdmw commented Nov 20, 2024

Potentially. Need to know the use cases first.

I think manually trigger context in Telescope previewer is very cool and useful, combined with TelescopePreviewLoaded autocmd

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.

Bug: Diagnostic virtual text is not updated in the treesitter context
3 participants