groovy-guru icon indicating copy to clipboard operation
groovy-guru copied to clipboard

No intellisense for unsaved files

Open felipecrs opened this issue 3 years ago • 2 comments

I don't know if it's desired or no, but the extension seems to only provide intellisense for Groovy code when the file is saved:

KmlsHD3ohz

felipecrs avatar Aug 11 '21 13:08 felipecrs

@felipecrs Yes... I have noticed this when trying to debug new features. I also try and throw groovy into a fresh file and it doesn't work for me either.

So we tell vscode to activate the plugin once vscode knows the language is groovy.

"activationEvents": [
    "onLanguage:groovy",
    "onCommand:groovy.restartServer"
],

but on the language server side it has to compile your workspace, so it needs access to the files and the filesystem. I just tried with the Redhat Java extension and it also behaves the same way. We can leave this open for now and I will add something to the README to avoid any surprises. Groovy3 did add a way to compile text without files so it's possible that this could be added in the future as long as the LSP (the protocol) supports it.

shadycuz avatar Aug 11 '21 14:08 shadycuz

I just tried with the Redhat Java extension and it also behaves the same way.

Oh, if it behaves the same way then I think we are good.

We can leave this open for now and I will add something to the README to avoid any surprises.

It's up to you, now knowing that it does not work even for Java, it's fine for me if you prefer to close it.

Groovy3 did add a way to compile text without files so it's possible that this could be added in the future as long as the LSP (the protocol) supports it.

Very interesting. TypeScript's LSP supports it, so from LSP's perspective it should be doable.

felipecrs avatar Aug 11 '21 15:08 felipecrs