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

"Code | Inspect Code" does not report syntax errors #476

Open
harry-xm opened this issue Aug 26, 2024 · 7 comments
Open

"Code | Inspect Code" does not report syntax errors #476

harry-xm opened this issue Aug 26, 2024 · 7 comments
Labels
diagnostic enhancement New feature or request

Comments

@harry-xm
Copy link

The Annotators inspection is enabled, but annotated errors are not reported in the inspections panel.

Screenshot

@angelozerr
Copy link
Contributor

I have no idea which IntelliJ extension point we need to use to manage that. Today error is displayed when you are typing in the editor. In Rust usecase it seems that error is done when you are saving file (you need to do Ctrl+Save).

@harry-xm
Copy link
Author

In Rust usecase it seems that error is done when you are saving file (you need to do Ctrl+Save).

I don't think it's related to Rust. The error is displayed when I'm typing, just not in the inspections panel, which is different from the Problems in (current) File panel.

@angelozerr
Copy link
Contributor

I don't know how to do that with IntelliJ API / extension point. I need to investigate how to implement that.

@angelozerr angelozerr added enhancement New feature or request diagnostic labels Aug 27, 2024
@SCWells72
Copy link
Contributor

If it helps, I believe the most applicable EP would be ExternalAnnotator as that's how other external static code analyzers/linters such as ESLint are integrated.

@angelozerr
Copy link
Contributor

We use ExternalAnnotator but perhaps it requires some config?

@SCWells72
Copy link
Contributor

We use ExternalAnnotator but perhaps it requires some config?

I'm not 100% sure. I would think that if you're creating annotations with sufficient severity and Annotator is included in the inspection profile, those annotations would show up in the report.

Are you familiar with the JetBrains Platform developer Slack community? It's a wonderful forum for chatting with fellow plugin developers and JetBrains platform developers directly. I'd recommend you join that group and then you can inquire as to why your external annotator's results aren't being included in inspection results.

@SCWells72
Copy link
Contributor

I did a little research and prototyping on this today and unfortunately hit snags down every path.

Currently LSP4IJ integrates diagnostic information via notifications from the language server. There doesn't seem to be a good way to get that information in an efficient and scaleable fashion using push notifications.

There is a newer LSP feature for pull diagnostics that would theoretically solve that problem, but unfortunately it doesn't yet seem to be supported by many language servers (at least none of the ones that I tried including TypeScript/JavaScript and CSS).

I think it probably makes sense to revisit this when more language servers support pull diagnostics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diagnostic enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants
@angelozerr @SCWells72 @harry-xm and others