Go to variable definition (from local module arg) #670
Labels
enhancement
New feature or request
modules
Functionality related to the module block and modules generally
terraform-ls
Features/bugs which will be implemented/fixed purely on the LS side
Problem Statement
Users which call modules with any arguments may benefit from being able to jump quickly to the definition of the variable from the module call.
User Impact
Any users which use modules with any variables would likely benefit.
Expected User Experience
Cmd/Ctrl+click
For example by clicking to
myvar
in the following snippetthey would get to the relevant
variable
block within the./foo-submodule
module:See also https://code.visualstudio.com/docs/editor/editingevolved#_go-to-definition
Context menu
AND/OR
(see below)
Blocking Questions
LSP recognizes two concepts that are relevant here - definition and declaration:
For variables in other languages declaration ~= data type and definition ~= value.
Strictly speaking this should therefore probably be implemented as "Go to declaration" unless the variable also has a
default
, but it's unclear how either of these two methods are surfaced in the VS Code UI, especially when both are in use.Proposal
lang.ExtReference{ DirPath string, Addr []lang.AddrStep }
tohcl-lang
NameRefersTo *lang.ExtReference
tohcl-lang/schema.AttributeSchema
NameRefersTo
of attributes withinDependentBody
ofmodule
blocks withinterraform-schema
The text was updated successfully, but these errors were encountered: