LuaLS / LuaLS/lua-language-server

Adding a new workspace folder breaks things

Aberta
#1,974 10 comentários 2 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

bug Info Needed
Linguagem predominante
Lua
Estrelas
4.4k
Forks
442
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

How are you using the lua-language-server?

NeoVim

Which OS are you using?

Windows

What is the issue affecting?

Completion, Diagnostics/Syntax Checking, Hover, Libraries

Expected Behaviour

Addding new workspace folders should not break anything.

Actual Behaviour

Right now, adding a new workspace folder breaks two things, diagnostics and require statements:

  • You can fix the diagnostic errors by hooking to the workspace/diagnostic/refresh handler to manually refresh it, but even then this is very unreliable and prone to not working:
    https://github.com/neovim/nvim-lspconfig/issues/2366

  • require statements that refers to modules in the new workspace folder also does not resolve correctly (hovering over the module string will display the byte length, instead of the resolved path). This means that completions from the required module will also be missing. So far I can't find any way to fix this without restarting neovim entirely.

Other LSP servers doesn't have this problem. Adding a new workspace folder should just work without any additional steps.

Reproduction steps
  1. Initialize the LSP server with a root directory
  2. Add a new workspace folder using workspace/didChangeWorkspaceFolders
  3. Opening a file from that workspace folder results in diagnostic errors and modules not being resolved correctly
Additional Notes

No response

Log File

No response

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Direção de pesquisa

Comece reproduzindo a sequência relatada: inicialize com um diretório raiz, envie workspace/didChangeWorkspaceFolders e abra um arquivo na pasta adicionada. Investigue como workspace/diagnostic/refresh e a resolução de módulos require se comportam depois disso. O trabalho estará concluído quando diagnósticos, caminhos exibidos ao passar o mouse e conclusões funcionarem no novo workspace sem reiniciar o Neovim nem depender de atualizações manuais.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
lua, neovim
Domínio
devtools
Tipo de issue
Bug
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.