-
-
Notifications
You must be signed in to change notification settings - Fork 384
Closed
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Describe the bug
When passing a table to function with a parameter of some class type, the fields of the class are not suggested, and documentation comments are not visible.
Creating an object annotated by @type
of the class works correctly.
To Reproduce
Steps to reproduce the behavior:
- Create a class type
- Create a function with a parameter of the class type
- Attempt to call the function, and begin defining the table
Expected behavior
Intellisense hints should show the fields of the class, and fields of child classes, along with documentation comments.
Screenshots
Environment
- OS: Windows and Linux
- Is WSL remote? Occurs in both
- Client: VSCode
Additional context
Example code
---@class ChildTable
---@field someField integer This is an important field
local ChildTable = { }
---@class ArgsTable
---@field child ChildTable Some child arguments
---@field arg1 string Some argument
local ArgsTable = { }
---@param argsTable ArgsTable
local function someFunc(argsTable) end
---@type ArgsTable
local args = {
arg1 = "",
child = {
someField = 3
}
}
someFunc({
arg1 = "",
child = {
someField = 3
}
})
Config dump
Lua = {
color = {
mode = "Semantic",
},
completion = {
autoRequire = true,
callSnippet = "Disable",
displayContext = 0,
enable = true,
keywordSnippet = "Replace",
requireSeparator = ".",
showParams = true,
showWord = "Fallback",
workspaceWord = true,
},
diagnostics = {
disable = {
},
enable = true,
globals = {
[1] = "minetest",
[2] = "vector",
[3] = "dump",
[4] = "dump2",
},
ignoredFiles = "Opened",
libraryFiles = "Opened",
neededFileStatus = {
},
severity = {
},
workspaceDelay = 0,
workspaceRate = 100,
},
hint = {
enable = true,
paramName = "All",
paramType = true,
setType = true,
},
hover = {
enable = true,
enumsLimit = 5,
previewFields = 20,
viewNumber = true,
viewString = true,
viewStringMax = 1000,
},
misc = {
parameters = {
},
},
runtime = {
builtin = {
},
fileEncoding = "utf8",
nonstandardSymbol = {
},
path = {
[1] = "?.lua",
[2] = "?/init.lua",
},
plugin = "",
special = {
},
unicodeName = false,
version = "Lua 5.4",
},
signatureHelp = {
enable = true,
},
telemetry = {
},
window = {
progressBar = true,
statusBar = true,
},
workspace = {
checkThirdParty = true,
ignoreDir = {
[1] = ".vscode",
},
ignoreSubmodules = true,
library = {
},
maxPreload = 1000,
preloadFileSize = 100,
useGitIgnore = true,
userThirdParty = {
},
},
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request