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

diagnostic tag for unnecessary refreshed very frequently. #488

Open
CppCXY opened this issue Aug 28, 2024 · 15 comments
Open

diagnostic tag for unnecessary refreshed very frequently. #488

CppCXY opened this issue Aug 28, 2024 · 15 comments
Labels
bug Something isn't working diagnostic

Comments

@CppCXY
Copy link
Contributor

CppCXY commented Aug 28, 2024

see:
361805447-2f6cae0b-1673-49df-aeee-3416a6ba55b9

@angelozerr angelozerr added bug Something isn't working diagnostic labels Aug 28, 2024
@fbricon
Copy link
Contributor

fbricon commented Sep 3, 2024

@angelozerr is it the same as #485 ?

@angelozerr
Copy link
Contributor

The fix of #485 was to highlight semantic tokens for the whole file by implementing void visit(@NotNull PsiElement element) with empty block code.

For diagnostics, we extends an ExternalAnnotator which should be used according to the documentation to implement a validator without Psi.

It could be interesting to try to implement HighlightVisitor like we did for semantic tokens and see if it fixes the issue, but according to the doc HighlightVisitor is usedto manage highlighting and not validation,but we could try it.

@CppCXY if you have time, you could try it.

@angelozerr
Copy link
Contributor

An another idea is to implement only Annotator to create only annotation for the editing PsiElement range.

This idea could improve the UI since we will create only annotations for the range of the PsiElement instead of re-creating all annotations for the whole file.

@CppCXY
Copy link
Contributor Author

CppCXY commented Sep 3, 2024

An another idea is to implement only Annotator to create only annotation for the editing PsiElement range.

This idea could improve the UI since we will create only annotations for the range of the PsiElement instead of re-creating all annotations for the whole file.

I observed that if the file is large enough, such as 1000 lines, there is no such flickering phenomenon, but if it is very small, this phenomenon exists.
see:
unused

@CppCXY
Copy link
Contributor Author

CppCXY commented Sep 3, 2024

So I think the reason might be that the rendering is too fast here.

@CppCXY
Copy link
Contributor Author

CppCXY commented Sep 3, 2024

Another piece of evidence is that in small files, if running in debug mode in IDEA, this issue is not observed either:

slow

@angelozerr
Copy link
Contributor

Thanks @CppCXY for your feedback!

@angelozerr
Copy link
Contributor

@CppCXY I have tested byinstalling your IJ plugin and I have no flicker.

Could you please share files / project that youare testing please.

@CppCXY
Copy link
Contributor Author

CppCXY commented Sep 3, 2024

@CppCXY I have tested byinstalling your IJ plugin and I have no flicker.

Could you please share files / project that youare testing please.

which plugin, your install?

@angelozerr
Copy link
Contributor

which plugin, your install?

image

@CppCXY
Copy link
Contributor Author

CppCXY commented Sep 3, 2024

which plugin, your install?

I tested it on my home computer, and there was no flickering at all. I'll try with a large file.

@CppCXY
Copy link
Contributor Author

CppCXY commented Sep 3, 2024

Maybe the CPU at home is better, so it's difficult to reproduce this issue now.

@angelozerr
Copy link
Contributor

You mean that you cannot reproduce with your computer at home?

@CppCXY
Copy link
Contributor Author

CppCXY commented Sep 3, 2024

You mean that you cannot reproduce with your computer at home?

yes, I think this issue doesn't need to be resolved.

@angelozerr
Copy link
Contributor

angelozerr commented Sep 3, 2024

OK but I think it could be interesting to try with annotator to see if it will improve performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working diagnostic
Projects
None yet
Development

No branches or pull requests

3 participants