diff --git a/src/main.lua b/src/main.lua index cfcc9c9..ff90c47 100644 --- a/src/main.lua +++ b/src/main.lua @@ -838,6 +838,7 @@ function handlers.textDocument_completion(params) if prefix == "" or name:upper():find("^" .. prefix:upper(), 1, true) then table.insert(items, { label = "#" .. name, + filterText = name, kind = 13, detail = "Variable (" .. (info.type or "VAR") .. "): " .. (info.data_type or "unknown"), insertText = "#" .. name, @@ -933,9 +934,6 @@ function handlers.textDocument_completion(params) else -- Check if we're inside a function call (e.g., after instTestTimer() local call_name = get_call_context(line, col) - if not call_name and col > 0 then - call_name = line:sub(1, col):match("([%w_]+)%s*$") - end local call_params = call_name and resolve_call_params(call_name, doc.variables, doc.types) -- Check context before cursor @@ -977,6 +975,7 @@ function handlers.textDocument_completion(params) if word_prefix == "" or name:upper():find("^" .. word_prefix:upper(), 1, true) then table.insert(items, { label = "#" .. name, + filterText = name, kind = 13, detail = "Variable (" .. (info.type or "VAR") .. "): " .. (info.data_type or "unknown"), insertText = "#" .. name, @@ -1010,6 +1009,7 @@ function handlers.textDocument_completion(params) if word_prefix == "" or name:upper():find("^" .. word_prefix:upper(), 1, true) then table.insert(items, { label = "#" .. name, + filterText = name, kind = 13, detail = "Variable (" .. (info.type or "VAR") .. "): " .. (info.data_type or "unknown"), insertText = "#" .. name,