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: inlay hints maybe a bit delayed if sync init #357

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

Shane-XB-Qian
Copy link
Contributor

No description provided.

acmds->add({bufnr: bnr,
event: ['User'],
group: 'LspAttached',
cmd: $'LspInlayHintsChanged({bnr})'})
Copy link
Owner

Choose a reason for hiding this comment

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

The LspAttached autocmd handler needs to be executed only once for this buffer. So can you add once: v:true to the autocmd Dict?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

1, i donot know why, but once added once: true, that au may not be kicked-off.
2, normally bufinit would/should be done only once when addFile()?? unless manually doau it again.
3, exists('#User#LspAttached') seems should be exists('#LspAttached#User') but actually worked, weird.

Copy link
Owner

Choose a reason for hiding this comment

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

If once is not used, then the autocmd will be present forever (even though it will not be invoked).
If you run the :autocmd command, you will see too many of these.

Are you saying that if you set once to true, then the autocmd is not invoked?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If once is not used, then the autocmd will be present forever (even though it will not be invoked).
If you run the :autocmd command, you will see too many of these

yes, since it's on buf, if that's a concern, then maybe a bit annoyed, but:

Are you saying that if you set once to true, then the autocmd is not invoked?

yes, au was not invoked at all, no even once (nothing).

@Shane-XB-Qian
Copy link
Contributor Author

r.i.p bram.

@yegappan
Copy link
Owner

yegappan commented Aug 6, 2023

I don't know why you closed this PR. But I intend to continue to develop and maintain the LSP plugin.

@Shane-XB-Qian Shane-XB-Qian force-pushed the fix_inlay_maybe_delayed branch from 5a597d7 to 2cfbeb6 Compare September 19, 2023 13:49
@CoelacanthusHex
Copy link
Contributor

Hope this PR can be merged soon. Without this, my rust-analyzer doesn't until I execute :LspInlayHint enable manually.

@yegappan yegappan merged commit 10ded53 into yegappan:main Nov 28, 2023
1 check passed
@Shane-XB-Qian Shane-XB-Qian deleted the fix_inlay_maybe_delayed branch December 1, 2023 11:05
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.

3 participants