robotframework-lsp icon indicating copy to clipboard operation
robotframework-lsp copied to clipboard

intellij: Cannot distinguish StubFileElementTypes

Open FOXimir opened this issue 1 year ago • 1 comments

Hi could you please check this error? Error is visible after starting Pycharm and editing code. Few minutes later (40-120), plugin starts highlight incorrectly, linting stop working and whole plugin is unusable. In order to use plugin again I have to close and reopen Pycharm then I have another 40-120 minutes for my work.

Similar issue described here

Full logs attached in Logs.zip stacktrace.txt:

com.intellij.diagnostic.PluginException: Cannot distinguish StubFileElementTypes. This might worsen the performance. Providing unique externalId or adding a distinctive debugName when instantiating StubFileElementTypes can help (override getExternalId() and/or getDebugName() in StubFileElementType). See attachment for additional information. [Plugin: robocorp.lsp.intellij]
	at com.intellij.psi.stubs.PerFileElementTypeStubModificationTracker.reportStubFileElementTypeVersionConflict(PerFileElementTypeStubModificationTracker.java:281)

To Reproduce Steps to reproduce the behavior:

  1. Open robot file
  2. Start editing file

Expected behavior Extension is working without errors and issues.

Versions:

  • OS: Windows 10 22H2
  • Robot Framework Version: 6.0.2
  • Robot Framework Language Server Version: 1.11.0
  • Client Version: PyCharm 2023.3.2, but also on few previous version

Logs Logs.zip

FOXimir avatar Jan 04 '24 10:01 FOXimir

@FOXimir In case you're still interested in a solution: I have created a patch that resolves the issue, here in my fork: https://github.com/okleinke/robotframework-lsp/commit/6544c7e366392f7760e7fda80b746a122a00b47e

I also built a new version here, https://github.com/okleinke/robotframework-lsp/releases/tag/robotframework-lsp-1.12.1, which seems to work fine for me.

I've adapted the missing subclass/overrides mostly from here: https://github.com/YannCebron/m68kplugin/blob/313a3da739b04dfcd26de614e0c8a886a0140cf4/src/com/yanncebron/m68kplugin/lang/M68kFileElementType.java

okleinke avatar Sep 26 '24 11:09 okleinke