通过IntelliJ的插件API,是否有办法访问虚拟文件的问题?

huangapple go评论63阅读模式
英文:

Is there anyway to access the problems of a virtual file via IntelliJ's plugin APIs?

问题

我正在尝试编写一个IntelliJ插件,该插件需要获取Problems工具窗口中的内容。

或者是否有一个API可以用来获取当前文件和项目的错误?

英文:

I'm trying to write an IntelliJ plugin, the plugin needs to get the content in the Problems tool window.

通过IntelliJ的插件API,是否有办法访问虚拟文件的问题?

Or is there an API that I can use to get the errors of the current file and project?

答案1

得分: 1

ProblemsCollector.getInstance(project).getFileProblems(virtualFile); - 这个方法可以被使用。

查看完整的问题视图实现,请点击此处:https://github.com/JetBrains/intellij-community/tree/a1d2ab6e021bdc7a11aa55146f6366e68554fb36/platform/lang-impl/src/com/intellij/analysis/problemsView

英文:

ProblemsCollector.getInstance(project).getFileProblems(virtualFile); - this method can be used

See the whole implementation of the Problems View here https://github.com/JetBrains/intellij-community/tree/a1d2ab6e021bdc7a11aa55146f6366e68554fb36/platform/lang-impl/src/com/intellij/analysis/problemsView

huangapple
  • 本文由 发表于 2023年7月13日 11:07:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/76675640.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定