monaco-languageclient icon indicating copy to clipboard operation
monaco-languageclient copied to clipboard

How is goto definition for remote URIs supposed to be handled by monaco-languageclient

Open MangoIV opened this issue 8 months ago • 7 comments

Hi! I wanted to ask whether there's some "idiomatic" way for the following scenario with monaco-languageclient:

  • a languageserver is running on a backend
  • the user uses goto definition to a definition that is located on a file: URI on the backend.

Currently nothing is happening when I do this. Ideally I would like the frontend to load this file into a new buffer.

MangoIV avatar Mar 25 '25 12:03 MangoIV

Any error in the console? you probably have a file not found error. You'll have to implement a provider able to get that file content from the backend

CGNonofr avatar Mar 25 '25 13:03 CGNonofr

@CGNonofr, sadly no error at all, it just "doesn't work" (while it does work locally, in vscode)

MangoIV avatar Mar 25 '25 15:03 MangoIV

I'm not sure an error is displayed if the file doesn't exists though. What is sure is that it needs a way to get the actual file content

CGNonofr avatar Mar 25 '25 15:03 CGNonofr

Yes - do you have a pointer on where to start to get the file contents somehow?

MangoIV avatar Mar 25 '25 16:03 MangoIV

It still should be done manually (related to https://github.com/TypeFox/monaco-languageclient/issues/834)

you can use the registerFileSystemOverlay method from @codingame/monaco-vscode-files-service-override to register your filesystem which will fetch the file content by any mean you want

CGNonofr avatar Mar 25 '25 16:03 CGNonofr

thank you!

MangoIV avatar Mar 25 '25 17:03 MangoIV

I will close this when I found a solution and will post it here for future reference.

MangoIV avatar Mar 25 '25 17:03 MangoIV

Issue review before new release. I will close this now. @MangoIV feel free to post a solution later.

kaisalmen avatar Sep 19 '25 10:09 kaisalmen