LuaLS / LuaLS/lua-language-server

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

Aperta
#2,185 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Info Needed
Lingua principale
Lua
Stelle
4.4k
Fork
442
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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 and the instructions on the wiki. (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 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

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Riprodurre il report con la configurazione fornita di data/.luarc.json, data/proj.code-workspace e data/scripts/file.lua in VS Code o gvim. Verificare se la configurazione adiacente all'area di lavoro viene rilevata e applicata alla diagnostica Lua; il lavoro è completato quando la disabilitazione di lowercase-global sopprime la diagnostica riportata nella configurazione client indicata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
lua, vscode
Ambito
devtools
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.