Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workspace loading: 0 / 0 #981

Closed
arnoson opened this issue Mar 10, 2022 · 13 comments
Closed

Workspace loading: 0 / 0 #981

arnoson opened this issue Mar 10, 2022 · 13 comments

Comments

@arnoson
Copy link

arnoson commented Mar 10, 2022

I'm trying to use your language server with codemirror 6. But somehow the only message I get is "Workspace loading: 0 / 0". I Use the same setup with monaco editor and it works (https://github.com/arnoson/monaco-lua-example).

From the message I guess that the editor file isn't really synchronized with the language server. I have a test setup here: https://github.com/arnoson/codemirror-lua

I tried to investigate the problem myself but I can't figure out whats missing.
Do you have any idea what the problem could be?

@sumneko
Copy link
Collaborator

sumneko commented Mar 10, 2022

@arnoson
Copy link
Author

arnoson commented Mar 10, 2022

Sorry forgot to read the issue template properly, here are the logs from logs/file_.log (I removed the token)

[18:37:43.228][info] [#0:/home/arno/development/codemirror-lua/server/lua-language-server/main.lua:49]: Lua Lsp startup, root: 	/home/arno/development/codemirror-lua/server/lua-language-server
[18:37:43.228][debug][#0:/home/arno/development/codemirror-lua/server/lua-language-server/main.lua:50]: ROOT:	/home/arno/development/codemirror-lua/server/lua-language-server
[18:37:43.229][debug][#0:/home/arno/development/codemirror-lua/server/lua-language-server/main.lua:51]: LOGPATH:	/home/arno/development/codemirror-lua/server/lua-language-server/log
[18:37:43.230][debug][#0:/home/arno/development/codemirror-lua/server/lua-language-server/main.lua:52]: METAPATH:	/home/arno/development/codemirror-lua/server/lua-language-server/meta
[18:37:43.230][debug][#0:/home/arno/development/codemirror-lua/server/lua-language-server/main.lua:53]: VERSION:	2.5.0-dev
[18:37:43.331][info] [#0:script/service/telemetry.lua:21]: Telemetry Token:	<TOKEN>
[18:37:43.342][info] [#0:script/pub/pub.lua:48]: Create brave:	1
[18:37:43.342][info] [#0:script/pub/pub.lua:48]: Create brave:	2
[18:37:43.342][info] [#0:script/pub/pub.lua:48]: Create brave:	3
[18:37:43.342][info] [#0:script/pub/pub.lua:48]: Create brave:	4
[18:37:43.343][debug][#0:script/service/service.lua:138]: 
========= Medical Examination Report =========
    --------------- Memory ---------------
        Total: 1.324 MB
        # 00 : 1.324 MB
        # 01 : 0.000 MB
        # 02 : 0.000 MB
        # 03 : 0.000 MB
        # 04 : 0.000 MB
    --------------- Coroutine ---------------
        Total:     0
        Running:   0
        Suspended: 0
        Normal:    0
        Dead:      0
    --------------- Cache ---------------
        Total: 1
        Dead:  0
    --------------- Proto ---------------
        Holdon:   0
        Waiting:  0
==============================================
[18:37:43.411][debug][#0:script/client.lua:344]: Client init	{
    capabilities = {
        textDocument = {
            completion = {
                completionItem = {
                    commitCharactersSupport = true,
                    deprecatedSupport = false,
                    documentationFormat = {
                        [1] = "plaintext",
                        [2] = "markdown",
                    },
                    preselectSupport = false,
                    snippetSupport = false,
                },
                contextSupport = false,
                dynamicRegistration = true,
            },
            declaration = {
                dynamicRegistration = true,
                linkSupport = true,
            },
            definition = {
                dynamicRegistration = true,
                linkSupport = true,
            },
            hover = {
                contentFormat = {
                    [1] = "plaintext",
                    [2] = "markdown",
                },
                dynamicRegistration = true,
            },
            implementation = {
                dynamicRegistration = true,
                linkSupport = true,
            },
            moniker = {
            },
            signatureHelp = {
                dynamicRegistration = true,
                signatureInformation = {
                    documentationFormat = {
                        [1] = "plaintext",
                        [2] = "markdown",
                    },
                },
            },
            synchronization = {
                didSave = false,
                dynamicRegistration = true,
                willSave = false,
                willSaveWaitUntil = false,
            },
            typeDefinition = {
                dynamicRegistration = true,
                linkSupport = true,
            },
        },
        workspace = {
            didChangeConfiguration = {
                dynamicRegistration = true,
            },
        },
    },
    processId = 3619,
    rootUri = "file:///",
    workspaceFolders = {
        [1] = {
            name = "root",
            uri = "file:///",
        },
    },
}
[18:37:43.411][info] [#0:script/language.lua:135]: VSC language: nil
[18:37:43.411][info] [#0:script/language.lua:136]: LS  language: en-us
[18:37:43.412][info] [#0:script/workspace/workspace.lua:34]: Workspace inited: 	file:///
[18:37:43.412][info] [#0:script/workspace/workspace.lua:43]: Log path: 	/home/arno/development/codemirror-lua/server/lua-language-server/log/file_.log
[18:37:43.414][debug][#0:script/provider/completion.lua:34]: Enable completion.
[18:37:43.414][debug][#0:script/provider/completion.lua:59]: Disable completion.
[18:37:43.414][debug][#0:script/provider/completion.lua:34]: Enable completion.
[18:38:43.451][debug][#0:script/service/service.lua:138]: 
========= Medical Examination Report =========
    --------------- Memory ---------------
        Total: 9.974 MB
        # 00 : 1.472 MB
        # 01 : 2.125 MB
        # 02 : 2.125 MB
        # 03 : 2.125 MB
        # 04 : 2.125 MB
    --------------- Coroutine ---------------
        Total:     3
        Running:   0
        Suspended: 3
        Normal:    0
        Dead:      0
    --------------- Cache ---------------
        Total: 1
        Dead:  0
    --------------- Proto ---------------
        Holdon:   0
        Waiting:  4
==============================================

and here log/service.log:

[18:37:43.228][info] [#0:/home/arno/development/codemirror-lua/server/lua-language-server/main.lua:49]: Lua Lsp startup, root: 	/home/arno/development/codemirror-lua/server/lua-language-server
[18:37:43.228][debug][#0:/home/arno/development/codemirror-lua/server/lua-language-server/main.lua:50]: ROOT:	/home/arno/development/codemirror-lua/server/lua-language-server
[18:37:43.229][debug][#0:/home/arno/development/codemirror-lua/server/lua-language-server/main.lua:51]: LOGPATH:	/home/arno/development/codemirror-lua/server/lua-language-server/log
[18:37:43.230][debug][#0:/home/arno/development/codemirror-lua/server/lua-language-server/main.lua:52]: METAPATH:	/home/arno/development/codemirror-lua/server/lua-language-server/meta
[18:37:43.230][debug][#0:/home/arno/development/codemirror-lua/server/lua-language-server/main.lua:53]: VERSION:	2.5.0-dev
[18:37:43.331][info] [#0:script/service/telemetry.lua:21]: Telemetry Token:	<TOKEN>
[18:37:43.342][info] [#0:script/pub/pub.lua:48]: Create brave:	1
[18:37:43.342][info] [#0:script/pub/pub.lua:48]: Create brave:	2
[18:37:43.342][info] [#0:script/pub/pub.lua:48]: Create brave:	3
[18:37:43.342][info] [#0:script/pub/pub.lua:48]: Create brave:	4
[18:37:43.343][debug][#0:script/service/service.lua:138]: 
========= Medical Examination Report =========
    --------------- Memory ---------------
        Total: 1.324 MB
        # 00 : 1.324 MB
        # 01 : 0.000 MB
        # 02 : 0.000 MB
        # 03 : 0.000 MB
        # 04 : 0.000 MB
    --------------- Coroutine ---------------
        Total:     0
        Running:   0
        Suspended: 0
        Normal:    0
        Dead:      0
    --------------- Cache ---------------
        Total: 1
        Dead:  0
    --------------- Proto ---------------
        Holdon:   0
        Waiting:  0
==============================================
[18:37:43.411][debug][#0:script/client.lua:344]: Client init	{
    capabilities = {
        textDocument = {
            completion = {
                completionItem = {
                    commitCharactersSupport = true,
                    deprecatedSupport = false,
                    documentationFormat = {
                        [1] = "plaintext",
                        [2] = "markdown",
                    },
                    preselectSupport = false,
                    snippetSupport = false,
                },
                contextSupport = false,
                dynamicRegistration = true,
            },
            declaration = {
                dynamicRegistration = true,
                linkSupport = true,
            },
            definition = {
                dynamicRegistration = true,
                linkSupport = true,
            },
            hover = {
                contentFormat = {
                    [1] = "plaintext",
                    [2] = "markdown",
                },
                dynamicRegistration = true,
            },
            implementation = {
                dynamicRegistration = true,
                linkSupport = true,
            },
            moniker = {
            },
            signatureHelp = {
                dynamicRegistration = true,
                signatureInformation = {
                    documentationFormat = {
                        [1] = "plaintext",
                        [2] = "markdown",
                    },
                },
            },
            synchronization = {
                didSave = false,
                dynamicRegistration = true,
                willSave = false,
                willSaveWaitUntil = false,
            },
            typeDefinition = {
                dynamicRegistration = true,
                linkSupport = true,
            },
        },
        workspace = {
            didChangeConfiguration = {
                dynamicRegistration = true,
            },
        },
    },
    processId = 3619,
    rootUri = "file:///",
    workspaceFolders = {
        [1] = {
            name = "root",
            uri = "file:///",
        },
    },
}
[18:37:43.411][info] [#0:script/language.lua:135]: VSC language: nil
[18:37:43.411][info] [#0:script/language.lua:136]: LS  language: en-us
[18:37:43.412][info] [#0:script/workspace/workspace.lua:34]: Workspace inited: 	file:///
[18:37:43.412][info] [#0:script/workspace/workspace.lua:43]: Log path: 	/home/arno/development/codemirror-lua/server/lua-language-server/log/file_.log

@sumneko
Copy link
Collaborator

sumneko commented Mar 10, 2022

Your version is 2.5.0-dev, please upgrade to latest (2.6.7)

EDIT:
Don't use / as your rootUri, I will scan this folder to find out lua files!
See https://github.com/sumneko/lua-language-server/wiki/Why-scanning-home-folder%3F

@arnoson
Copy link
Author

arnoson commented Mar 10, 2022

I updated to 2.6.7 and removed the rootUri but it still shows the loading message
service.log:

[19:30:18.980][info] [#0:/home/arno/development/codemirror-lua/server/lua-language-server/main.lua:61]: Lua Lsp startup, root: 	/home/arno/development/codemirror-lua/server/lua-language-server
[19:30:18.980][debug][#0:/home/arno/development/codemirror-lua/server/lua-language-server/main.lua:62]: ROOT:	/home/arno/development/codemirror-lua/server/lua-language-server
[19:30:18.980][debug][#0:/home/arno/development/codemirror-lua/server/lua-language-server/main.lua:63]: LOGPATH:	/home/arno/development/codemirror-lua/server/lua-language-server/log
[19:30:18.980][debug][#0:/home/arno/development/codemirror-lua/server/lua-language-server/main.lua:64]: METAPATH:	/home/arno/development/codemirror-lua/server/lua-language-server/meta
[19:30:18.981][debug][#0:/home/arno/development/codemirror-lua/server/lua-language-server/main.lua:65]: VERSION:	2.6.7
[19:30:19.084][info] [#0:script/service/telemetry.lua:22]: Telemetry Token:	<TOKEN>
[19:30:19.091][info] [#0:script/pub/pub.lua:48]: Create brave:	1
[19:30:19.092][info] [#0:script/pub/pub.lua:48]: Create brave:	2
[19:30:19.092][info] [#0:script/pub/pub.lua:48]: Create brave:	3
[19:30:19.093][info] [#0:script/pub/pub.lua:48]: Create brave:	4
[19:30:19.093][debug][#0:script/service/service.lua:141]: 
========= Medical Examination Report =========
    --------------- Memory ---------------
        Total: 1.352 MB
        # 00 : 1.352 MB
        # 01 : 0.000 MB
        # 02 : 0.000 MB
        # 03 : 0.000 MB
        # 04 : 0.000 MB
    --------------- Coroutine ---------------
        Total:     0
        Running:   0
        Suspended: 0
        Normal:    0
        Dead:      0
    --------------- Cache ---------------
        Total: 1
        Dead:  0
    ---------------  RPC  ---------------
        Holdon:   0
        Waiting:  0
==============================================
[19:30:19.204][debug][#0:script/client.lua:401]: Client init	{
    capabilities = {
        textDocument = {
            completion = {
                completionItem = {
                    commitCharactersSupport = true,
                    deprecatedSupport = false,
                    documentationFormat = {
                        [1] = "plaintext",
                        [2] = "markdown",
                    },
                    preselectSupport = false,
                    snippetSupport = false,
                },
                contextSupport = false,
                dynamicRegistration = true,
            },
            declaration = {
                dynamicRegistration = true,
                linkSupport = true,
            },
            definition = {
                dynamicRegistration = true,
                linkSupport = true,
            },
            hover = {
                contentFormat = {
                    [1] = "plaintext",
                    [2] = "markdown",
                },
                dynamicRegistration = true,
            },
            implementation = {
                dynamicRegistration = true,
                linkSupport = true,
            },
            moniker = {
            },
            signatureHelp = {
                dynamicRegistration = true,
                signatureInformation = {
                    documentationFormat = {
                        [1] = "plaintext",
                        [2] = "markdown",
                    },
                },
            },
            synchronization = {
                didSave = false,
                dynamicRegistration = true,
                willSave = false,
                willSaveWaitUntil = false,
            },
            typeDefinition = {
                dynamicRegistration = true,
                linkSupport = true,
            },
        },
        workspace = {
            didChangeConfiguration = {
                dynamicRegistration = true,
            },
        },
    },
    processId = 1410,
}
[19:30:19.204][info] [#0:script/language.lua:135]: VSC language: nil
[19:30:19.204][info] [#0:script/language.lua:136]: LS  language: en-us
[19:30:19.306][debug][#0:script/provider/provider.lua:234]: didOpen	file:///test.lua

Later on I want to open two or more files at the same time with codemirror so I guess I need some kind of virtual workspace uri?

@sumneko
Copy link
Collaborator

sumneko commented Mar 10, 2022

Later on I want to open two or more files at the same time with codemirror so I guess I need some kind of virtual workspace uri?

The easiest way is to put them in the same folder.

I updated to 2.6.7 and removed the rootUri but it still shows the loading message

I will test this case

@arnoson
Copy link
Author

arnoson commented Mar 10, 2022

I didn't commit yet, will do it now. Thank your for looking into this!

@sumneko
Copy link
Collaborator

sumneko commented Mar 10, 2022

Is that all you have in your log?

EDIT:
Please run the languager-server with command param --rpclog, then provide your new log.

@arnoson
Copy link
Author

arnoson commented Mar 10, 2022

Updated the example (had to manually change the code mirror language server plugin to not send the workspace)
Here is the service log with --rpclog:

[19:53:57.081][info] [#0:/home/arno/development/codemirror-lua/server/lua-language-server/main.lua:61]: Lua Lsp startup, root: 	/home/arno/development/codemirror-lua/server/lua-language-server
[19:53:57.082][debug][#0:/home/arno/development/codemirror-lua/server/lua-language-server/main.lua:62]: ROOT:	/home/arno/development/codemirror-lua/server/lua-language-server
[19:53:57.083][debug][#0:/home/arno/development/codemirror-lua/server/lua-language-server/main.lua:63]: LOGPATH:	/home/arno/development/codemirror-lua/server/lua-language-server/log
[19:53:57.083][debug][#0:/home/arno/development/codemirror-lua/server/lua-language-server/main.lua:64]: METAPATH:	/home/arno/development/codemirror-lua/server/lua-language-server/meta
[19:53:57.083][debug][#0:/home/arno/development/codemirror-lua/server/lua-language-server/main.lua:65]: VERSION:	2.6.7
[19:53:57.195][info] [#0:script/service/telemetry.lua:22]: Telemetry Token:	<TOKEN>
[19:53:57.201][info] [#0:script/pub/pub.lua:48]: Create brave:	1
[19:53:57.202][info] [#0:script/pub/pub.lua:48]: Create brave:	2
[19:53:57.202][info] [#0:script/pub/pub.lua:48]: Create brave:	3
[19:53:57.202][info] [#0:script/pub/pub.lua:48]: Create brave:	4
[19:53:57.203][debug][#0:script/service/service.lua:141]: 
========= Medical Examination Report =========
    --------------- Memory ---------------
        Total: 1.352 MB
        # 00 : 1.352 MB
        # 01 : 0.000 MB
        # 02 : 0.000 MB
        # 03 : 0.000 MB
        # 04 : 0.000 MB
    --------------- Coroutine ---------------
        Total:     0
        Running:   0
        Suspended: 0
        Normal:    0
        Dead:      0
    --------------- Cache ---------------
        Total: 1
        Dead:  0
    ---------------  RPC  ---------------
        Holdon:   0
        Waiting:  0
==============================================
[19:53:57.314][debug][#0:script/proto/proto.lua:22]: rpc recieve:	{"id":"0","jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"textDocument":{"completion":{"completionItem":{"commitCharactersSupport":true,"deprecatedSupport":false,"documentationFormat":["plaintext","markdown"],"preselectSupport":false,"snippetSupport":false},"contextSupport":false,"dynamicRegistration":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"hover":{"contentFormat":["plaintext","markdown"],"dynamicRegistration":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"moniker":[],"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["plaintext","markdown"]}},"synchronization":{"didSave":false,"dynamicRegistration":true,"willSave":false,"willSaveWaitUntil":false},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true}},"workspace":{"didChangeConfiguration":{"dynamicRegistration":true}}},"processId":4235}}
[19:53:57.315][debug][#0:script/client.lua:401]: Client init	{
    capabilities = {
        textDocument = {
            completion = {
                completionItem = {
                    commitCharactersSupport = true,
                    deprecatedSupport = false,
                    documentationFormat = {
                        [1] = "plaintext",
                        [2] = "markdown",
                    },
                    preselectSupport = false,
                    snippetSupport = false,
                },
                contextSupport = false,
                dynamicRegistration = true,
            },
            declaration = {
                dynamicRegistration = true,
                linkSupport = true,
            },
            definition = {
                dynamicRegistration = true,
                linkSupport = true,
            },
            hover = {
                contentFormat = {
                    [1] = "plaintext",
                    [2] = "markdown",
                },
                dynamicRegistration = true,
            },
            implementation = {
                dynamicRegistration = true,
                linkSupport = true,
            },
            moniker = {
            },
            signatureHelp = {
                dynamicRegistration = true,
                signatureInformation = {
                    documentationFormat = {
                        [1] = "plaintext",
                        [2] = "markdown",
                    },
                },
            },
            synchronization = {
                didSave = false,
                dynamicRegistration = true,
                willSave = false,
                willSaveWaitUntil = false,
            },
            typeDefinition = {
                dynamicRegistration = true,
                linkSupport = true,
            },
        },
        workspace = {
            didChangeConfiguration = {
                dynamicRegistration = true,
            },
        },
    },
    processId = 4235,
}
[19:53:57.316][info] [#0:script/language.lua:135]: VSC language: nil
[19:53:57.316][info] [#0:script/language.lua:136]: LS  language: en-us
[19:53:57.317][debug][#0:script/proto/proto.lua:15]: rpc send:	Content-Length: 1396

{"id":"0","jsonrpc":"2.0","result":{"capabilities":{"codeActionProvider":{"codeActionKinds":["","quickfix","refactor.rewrite","refactor.extract"],"resolveProvider":false},"completionProvider":{"resolveProvider":true,"triggerCharacters":["\t","\n",".",":","(","'","\"","[",",","#","*","@","|","=","-","{","/","\\"," ","+","?"]},"definitionProvider":true,"documentHighlightProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":"\n"},"documentSymbolProvider":true,"executeCommandProvider":{"commands":["lua.removeSpace","lua.solve","lua.jsonToLua","lua.setConfig","lua.autoRequire"]},"foldingRangeProvider":true,"hoverProvider":true,"offsetEncoding":"utf-16","referencesProvider":true,"renameProvider":{"prepareProvider":true},"semanticTokensProvider":{"full":true,"legend":{"tokenModifiers":["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"],"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","method","macro","keyword","modifier","comment","string","number","regexp","operator"]},"range":true},"signatureHelpProvider":{"triggerCharacters":["(",","]},"textDocumentSync":{"change":2,"openClose":true},"typeDefinitionProvider":true,"workspaceSymbolProvider":true},"serverInfo":{"name":"sumneko.lua"}}}
[19:53:57.323][debug][#0:script/proto/proto.lua:15]: rpc send:	Content-Length: 120

{"jsonrpc":"2.0","method":"$/status/report","params":{"text":"😺Lua","tooltip":"Cached files: 0/0\nMemory usage: 2M"}}
[19:53:57.424][debug][#0:script/proto/proto.lua:22]: rpc recieve:	{"jsonrpc":"2.0","method":"initialized","params":[]}
[19:53:57.425][debug][#0:script/proto/proto.lua:15]: rpc send:	Content-Length: 254

{"id":1,"jsonrpc":"2.0","method":"workspace/configuration","params":{"items":[{"section":"Lua"},{"section":"files.associations"},{"section":"files.exclude"},{"section":"editor.semanticHighlighting.enabled"},{"section":"editor.acceptSuggestionOnEnter"}]}}
[19:53:57.425][debug][#0:script/proto/proto.lua:22]: rpc recieve:	{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"lua","text":"function hello() print(\"hey!\") end","uri":"file:///test.lua","version":0}}}
[19:53:57.426][debug][#0:script/provider/provider.lua:234]: didOpen	file:///test.lua
[19:53:59.276][debug][#0:script/proto/proto.lua:15]: rpc send:	Content-Length: 87

{"id":2,"jsonrpc":"2.0","method":"window/workDoneProgress/create","params":{"token":1}}
[19:53:59.277][debug][#0:script/proto/proto.lua:15]: rpc send:	Content-Length: 146

{"jsonrpc":"2.0","method":"$/progress","params":{"token":1,"value":{"cancellable":false,"kind":"begin","percentage":0,"title":"Initializing..."}}}
[19:53:59.981][debug][#0:script/proto/proto.lua:22]: rpc recieve:	{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"function hello() print(\"hey!\") end"}],"textDocument":{"uri":"file:///test.lua","version":0}}}
[19:53:59.981][debug][#0:script/proto/proto.lua:22]: rpc recieve:	{"id":"4","jsonrpc":"2.0","method":"textDocument/hover","params":{"position":{"character":20,"line":0},"textDocument":{"uri":"file:///test.lua"}}}
[19:53:59.982][debug][#0:script/proto/proto.lua:15]: rpc send:	Content-Length: 103

{"id":"4","jsonrpc":"2.0","result":{"contents":{"kind":"markdown","value":"Workspace loading: 0 / 0"}}}
[19:54:01.678][debug][#0:script/proto/proto.lua:22]: rpc recieve:	{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"function hello() print(\"hey!\") end"}],"textDocument":{"uri":"file:///test.lua","version":1}}}
[19:54:01.679][debug][#0:script/proto/proto.lua:22]: rpc recieve:	{"id":"6","jsonrpc":"2.0","method":"textDocument/hover","params":{"position":{"character":3,"line":0},"textDocument":{"uri":"file:///test.lua"}}}
[19:54:01.679][debug][#0:script/proto/proto.lua:15]: rpc send:	Content-Length: 103

{"id":"6","jsonrpc":"2.0","result":{"contents":{"kind":"markdown","value":"Workspace loading: 0 / 0"}}}
[19:54:02.717][debug][#0:script/proto/proto.lua:22]: rpc recieve:	{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"function hello() print(\"hey!\") end"}],"textDocument":{"uri":"file:///test.lua","version":2}}}
[19:54:02.819][debug][#0:script/proto/proto.lua:22]: rpc recieve:	{"id":"8","jsonrpc":"2.0","method":"textDocument/hover","params":{"position":{"character":9,"line":0},"textDocument":{"uri":"file:///test.lua"}}}
[19:54:02.820][debug][#0:script/proto/proto.lua:15]: rpc send:	Content-Length: 103

{"id":"8","jsonrpc":"2.0","result":{"contents":{"kind":"markdown","value":"Workspace loading: 0 / 0"}}}

Edit: The example is linux only as I couldn't find a release with all OS binaries together.

@sumneko
Copy link
Collaborator

sumneko commented Mar 10, 2022

Thanks for your test, it seems that the server send the request of workspace/configuration to client, but client never responsed it.
This caused the server to keep waiting for the response.

@arnoson
Copy link
Author

arnoson commented Mar 10, 2022

I just looked up what the monaco language server plugin does differently and it seems it is just answering with empty results:
{"id":10,"jsonrpc":"2.0","method":"workspace/configuration","params": ...
{"jsonrpc":"2.0","id":10,"result":[null,null,null,null,null]}
So I guess in order to get this to work code mirrors plugin should behave similary.
Thank you for your time! I'll try to fix this on the plugin

@sumneko
Copy link
Collaborator

sumneko commented Mar 10, 2022

https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#requestMessage

It says:

A request message to describe a request between the client and the server. Every processed request must send a response back to the sender of the request.

So the client could answering empty results (or anything else), but the client should not silent.

@arnoson
Copy link
Author

arnoson commented Mar 10, 2022

It is finally working! Indeed the client didn't answer any requests, so simply replying with null did the trick. Thank you so much for your help!

@kubakakauko
Copy link

kubakakauko commented Jul 14, 2023

If anyone came here looking for a solution with this being an issue in Neovide. I added this to my init.lua config and it's gone.

local on_attach = require("plugins.configs.lspconfig").on_attach
local capabilities = require("plugins.configs.lspconfig").capabilities

local lspconfig = require "lspconfig"

lspconfig.lua_ls.setup {
  on_attach = on_attach,
  capabilities = capabilities,
  settings = {
    Lua = {
      diagnostics = {
        globals = { "vim" },
      },
      workspace = {
        library = {
          [vim.fn.expand "$VIMRUNTIME/lua"] = true,
          [vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
        },
      },
    },
  },
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants