Replies: 1 comment
-
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.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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