Replies: 3 comments 1 reply
-
Don't know why the I found a workaroundThe current workaround that I found is to also add that folder in My test setup
---@class lib
local lib = {}
---@return string
function lib.func() end --< this line will throw `missing-return` if diagnostics are not ignored
return lib
local lib = require "lib"
print(lib.func)
print(lib.func_not_exist) --< this line should throw `undefined-field`
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"workspace.library": [
"lib/"
],
"diagnostics.libraryFiles": "Disable", // seems not working
// and needs to uncomment the following to work
/*
"workspace.ignoreDir": ["lib/"],
"diagnostics.ignoredFiles": "Disable"
*/
} |
Beta Was this translation helpful? Give feedback.
-
If I add |
Beta Was this translation helpful? Give feedback.
-
I just did some debugging:
- if files.isLibrary(uri, true) then
+ if files.isLibrary(uri) then
local status = config.get(uri, 'Lua.diagnostics.libraryFiles')
... then now the Maybe you can create a PR for it after more testing 😄 |
Beta Was this translation helpful? Give feedback.
-
I have a meta libraries/descriptors inside
<project_root>/common/stubs.lua
that describes some of the globals. classes, etc:My working sources are in `<project_root>/src/whatever.
.luarc.json
I get the semantic hints for each object defined in stubs.lua but no matter what
workspace.library
diagnostic option i choose, luals still diagnoses all 773 files. All I want is hints and definition from these libraries but I dont have to see 1238 warnings and errors from these.Is there a better solution or are we here just to suffer?
Beta Was this translation helpful? Give feedback.
All reactions