Skip to content

Neovim plugin#989

Open
qu1ncyk wants to merge 11 commits intousethesource:mainfrom
qu1ncyk:neovim-plugin
Open

Neovim plugin#989
qu1ncyk wants to merge 11 commits intousethesource:mainfrom
qu1ncyk:neovim-plugin

Conversation

@qu1ncyk
Copy link
Contributor

@qu1ncyk qu1ncyk commented Feb 28, 2026

Resolves #988.

This PR adds a Neovim plugin that makes it easy to use the Rascal LSP in Neovim. To make the LSP work in Neovim, this PR includes fixes for a NullPointerException.

NullPointerException stack trace
java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke "org.eclipse.lsp4j.FileOperationsWorkspaceCapabilities.getDidCreate()" because the return value of "org.eclipse.lsp4j.WorkspaceClientCapabilities.getFileOperations()" is null
    at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
    at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.lsp4j.FileOperationsWorkspaceCapabilities.getDidCreate()" because the return value of "org.eclipse.lsp4j.WorkspaceClientCapabilities.getFileOperations()" is null
    at org.rascalmpl.vscode.lsp.rascal.RascalWorkspaceService.initialize(RascalWorkspaceService.java:61)
    at org.rascalmpl.vscode.lsp.BaseLanguageServer$ActualLanguageServer.lambda$initialize$4(BaseLanguageServer.java:260)
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
    ... 3 more

To be honest, I'm not sure what getDidCreate, getDidRename and getDidDelete do and whether it is necessary to invoke getFileOperations 3 times, but at least the error is gone.

This plugin only adds support for the Rascal LSP, not for the parametric LSP.

@jurgenvinju jurgenvinju added the enhancement New feature or request label Feb 28, 2026
@jurgenvinju
Copy link
Member

Interesting! Thanks for doing this. Is there an easy way to include terminal support? Like in a split screen?

@qu1ncyk
Copy link
Contributor Author

qu1ncyk commented Mar 1, 2026

I added a command :RascalTerminal, which opens the Rascal REPL in a new terminal window inside Neovim. By default, it uses the built-in :terminal, but this can be configured to use a third-party plugin that provides a more user-friendly terminal, such as toggleterm.nvim.

@DavyLandman
Copy link
Member

Hi @qu1ncyk

Thanks for your work in this PR.

  1. Could you review & sign our CLA
  2. Can you open a separate PR with the bugfix? that way we can make sure that gets released with the next release
  3. Can we have some kind of tests for the neovim plugin? so we know if something breaks?

@qu1ncyk
Copy link
Contributor Author

qu1ncyk commented Mar 1, 2026

Hi, thanks for reviewing. I signed the CLA and opened a PR with just the bugfix. I'll look into testing.

@qu1ncyk
Copy link
Contributor Author

qu1ncyk commented Mar 7, 2026

Hi, I added tests for the plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Neovim support

3 participants