-
Notifications
You must be signed in to change notification settings - Fork 3
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
¿Cómo se ejecuta el LSP para otros editores? #163
Comments
Hola, estuve leyendo el código y no llego a ver dónde se carga un archivo de configuración. Veo que detecta cambios en los archivos Para ser claro, el LSP debería poder ejecutarse en una terminal independientemente del editor, y luego un cliente se conecta y comienza a comunicarse con él. No he tenido problemas con otros LSP, y no estoy seguro si estoy haciendo algo mal, o si fue diseñado para uso exclusivo con VSCode. |
Hola, Yendo a tu pregunta puntual,
|
Perfecto, revisaré por mi cuenta entonces como hacerlo y si se necesita hacer alguna modificación al código hago una contribución. Saludos. |
@tralph3 Llegaste a algún lado con esto? Yo estuve haciendo unas pruebas para implementar un plugin de NeoVim pero el LSP me responde |
Hice algunas pruebas. Parece que el server intenta registrar capacidades que el cliente no soporta. Conseguí establecer una conexión sin que se muera el server, pero no funciona, el cliente envía requests y el server no las responde. El primer fallo que tiene es acá. Esa línea tira un error que es el que publiqué en el primer mensaje:
Si se comenta o se quita, el server sigue sin aparente problema. Luego el cliente se queja de que intenta registrar didChangeWorkspaceFolders. Para hacer pruebas, establecí el valor de esta variable a Con esto, el cliente se queja una vez más de que el server intenta registrar una capacidad no soportada que es didChangeConfigurationNotification. Se hace acá. Nuevamente, borrando la línea, se continúa. Con esto, el cliente se puede conectar al server, y envía requests, pero como dije antes no responde. Se queda haciendo nada. No estoy seguro de como solucionar esto. Si alguien tiene experiencia con el protocolo le agradecería una mano. Para ejecutar el server primero hago
|
Las issues están para esto. |
¿Podrías pasar tu configuración de NeoVim para el server? |
function()
vim.lsp.start_client({
name = "wollok-lsp",
cmd = { "node", "path_al_server_js", "--stdio" },
workspace_folders = {
{
uri = "file:path_al_dir_de_prueba", -- esto parece no estar funcionando por ahora... es lo que tuve que hardcodear en el server
name = "cwd",
},
},
-- before_init = function(params)
-- local file = io.open("wollok_req.log", "w")
-- io.output(file)
-- io.write(dump(params))
-- end,
on_init = function(client, params)
-- local file = io.open("wollok_res.log", "w")
-- io.output(file)
-- io.write(dump(params))
vim.lsp.buf_attach_client(0, client.id)
end,
})
end
Eso es todo para iniciar el server y conectarlo al buffer actual, después hay otras cosas para hacer el coloreado de sintaxis Estos son los parametros que envia por detras {
["rootUri"] = file:path_de_prueba,
["capabilities"] = {
["window"] = {
["workDoneProgress"] = true,
["showMessage"] = {
["messageActionItem"] = {
["additionalPropertiesSupport"] = false,
},
},
["showDocument"] = {
["support"] = true,
},
},
["textDocument"] = {
["implementation"] = {
["linkSupport"] = true,
},
["typeDefinition"] = {
["linkSupport"] = true,
},
["callHierarchy"] = {
["dynamicRegistration"] = false,
},
["signatureHelp"] = {
["dynamicRegistration"] = false,
["signatureInformation"] = {
["documentationFormat"] = {
[1] = markdown,
[2] = plaintext,
},
["activeParameterSupport"] = true,
["parameterInformation"] = {
["labelOffsetSupport"] = true,
},
},
},
["documentSymbol"] = {
["hierarchicalDocumentSymbolSupport"] = true,
["dynamicRegistration"] = false,
["symbolKind"] = {
["valueSet"] = {
[1] = 1,
[2] = 2,
[3] = 3,
[4] = 4,
[5] = 5,
[6] = 6,
[7] = 7,
[8] = 8,
[9] = 9,
[10] = 10,
[11] = 11,
[12] = 12,
[13] = 13,
[14] = 14,
[15] = 15,
[16] = 16,
[17] = 17,
[18] = 18,
[19] = 19,
[20] = 20,
[21] = 21,
[22] = 22,
[23] = 23,
[24] = 24,
[25] = 25,
[26] = 26,
},
},
},
["semanticTokens"] = {
["requests"] = {
["full"] = {
["delta"] = true,
},
["range"] = false,
},
["formats"] = {
[1] = relative,
},
["dynamicRegistration"] = false,
["overlappingTokenSupport"] = true,
["multilineTokenSupport"] = false,
["tokenModifiers"] = {
[1] = declaration,
[2] = definition,
[3] = readonly,
[4] = static,
[5] = deprecated,
[6] = abstract,
[7] = async,
[8] = modification,
[9] = documentation,
[10] = defaultLibrary,
},
["augmentsSyntaxTokens"] = true,
["tokenTypes"] = {
[1] = namespace,
[2] = type,
[3] = class,
[4] = enum,
[5] = interface,
[6] = struct,
[7] = typeParameter,
[8] = parameter,
[9] = variable,
[10] = property,
[11] = enumMember,
[12] = event,
[13] = function,
[14] = method,
[15] = macro,
[16] = keyword,
[17] = modifier,
[18] = comment,
[19] = string,
[20] = number,
[21] = regexp,
[22] = operator,
[23] = decorator,
},
["serverCancelSupport"] = false,
},
["completion"] = {
["contextSupport"] = false,
["completionItemKind"] = {
["valueSet"] = {
[1] = 1,
[2] = 2,
[3] = 3,
[4] = 4,
[5] = 5,
[6] = 6,
[7] = 7,
[8] = 8,
[9] = 9,
[10] = 10,
[11] = 11,
[12] = 12,
[13] = 13,
[14] = 14,
[15] = 15,
[16] = 16,
[17] = 17,
[18] = 18,
[19] = 19,
[20] = 20,
[21] = 21,
[22] = 22,
[23] = 23,
[24] = 24,
[25] = 25,
},
},
["dynamicRegistration"] = false,
["completionItem"] = {
["snippetSupport"] = false,
["commitCharactersSupport"] = false,
["preselectSupport"] = false,
["deprecatedSupport"] = false,
["documentationFormat"] = {
[1] = markdown,
[2] = plaintext,
},
},
},
["rename"] = {
["dynamicRegistration"] = false,
["prepareSupport"] = true,
},
["references"] = {
["dynamicRegistration"] = false,
},
["documentHighlight"] = {
["dynamicRegistration"] = false,
},
["declaration"] = {
["linkSupport"] = true,
},
["synchronization"] = {
["didSave"] = true,
["willSaveWaitUntil"] = true,
["dynamicRegistration"] = false,
["willSave"] = true,
},
["hover"] = {
["dynamicRegistration"] = false,
["contentFormat"] = {
[1] = markdown,
[2] = plaintext,
},
},
["codeAction"] = {
["isPreferredSupport"] = true,
["dataSupport"] = true,
["resolveSupport"] = {
["properties"] = {
[1] = edit,
},
},
["codeActionLiteralSupport"] = {
["codeActionKind"] = {
["valueSet"] = {
[1] = ,
[2] = quickfix,
[3] = refactor,
[4] = refactor.extract,
[5] = refactor.inline,
[6] = refactor.rewrite,
[7] = source,
[8] = source.organizeImports,
},
},
},
["dynamicRegistration"] = false,
},
["publishDiagnostics"] = {
["tagSupport"] = {
["valueSet"] = {
[1] = 1,
[2] = 2,
},
},
["relatedInformation"] = true,
},
["definition"] = {
["linkSupport"] = true,
},
},
["workspace"] = {
["symbol"] = {
["hierarchicalWorkspaceSymbolSupport"] = true,
["dynamicRegistration"] = false,
["symbolKind"] = {
["valueSet"] = {
[1] = 1,
[2] = 2,
[3] = 3,
[4] = 4,
[5] = 5,
[6] = 6,
[7] = 7,
[8] = 8,
[9] = 9,
[10] = 10,
[11] = 11,
[12] = 12,
[13] = 13,
[14] = 14,
[15] = 15,
[16] = 16,
[17] = 17,
[18] = 18,
[19] = 19,
[20] = 20,
[21] = 21,
[22] = 22,
[23] = 23,
[24] = 24,
[25] = 25,
[26] = 26,
},
},
},
["didChangeWatchedFiles"] = {
["dynamicRegistration"] = false,
["relativePatternSupport"] = true,
},
["semanticTokens"] = {
["refreshSupport"] = true,
},
["configuration"] = true,
["applyEdit"] = true,
["workspaceFolders"] = true,
["workspaceEdit"] = {
["resourceOperations"] = {
[1] = rename,
[2] = create,
[3] = delete,
},
},
},
},
["trace"] = off,
["workspaceFolders"] = {
[1] = {
["uri"] = file:path_de_prueba,
["name"] = cwd,
},
},
["rootPath"] = path_de_prueba,
["processId"] = 15298,
["clientInfo"] = {
["version"] = 0.9.5,
["name"] = Neovim,
},
}
|
Quisiera saber si hay algún ejecutable que me permita correr el servidor por separado de VSCode para uso en otros editores.
Compilé el proyecto con node, y probé ejecutar el archivo
server.js
con la flag--stdio
. Eso parece funcionar, pero cuando intento usarlo con mi cliente de LSP (eglot) tira el siguiente error y falla instantáneamente:Eglot también se queja de lo siguiente:
El comando que estoy utilizando para ejecutar el server es
node /home/tralph3/Downloads/extension/server/out/server.js --stdio
. Está tirado en mi directorio de descargas porque estoy haciendo pruebas.¿Estoy haciendo algo mal? Gracias.
The text was updated successfully, but these errors were encountered: