Skip to content

Error while consuming 'textDocument/declaration' with language server 'SourceKit-LSP' while editing a Swift file in IntelliJ 2025.3.3 #1434

Closed

Description

@rgoldberg

Get the following error in IntelliJ 2025.3.3 while editing a Swift file.

Error while consuming 'textDocument/declaration' with language server 'SourceKit-LSP'

org.eclipse.lsp4j.jsonrpc.ResponseErrorException: unsupported method
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:209)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:193)
	at com.redhat.devtools.lsp4ij.LanguageServerWrapper.lambda$start$4(LanguageServerWrapper.java:387)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1491)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:2073)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2035)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:187)

Activity

  1. angelozerr commented on Mar 13, 2026

    @angelozerr
    Contributor

    This error comes from 'SourceKit-LSP' language server. It seems it notifies that it supports textDocument/declaration' although it seems it doesn't support it.

    Could you enable LSP trace as verbose (see https://github.com/redhat-developer/lsp4ij/blob/main/docs/UserGuide.md#lsp-console) and share your trace please.

  2. bodiam commented on May 8, 2026

    @bodiam
    Contributor

    Hi @angelozerr , good to see you again. I've got the same issue for nixd.

    this is my output:

    2026-05-08 21:30:22,759 [  52181]   INFO - #dev.jetplugins.nix.lsp.NixLspMessageFramer - [Nix debug][LSP][nixd][IDE -> server] {"jsonrpc":"2.0","id":"25","method":"textDocument/definition","params":{"textDocument":{"uri":"file:///Users/erikpragt/UserFiles/projects/nix/llm-agents.nix/devshell.nix"},"position":{"line":1,"character":8}}}
    2026-05-08 21:30:22,774 [  52196]   INFO - #dev.jetplugins.nix.lsp.NixLspMessageFramer - [Nix debug][LSP][nixd][server -> IDE] {"id":"25","jsonrpc":"2.0","result":null}
    2026-05-08 21:30:22,780 [  52202]   INFO - #dev.jetplugins.nix.lsp.NixLspMessageFramer - [Nix debug][LSP][nixd][IDE -> server] {"jsonrpc":"2.0","id":"26","method":"textDocument/documentLink","params":{"textDocument":{"uri":"file:///Users/erikpragt/UserFiles/projects/nix/llm-agents.nix/devshell.nix"}}}
    2026-05-08 21:30:22,781 [  52203]   INFO - #dev.jetplugins.nix.lsp.NixLspMessageFramer - [Nix debug][LSP][nixd][server -> IDE] {"id":"26","jsonrpc":"2.0","result":[]}
    2026-05-08 21:30:23,252 [  52674]   INFO - #dev.jetplugins.nix.lsp.NixLspMessageFramer - [Nix debug][LSP][nixd][IDE -> server] {"jsonrpc":"2.0","id":"27","method":"textDocument/definition","params":{"textDocument":{"uri":"file:///Users/erikpragt/UserFiles/projects/nix/llm-agents.nix/devshell.nix"},"position":{"line":1,"character":7}}}
    2026-05-08 21:30:23,253 [  52675]   INFO - #dev.jetplugins.nix.lsp.NixLspMessageFramer - [Nix debug][LSP][nixd][server -> IDE] {"id":"27","jsonrpc":"2.0","result":null}
    2026-05-08 21:30:23,268 [  52690]   INFO - #dev.jetplugins.nix.lsp.NixLspMessageFramer - [Nix debug][LSP][nixd][IDE -> server] {"jsonrpc":"2.0","id":"28","method":"textDocument/definition","params":{"textDocument":{"uri":"file:///Users/erikpragt/UserFiles/projects/nix/llm-agents.nix/devshell.nix"},"position":{"line":1,"character":6}}}
    2026-05-08 21:30:23,269 [  52691]   INFO - #dev.jetplugins.nix.lsp.NixLspMessageFramer - [Nix debug][LSP][nixd][server -> IDE] {"id":"28","jsonrpc":"2.0","result":null}
    2026-05-08 21:30:23,300 [  52722]   INFO - #dev.jetplugins.nix.lsp.NixLspMessageFramer - [Nix debug][LSP][nixd][IDE -> server] {"jsonrpc":"2.0","id":"29","method":"textDocument/definition","params":{"textDocument":{"uri":"file:///Users/erikpragt/UserFiles/projects/nix/llm-agents.nix/devshell.nix"},"position":{"line":1,"character":5}}}
    2026-05-08 21:30:23,301 [  52723]   INFO - #dev.jetplugins.nix.lsp.NixLspMessageFramer - [Nix debug][LSP][nixd][server -> IDE] {"id":"29","jsonrpc":"2.0","result":null}
    2026-05-08 21:30:24,249 [  53671]   INFO - #dev.jetplugins.nix.lsp.NixLspMessageFramer - [Nix debug][LSP][nixd][IDE -> server] {"jsonrpc":"2.0","id":"30","method":"textDocument/documentLink","params":{"textDocument":{"uri":"file:///Users/erikpragt/UserFiles/projects/nix/llm-agents.nix/devshell.nix"}}}
    2026-05-08 21:30:24,251 [  53673]   INFO - #dev.jetplugins.nix.lsp.NixLspMessageFramer - [Nix debug][LSP][nixd][server -> IDE] {"id":"30","jsonrpc":"2.0","result":[]}
    2026-05-08 21:30:24,432 [  53854]   INFO - #dev.jetplugins.nix.lsp.NixLspMessageFramer - [Nix debug][LSP][nixd][IDE -> server] {"jsonrpc":"2.0","id":"31","method":"textDocument/definition","params":{"textDocument":{"uri":"file:///Users/erikpragt/UserFiles/projects/nix/llm-agents.nix/devshell.nix"},"position":{"line":0,"character":7}}}
    2026-05-08 21:30:24,432 [  53854]   INFO - #dev.jetplugins.nix.lsp.NixLspMessageFramer - [Nix debug][LSP][nixd][server -> IDE] {"error":{"code":-32001,"message":"unknown node type for definition"},"id":"31","jsonrpc":"2.0"}
    2026-05-08 21:30:24,434 [  53856] SEVERE - com.redhat.devtools.lsp4ij.internal.CancellationSupport - Error while consuming 'textDocument/declaration' with language server 'nixd'
    org.eclipse.lsp4j.jsonrpc.ResponseErrorException: unknown node type for definition
    	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:209)
    	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:193)
    	at com.redhat.devtools.lsp4ij.LanguageServerWrapper.lambda$start$4(LanguageServerWrapper.java:387)
    	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
    	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
    	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507)
    	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1491)
    	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:2073)
    	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2035)
    	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:187)
    

    PS: I just saw I was using com.redhat.devtools.lsp4ij:0.19.2, I've updated to 0.19.3

  3. lagergren commented on Nov 20, 2026

    @lagergren
    Collaborator

    Fixed in 0.19.4 by #1485: LSP4IJ reported the errors of textDocument/definition requests as errors of textDocument/declaration. The error itself is SourceKit-LSP's answer to the request. Please reopen with an LSP console trace if it still happens with 0.30.1.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions