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

lua-language-server --check foo.lua not working since version 3.8.0 #2989

Open
ColinKennedy opened this issue Dec 12, 2024 · 2 comments
Open

Comments

@ColinKennedy
Copy link

ColinKennedy commented Dec 12, 2024

How are you using the lua-language-server?

Command Line

Which OS are you using?

Windows WSL

What is the issue affecting?

Annotations, Type Checking

Expected Behaviour

lua-language-server --check reproduction.lua should error if there is an issue. For example in this file

reproduction.lua

---@class Foo
---@field bar asdfasfsdf_does_not_exist_is_not_defined

The asdfasfsdf_does_not_exist_is_not_defined type does not exist

Actual Behaviour

The command reports Diagnosis completed, no problems found

Reproduction steps

Last Working Version

git checkout 3.7.4
./make.sh
(cd ~/temp && lua-language-server --check --check reproduction.lua)

This errors as expected with Diagnosis complete, 1 problems found, see {root}/lua-language-server/log/check.json message

Broken

git checkout 3.8.0
./make.sh
(cd ~/temp && lua-language-server --check --check reproduction.lua)
git checkout 3.13.3
./make.sh
(cd ~/temp && lua-language-server --check --check reproduction.lua)

In both cases the report says Diagnosis completed, no problems found, instead of erroring as expected.

Additional Notes

It seems a lot changed between 3.7.4 and 3.8.0. Maybe the expectations / interface --check are different now? It's a bit hard to find info online

Log File

3.7.4

check.json
{
    "file:///home/selecaoone/temp/annotation_tes/annotation_type_test.lua": [
        {
            "code": "undefined-doc-name",
            "message": "Undefined type or alias `asdfasfsdf_does_not_exist_is_not_defined`.",
            "range": {
                "end": {
                    "character": 57,
                    "line": 1
                },
                "start": {
                    "character": 17,
                    "line": 1
                }
            },
            "severity": 2,
            "source": "Lua Diagnostics."
        }
    ]
}

3.13.4

service.log
[11:36:12.752][info] [#0:/home/selecaoone/repositories/lua-language-server/main.lua:68]: Lua Lsp startup, root: 	/home/selecaoone/repositories/lua-language-server
[11:36:12.752][info] [#0:/home/selecaoone/repositories/lua-language-server/main.lua:69]: ROOT:	/home/selecaoone/repositories/lua-language-server
[11:36:12.752][info] [#0:/home/selecaoone/repositories/lua-language-server/main.lua:70]: LOGPATH:	/home/selecaoone/repositories/lua-language-server/log
[11:36:12.752][info] [#0:/home/selecaoone/repositories/lua-language-server/main.lua:71]: METAPATH:	/home/selecaoone/repositories/lua-language-server/meta
[11:36:12.752][info] [#0:/home/selecaoone/repositories/lua-language-server/main.lua:72]: VERSION:	3.13.3-dev
[11:36:12.793][info] [#0:script/language.lua:137]: VSC language: nil
[11:36:12.794][info] [#0:script/language.lua:138]: LS  language: en-us
[11:36:12.794][info] [#0:script/client.lua:657]: Client init	{
  capabilities = {
    textDocument = {
      completion = {
        completionItem = {
          tagSupport = {
            valueSet = { 1, 2 }
          }
        }
      }
    },
    workspace = {
      configuration = true
    }
  },
  initializationOptions = {
    changeConfiguration = true,
    trustByClient = true,
    useSemanticByRange = true,
    viewDocument = true
  },
  rootUri = "file:///home/selecaoone/temp/annotation_tes/annotation_type_test.lua"
}
[11:36:12.794][info] [#0:script/language.lua:137]: VSC language: nil
[11:36:12.794][info] [#0:script/language.lua:138]: LS  language: en-us
[11:36:12.794][info] [#0:script/workspace/workspace.lua:38]: Workspace init root: 	file:///home/selecaoone/temp/annotation_tes/annotation_type_test.lua
[11:36:12.794][info] [#0:script/workspace/workspace.lua:42]: Log path: 	/home/selecaoone/repositories/lua-language-server/log/file_home_selecaoone_temp_annotation_tes_annotation_type_test.lua.log
/home/selecaoone/repositories/lua-language-server/log/file_home_selecaoone_temp_annotation_tes_annotation_type_test.lua.log
[11:36:12.752][info] [#0:/home/selecaoone/repositories/lua-language-server/main.lua:68]: Lua Lsp startup, root: 	/home/selecaoone/repositories/lua-language-server
[11:36:12.752][info] [#0:/home/selecaoone/repositories/lua-language-server/main.lua:69]: ROOT:	/home/selecaoone/repositories/lua-language-server
[11:36:12.752][info] [#0:/home/selecaoone/repositories/lua-language-server/main.lua:70]: LOGPATH:	/home/selecaoone/repositories/lua-language-server/log
[11:36:12.752][info] [#0:/home/selecaoone/repositories/lua-language-server/main.lua:71]: METAPATH:	/home/selecaoone/repositories/lua-language-server/meta
[11:36:12.752][info] [#0:/home/selecaoone/repositories/lua-language-server/main.lua:72]: VERSION:	3.13.3-dev
[11:36:12.793][info] [#0:script/language.lua:137]: VSC language: nil
[11:36:12.794][info] [#0:script/language.lua:138]: LS  language: en-us
[11:36:12.794][info] [#0:script/client.lua:657]: Client init	{
  capabilities = {
    textDocument = {
      completion = {
        completionItem = {
          tagSupport = {
            valueSet = { 1, 2 }
          }
        }
      }
    },
    workspace = {
      configuration = true
    }
  },
  initializationOptions = {
    changeConfiguration = true,
    trustByClient = true,
    useSemanticByRange = true,
    viewDocument = true
  },
  rootUri = "file:///home/selecaoone/temp/annotation_tes/annotation_type_test.lua"
}
[11:36:12.794][info] [#0:script/language.lua:137]: VSC language: nil
[11:36:12.794][info] [#0:script/language.lua:138]: LS  language: en-us
[11:36:12.794][info] [#0:script/workspace/workspace.lua:38]: Workspace init root: 	file:///home/selecaoone/temp/annotation_tes/annotation_type_test.lua
[11:36:12.794][info] [#0:script/workspace/workspace.lua:42]: Log path: 	/home/selecaoone/repositories/lua-language-server/log/file_home_selecaoone_temp_annotation_tes_annotation_type_test.lua.log
[11:36:12.794][info] [#0:script/workspace/workspace.lua:48]: Workspace create: 	file:///home/selecaoone/temp/annotation_tes/annotation_type_test.lua
[11:36:12.795][warn] [#0:script/config/loader.lua:116]: No config?	nil
[11:36:12.796][warn] [#0:script/config/loader.lua:116]: No config?	nil
[11:36:12.796][info] [#0:script/provider/provider.lua:64]: Load config from client	fallback
[11:36:12.796][info] [#0:script/provider/provider.lua:65]: nil
[11:36:12.796][info] [#0:script/library.lua:212]: Init builtin library at:	file:///home/selecaoone/temp/annotation_tes/annotation_type_test.lua
[11:36:12.828][info] [#0:script/library.lua:212]: Init builtin library at:	nil
[11:36:12.845][warn] [#0:script/config/loader.lua:116]: No config?	nil
[11:36:12.845][warn] [#0:script/config/loader.lua:116]: No config?	nil
[11:36:12.846][info] [#0:script/provider/provider.lua:64]: Load config from client	fallback
[11:36:12.846][info] [#0:script/provider/provider.lua:65]: nil
[11:36:12.846][info] [#0:script/workspace/workspace.lua:324]: Preload start:	file:///home/selecaoone/temp/annotation_tes/annotation_type_test.lua
[11:36:12.851][info] [#0:script/workspace/workspace.lua:330]: Scan files at:	file:///home/selecaoone/temp/annotation_tes/annotation_type_test.lua
[11:36:12.851][info] [#0:script/workspace/workspace.lua:353]: Scan library at:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/table.lua
[11:36:12.851][info] [#0:script/workspace/workspace.lua:353]: Scan library at:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/os.lua
[11:36:12.851][info] [#0:script/workspace/workspace.lua:353]: Scan library at:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/package.lua
[11:36:12.851][info] [#0:script/workspace/workspace.lua:353]: Scan library at:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/basic.lua
[11:36:12.851][info] [#0:script/workspace/workspace.lua:353]: Scan library at:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/io.lua
[11:36:12.852][info] [#0:script/workspace/workspace.lua:353]: Scan library at:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/string.lua
[11:36:12.852][info] [#0:script/workspace/workspace.lua:353]: Scan library at:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/builtin.lua
[11:36:12.852][info] [#0:script/workspace/workspace.lua:353]: Scan library at:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/math.lua
[11:36:12.852][info] [#0:script/workspace/workspace.lua:353]: Scan library at:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/debug.lua
[11:36:12.852][info] [#0:script/workspace/workspace.lua:353]: Scan library at:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/utf8.lua
[11:36:12.852][info] [#0:script/workspace/workspace.lua:353]: Scan library at:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/coroutine.lua
[11:36:12.852][info] [#0:script/workspace/workspace.lua:324]: Preload start:	<fallback>
[11:36:12.855][info] [#0:script/workspace/workspace.lua:353]: Scan library at:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/table.lua
[11:36:12.855][info] [#0:script/workspace/workspace.lua:353]: Scan library at:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/os.lua
[11:36:12.855][info] [#0:script/workspace/workspace.lua:353]: Scan library at:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/package.lua
[11:36:12.855][info] [#0:script/workspace/workspace.lua:353]: Scan library at:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/basic.lua
[11:36:12.855][info] [#0:script/workspace/workspace.lua:353]: Scan library at:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/io.lua
[11:36:12.855][info] [#0:script/workspace/workspace.lua:353]: Scan library at:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/string.lua
[11:36:12.855][info] [#0:script/workspace/workspace.lua:353]: Scan library at:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/builtin.lua
[11:36:12.856][info] [#0:script/workspace/workspace.lua:353]: Scan library at:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/math.lua
[11:36:12.856][info] [#0:script/workspace/workspace.lua:353]: Scan library at:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/debug.lua
[11:36:12.856][info] [#0:script/workspace/workspace.lua:353]: Scan library at:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/utf8.lua
[11:36:12.856][info] [#0:script/workspace/workspace.lua:353]: Scan library at:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/coroutine.lua
[11:36:12.856][info] [#0:script/workspace/workspace.lua:379]: Found 12 files at:	file:///home/selecaoone/temp/annotation_tes/annotation_type_test.lua
[11:36:12.856][info] [#0:script/workspace/loading.lua:160]: Load files from disk:	file:///home/selecaoone/temp/annotation_tes/annotation_type_test.lua
[11:36:12.856][info] [#0:script/workspace/loading.lua:100]: Preload file at: file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/coroutine.lua , size = 2.669 KB
[11:36:12.859][info] [#0:script/workspace/loading.lua:112]: ++++As library of:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/coroutine.lua
[11:36:12.859][info] [#0:script/workspace/loading.lua:100]: Preload file at: file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/utf8.lua , size = 2.447 KB
[11:36:12.862][info] [#0:script/workspace/loading.lua:112]: ++++As library of:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/utf8.lua
[11:36:12.862][info] [#0:script/workspace/loading.lua:100]: Preload file at: file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/debug.lua , size = 7.812 KB
[11:36:12.871][info] [#0:script/workspace/loading.lua:112]: ++++As library of:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/debug.lua
[11:36:12.871][info] [#0:script/workspace/loading.lua:100]: Preload file at: file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/math.lua , size = 8.825 KB
[11:36:12.879][info] [#0:script/workspace/loading.lua:112]: ++++As library of:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/math.lua
[11:36:12.879][info] [#0:script/workspace/loading.lua:100]: Preload file at: file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/builtin.lua , size = 0.302 KB
[11:36:12.880][info] [#0:script/workspace/loading.lua:112]: ++++As library of:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/builtin.lua
[11:36:12.880][info] [#0:script/workspace/loading.lua:100]: Preload file at: file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/string.lua , size = 6.547 KB
[11:36:12.887][info] [#0:script/workspace/loading.lua:112]: ++++As library of:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/string.lua
[11:36:12.887][info] [#0:script/workspace/loading.lua:100]: Preload file at: file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/io.lua , size = 6.566 KB
[11:36:12.893][info] [#0:script/workspace/loading.lua:112]: ++++As library of:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/io.lua
[11:36:12.893][info] [#0:script/workspace/loading.lua:100]: Preload file at: file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/basic.lua , size = 16.192 KB
[11:36:12.905][info] [#0:script/workspace/loading.lua:112]: ++++As library of:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/basic.lua
[11:36:12.905][info] [#0:script/workspace/loading.lua:100]: Preload file at: file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/package.lua , size = 3.050 KB
[11:36:12.911][info] [#0:script/workspace/loading.lua:112]: ++++As library of:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/package.lua
[11:36:12.911][info] [#0:script/workspace/loading.lua:100]: Preload file at: file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/os.lua , size = 5.863 KB
[11:36:12.915][info] [#0:script/workspace/loading.lua:112]: ++++As library of:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/os.lua
[11:36:12.915][info] [#0:script/workspace/loading.lua:100]: Preload file at: file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/table.lua , size = 4.551 KB
[11:36:12.919][info] [#0:script/workspace/loading.lua:112]: ++++As library of:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/table.lua
[11:36:12.920][info] [#0:script/workspace/loading.lua:100]: Preload file at: file:///home/selecaoone/temp/annotation_tes/annotation_type_test.lua , size = 0.070 KB
[11:36:12.920][info] [#0:script/workspace/loading.lua:172]: Loaded files takes [0.064] sec: file:///home/selecaoone/temp/annotation_tes/annotation_type_test.lua
[11:36:12.920][info] [#0:script/workspace/loading.lua:181]: Compile files takes [0.000] sec: file:///home/selecaoone/temp/annotation_tes/annotation_type_test.lua
[11:36:12.920][info] [#0:script/workspace/loading.lua:182]: Loaded finish:	file:///home/selecaoone/temp/annotation_tes/annotation_type_test.lua
[11:36:12.920][info] [#0:script/workspace/workspace.lua:381]: Preload finish at:	file:///home/selecaoone/temp/annotation_tes/annotation_type_test.lua
[11:36:12.924][info] [#0:script/workspace/workspace.lua:379]: Found 11 files at:	<fallback>
[11:36:12.924][info] [#0:script/workspace/loading.lua:160]: Load files from disk:	<fallback>
[11:36:12.924][info] [#0:script/workspace/loading.lua:88]: Skip loaded file: file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/coroutine.lua
[11:36:12.924][info] [#0:script/workspace/loading.lua:112]: ++++As library of:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/coroutine.lua
[11:36:12.924][info] [#0:script/workspace/loading.lua:88]: Skip loaded file: file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/utf8.lua
[11:36:12.924][info] [#0:script/workspace/loading.lua:112]: ++++As library of:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/utf8.lua
[11:36:12.924][info] [#0:script/workspace/loading.lua:88]: Skip loaded file: file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/debug.lua
[11:36:12.924][info] [#0:script/workspace/loading.lua:112]: ++++As library of:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/debug.lua
[11:36:12.924][info] [#0:script/workspace/loading.lua:88]: Skip loaded file: file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/math.lua
[11:36:12.924][info] [#0:script/workspace/loading.lua:112]: ++++As library of:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/math.lua
[11:36:12.924][info] [#0:script/workspace/loading.lua:88]: Skip loaded file: file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/builtin.lua
[11:36:12.924][info] [#0:script/workspace/loading.lua:112]: ++++As library of:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/builtin.lua
[11:36:12.924][info] [#0:script/workspace/loading.lua:88]: Skip loaded file: file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/string.lua
[11:36:12.924][info] [#0:script/workspace/loading.lua:112]: ++++As library of:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/string.lua
[11:36:12.924][info] [#0:script/workspace/loading.lua:88]: Skip loaded file: file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/io.lua
[11:36:12.924][info] [#0:script/workspace/loading.lua:112]: ++++As library of:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/io.lua
[11:36:12.924][info] [#0:script/workspace/loading.lua:88]: Skip loaded file: file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/basic.lua
[11:36:12.924][info] [#0:script/workspace/loading.lua:112]: ++++As library of:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/basic.lua
[11:36:12.924][info] [#0:script/workspace/loading.lua:88]: Skip loaded file: file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/package.lua
[11:36:12.924][info] [#0:script/workspace/loading.lua:112]: ++++As library of:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/package.lua
[11:36:12.924][info] [#0:script/workspace/loading.lua:88]: Skip loaded file: file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/os.lua
[11:36:12.924][info] [#0:script/workspace/loading.lua:112]: ++++As library of:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/os.lua
[11:36:12.924][info] [#0:script/workspace/loading.lua:88]: Skip loaded file: file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/table.lua
[11:36:12.924][info] [#0:script/workspace/loading.lua:112]: ++++As library of:	file:///home/selecaoone/repositories/lua-language-server/meta/Lua%205.4%20en-us%20utf8/table.lua
[11:36:12.924][info] [#0:script/workspace/loading.lua:172]: Loaded files takes [0.000] sec: <fallback>
[11:36:12.924][info] [#0:script/workspace/loading.lua:181]: Compile files takes [0.000] sec: <fallback>
[11:36:12.924][info] [#0:script/workspace/loading.lua:182]: Loaded finish:	<fallback>
[11:36:12.924][info] [#0:script/workspace/workspace.lua:381]: Preload finish at:	<fallback>
@tomlau10
Copy link
Contributor

Someone asked before and the interface seems get changed a while ago, see my reply here: #2749 (comment)

It's a bit hard to find info online

There is an official wiki:

however I don't know if it is up to date or not 🙈

@ColinKennedy
Copy link
Author

I found that it isn't up to date with what I was trying. But maybe the issue was that it no longer accepts file paths. Not sure. Will test later and reply back if I can

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

2 participants