-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
many language servers have support for semantic tokens, giving each token some information on what it actually refers to, which can be styled
this would be a very helpful feature for teal development, as the most common lua extension does include semantic tokens
example
given:
local function do_work(worker, arg)
worker(arg) -- worker and arg are `parameter`
end
local test = { -- test is `variable.declaration`
x = 1,
y = 2,
thing = function(x, y)
return x + y
end,
}
local worker = function(arg) -- worker is `function.declaration`
return arg.thing(arg.x, arg.y) -- arg is `parameter`, .thing is `method`, and .x and .y are `property`
end
do_work(worker, test) -- do_work and worker are `function`, test is `variable`
local other = do_work -- it knows that do_work is `function`, and thus other is `function.declaration`...however, this is nontrivial, especially given the ways the vscode-teal currently operates, wrapping tl, it'd require either direct integration with the base language tl.tl (via some sort of --dump-semantics flag), or a re-implementation of type inference in the language server (a la rust-analyzer reimplementing rustc behaviors for LSP purposes)
either way this is not a small task, so it's entirely understandable if people don't wish to put the time into it ^v^
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels

