LuaLS / LuaLS/lua-language-server

Not loading .luarc.json when using vscode or vim-lsp

Ouverte
#2,185 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Info Needed
Langage dominant
Lua
Étoiles
4.4k
Forks
442
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

### How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

### Which OS are you using?

Windows

### What is the issue affecting?

Diagnostics/Syntax Checking

### Expected Behaviour

When I add a `.luarc.json` file next to my vscode `.code-workspace` file, the values from my `.luarc.json` can control the configuration of lua-ls.

### Actual Behaviour

The `.luarc.json` file is ignored in both vscode (v1.79.2) and gvim (9.0.1626).

### Reproduction steps

1. Create a `.luarc.json` and disable lowercase-global
2. Open a file with a lowercase global in vscode or gvim
3. See error `[sumneko-lua-language-server] Lua Diagnostics.:Information:lowercase-global:Global variable in lowercase initial.`

Following the format in the project's [`.luarc.json` file](https://github.com/LuaLS/lua-language-server/blob/master/.luarc.json) and the instructions on [the wiki](https://github.com/LuaLS/lua-language-server/wiki/Configuration-File#luarcjson). (Possibly those instructions aren't clear enough and there's something I'm setting up incorrectly.)

### Additional Notes

Here's the contents of my entire repro project (`find . -type f -exec head -n10000 {} +`):

```
==> ./data/.luarc.json <==
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"diagnostics": {
"disable": [
"lowercase-global"
]
},
"runtime": {
"version": "Lua 5.4",
"path": [
"script/?.lua",
"script/?/init.lua",
"test/?.lua",
"test/?/init.lua",
"script/meta/?.lua"
],
"pathStrict": true
}
}

==> ./data/proj.code-workspace <==
{
"folders": [
{
"path": "scripts"
}
],
"settings": {
"debug.allowBreakpointsEverywhere": true
},
"extensions": {
"recommendations": [
"dwenegar.vscode-luacheck",
"sumneko.lua"
]
},
}

==> ./data/scripts/file.lua <==
okayglobal = 10

print(okayglobal)
```

### Log File

Log file from using gvim with prabirshrestha/vim-lsp and mattn/vim-lsp-settings:
~[file_C_code_project_data_scripts.log](https://github.com/LuaLS/lua-language-server/files/11886742/file_C_code_project_data_scripts.log)~ oops, from changelog.md, it looks like that gvim lua-ls version is 1.8.1.

Updated lsp (`:LspInstallServer sumneko-lua-language-server`) and changelog.md now says 3.0.0. Here's the log for that: [file_C_code_project_data_scripts.log](https://github.com/LuaLS/lua-language-server/files/11886953/file_C_code_project_data_scripts.log)

I tried to get the vscode log, but there was no log folder in `%homepath%\.vscode\extensions\sumneko.lua-3.2.3\server` and there were no other sumneko or lua-ls folders in `extensions/`. My vscode lua-ls version is v3.6.22.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Reproduire le rapport avec la configuration fournie de data/.luarc.json, data/proj.code-workspace et data/scripts/file.lua dans VS Code ou gvim. Vérifier si la configuration adjacente à l’espace de travail est détectée et appliquée aux diagnostics Lua ; la tâche est terminée lorsque la désactivation de lowercase-global supprime le diagnostic signalé dans la configuration du client indiquée.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
lua, vscode
Domaine
devtools
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.