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

What is rootUri in MonacoServices.install() for?

Open MassMessage opened this issue 3 years ago • 8 comments

From this line:

MonacoServices.install(monaco, {rootUri: "file:///C:\\file\\path"}) Where is this uri used? I couldn't find docs for it nor it's clear looking over at source code

MassMessage avatar Jun 14 '22 06:06 MassMessage

The rootUri is only used to generate a default workspaceFolder if none is provided

Btw the api will probably slightly change in a near future

CGNonofr avatar Jun 14 '22 07:06 CGNonofr

The rootUri is only used to generate a default workspaceFolder if none is provided

but where is this default workspaceFolder used? for exe so i would do things like pass relative path in uri here when calling monaco.editor.createModel() and it would be combined with default workspaceFolder, is that right?

Btw the api will probably slightly change in a near future

hm how is that going to change?

MassMessage avatar Jun 14 '22 15:06 MassMessage

but where is this default workspaceFolder used?

In the lsp initialize request

for exe so i would do things like pass relative path in uri here when calling monaco.editor.createModel() and it would be combined with default workspaceFolder, is that right?

There is no such things as relative uri/path in vscode/monaco

hm how is that going to change?

The rootPath and the workspaceFolders will be expected as parameters directly

CGNonofr avatar Jun 14 '22 16:06 CGNonofr

but where is this default workspaceFolder used?

The the lsp initialize request

sorry i misunderstood that previously and still didnt get it, i'm not familiar with lsp's initialize... what is workspaceFolder supposed to be? the project's folder or what?

for exe so i would do things like pass relative path in uri here when calling monaco.editor.createModel() and it would be combined with default workspaceFolder, is that right?

There is no such things as relative uri/path in vscode/monaco

hm how is that going to change?

The rootPath and the workspaceFolders will be expected as parameters directly

MassMessage avatar Jun 14 '22 16:06 MassMessage

sorry i misunderstood that previously and still didnt get it, i'm not familiar with lsp's initialize... what is workspaceFolder supposed to be? the project's folder or what?

Yes, a workspaceFolder is a project

CGNonofr avatar Jun 14 '22 16:06 CGNonofr

sorry i misunderstood that previously and still didnt get it, i'm not familiar with lsp's initialize... what is workspaceFolder supposed to be? the project's folder or what?

Yes, a workspaceFolder is a project

where is this used by the lps? is that documented somewhere? if i pass a empty string, what's the behavior for exe?

MassMessage avatar Jun 14 '22 16:06 MassMessage

What is exe?

The language server protocol is pretty well documented

CGNonofr avatar Jun 14 '22 16:06 CGNonofr

What is exe?

example

The language server protocol is pretty well documented

i should rather be looking over this doc to find out about workspaceFolder thanks.

MassMessage avatar Jun 14 '22 16:06 MassMessage

@MassMessage I am closing the issue. If there are further questions please open a discussion: https://github.com/TypeFox/monaco-languageclient/discussions

Thank you

kaisalmen avatar Oct 19 '22 06:10 kaisalmen