Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding a refactor function - refactor.extract.propToOutput #1526

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ziyeqf
Copy link

@ziyeqf ziyeqf commented Dec 19, 2023

It's going to adding a code action to extract an existing property of a resource to a output block.

test

❯ go test -v ./internal/langserver/handlers -run=TestLangServer_ExtractPropToOutput           
=== RUN   TestLangServer_ExtractPropToOutput_basic
2023/12/19 14:11:53 langserver_mock.go:91: Starting mock server ...
[SERVER] 2023/12/19 14:11:53 service.go:106: Preparing new session ...
[CLIENT] 2023/12/19 14:11:53 opts.go:215: Outgoing batch: count=1, bytes=215
[SERVER] 2023/12/19 14:11:53 opts.go:215: Received request batch of size 1 (qlen=0)
[SERVER] 2023/12/19 14:11:53 opts.go:215: Dequeued request batch of length 1 (qlen=0)
[SERVER] 2023/12/19 14:11:53 rpc_logger.go:32: Incoming request for "initialize" (ID 1): {"capabilities":{},
"rootUri":"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropTo
Output_basic","processId":12345}
[SERVER] 2023/12/19 14:11:53 scheduler.go:56: launching eval loop 0
[SERVER] 2023/12/19 14:11:53 service.go:482: started low priority scheduler
[SERVER] 2023/12/19 14:11:53 scheduler.go:56: launching eval loop 0
[SERVER] 2023/12/19 14:11:53 service.go:487: started high priority scheduler
[SERVER] 2023/12/19 14:11:53 walker_paths.go:255: walking next dir: {"file:///var/folders/73/kpm5cv3j1ps0ndg
hmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic"}
[SERVER] 2023/12/19 14:11:53 rpc_logger.go:53: Response to "initialize" (ID 1): {"capabilities":{"textDocume
ntSync":{"openClose":true,"change":2,"save":{}},"completionProvider":{"triggerCharacters":[".","["],"resolve
Provider":true},"hoverProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"declarationPro
vider":true,"definitionProvider":true,"referencesProvider":true,"documentSymbolProvider":true,"codeActionPro
vider":{"codeActionKinds":["refactor.extract.propToOut","source.formatAll.terraform"]},"codeLensProvider":{}
,"documentLinkProvider":{},"workspaceSymbolProvider":true,"documentFormattingProvider":true,"executeCommandP
rovider":{"commands":["terraform-ls.module.callers","terraform-ls.module.calls","terraform-ls.module.provide
rs","terraform-ls.module.terraform","terraform-ls.rootmodules","terraform-ls.terraform.init","terraform-ls.t
erraform.validate"],"workDoneProgress":true},"semanticTokensProvider":{"legend":{"tokenTypes":[],"tokenModif
iers":[]}},"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":"workspace/didChangeWorks
paceFolders"},"fileOperations":{}},"experimental":{"referenceCountCodeLens":false,"refreshModuleProviders":f
alse,"refreshModuleCalls":false,"refreshTerraformVersion":false}},"serverInfo":{"name":"terraform-ls","versi
on":""}}
[SERVER] 2023/12/19 14:11:53 opts.go:215: Completed 1 requests [998.584µs elapsed]
[SERVER] 2023/12/19 14:11:53 walker.go:242: walking of {file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000g
n/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic} finished
[CLIENT] 2023/12/19 14:11:53 opts.go:215: Received 1 responses
[SERVER] 2023/12/19 14:11:53 walker.go:156: walker: walking through {"file:///var/folders/73/kpm5cv3j1ps0ndg
hmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic"} finished
[CLIENT] 2023/12/19 14:11:53 opts.go:215: Completed request for ID "1"
[CLIENT] 2023/12/19 14:11:53 opts.go:215: Outgoing batch: count=1, bytes=52
[SERVER] 2023/12/19 14:11:53 opts.go:215: Received request batch of size 1 (qlen=0)
[SERVER] 2023/12/19 14:11:53 opts.go:215: Dequeued request batch of length 1 (qlen=0)
[SERVER] 2023/12/19 14:11:53 rpc_logger.go:32: Incoming notification for "initialized": {}
[SERVER] 2023/12/19 14:11:53 initialized.go:27: Client doesn't support dynamic watched files registration, p
rovider and module changes may not be reflected at runtime
[CLIENT] 2023/12/19 14:11:53 opts.go:215: Outgoing batch: count=1, bytes=340
[SERVER] 2023/12/19 14:11:53 opts.go:215: Received request batch of size 1 (qlen=0)
[SERVER] 2023/12/19 14:11:53 opts.go:215: Dequeued request batch of length 1 (qlen=0)
[SERVER] 2023/12/19 14:11:53 rpc_logger.go:32: Incoming request for "textDocument/didOpen" (ID 2): {"textDoc
ument":{"version":0,"languageId":"terraform","text":"provider \"test\"{}\n\nresource \"test_resource\" \"tes
t\"{\n    name = \"test\"\n}","uri":"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/Te
stLangServer_ExtractPropToOutput_basic/main.tf"}}
[SERVER] 2023/12/19 14:11:53 did_open.go:56: opened module: /var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T
/terraform-ls/TestLangServer_ExtractPropToOutput_basic
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "1": "OpTypeGetTerraformVersion" for {"fi
le:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic"
} (IsDirOpen: true, IgnoreState: false)
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "2": "OpTypeParseModuleConfiguration" for
 {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_b
asic"} (IsDirOpen: true, IgnoreState: true)
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "3": "OpTypeLoadModuleMetadata" for {"fil
e:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic"}
 (IsDirOpen: true, IgnoreState: true)
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "4": "OpTypeGetModuleDataFromRegistry" fo
r {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_
basic"} (IsDirOpen: true, IgnoreState: false)
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "5": "OpTypeParseVariables" for {"file://
/var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic"} (Is
DirOpen: true, IgnoreState: true)
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "6": "OpTypeSchemaVarsValidation" for {"f
ile:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic
"} (IsDirOpen: true, IgnoreState: true)
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "7": "OpTypeDecodeVarsReferences" for {"f
ile:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic
"} (IsDirOpen: true, IgnoreState: false)
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "1" (scheduler prio: 1, job prio: 0, is
DirOpen: true): "OpTypeGetTerraformVersion" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/te
rraform-ls/TestLangServer_ExtractPropToOutput_basic"}
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "1": "OpTypeGetTerraformVersion" for {"file://
/var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic"} (er
r = %!s(<nil>), deferredJobs: [])
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "2" (scheduler prio: 1, job prio: 0, is
DirOpen: true): "OpTypeParseModuleConfiguration" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn
/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic"}
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "2": "OpTypeParseModuleConfiguration" for {"fi
le:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic"
} (err = %!s(<nil>), deferredJobs: [])
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "3" (scheduler prio: 1, job prio: 0, is
DirOpen: true): "OpTypeLoadModuleMetadata" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/ter
raform-ls/TestLangServer_ExtractPropToOutput_basic"}
[SERVER] 2023/12/19 14:11:53 module_calls.go:64: indexing declared module calls for "file:///var/folders/73/
kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic": 0
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "8": "OpTypePreloadEmbeddedSchema" for {"
file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basi
c"} (IsDirOpen: true, IgnoreState: true)
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "9": "OpTypeSchemaModuleValidation" for {
"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_bas
ic"} (IsDirOpen: true, IgnoreState: true)
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "10": "OpTypeDecodeReferenceTargets" for 
{"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_ba
sic"} (IsDirOpen: true, IgnoreState: true)
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "11": "OpTypeDecodeReferenceOrigins" for 
{"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_ba
sic"} (IsDirOpen: true, IgnoreState: true)
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "12": "OpTypeReferenceValidation" for {"f
ile:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic
"} (IsDirOpen: true, IgnoreState: true)
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "3": "OpTypeLoadModuleMetadata" for {"file:///
var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic"} (err
 = %!s(<nil>), deferredJobs: ["8" "10" "11"])
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "5" (scheduler prio: 1, job prio: 0, is
DirOpen: true): "OpTypeParseVariables" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terrafo
rm-ls/TestLangServer_ExtractPropToOutput_basic"}
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "4" (scheduler prio: -1, job prio: -1, 
isDirOpen: true): "OpTypeGetModuleDataFromRegistry" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr000
0gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic"}
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "4": "OpTypeGetModuleDataFromRegistry" for {"f
ile:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic
"} (err = %!s(<nil>), deferredJobs: [])
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "5": "OpTypeParseVariables" for {"file:///var/
folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic"} (err = %
!s(<nil>), deferredJobs: [])
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "6" (scheduler prio: 1, job prio: 0, is
DirOpen: true): "OpTypeSchemaVarsValidation" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/t
erraform-ls/TestLangServer_ExtractPropToOutput_basic"}
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "6": "OpTypeSchemaVarsValidation" for {"file:/
//var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic"} (e
rr = %!s(<nil>), deferredJobs: [])
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "7" (scheduler prio: 1, job prio: 0, is
DirOpen: true): "OpTypeDecodeVarsReferences" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/t
erraform-ls/TestLangServer_ExtractPropToOutput_basic"}
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "7": "OpTypeDecodeVarsReferences" for {"file:/
//var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic"} (e
rr = %!s(<nil>), deferredJobs: [])
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "8" (scheduler prio: 1, job prio: 0, is
DirOpen: true): "OpTypePreloadEmbeddedSchema" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/
terraform-ls/TestLangServer_ExtractPropToOutput_basic"}
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 module_ops.go:301: preloaded schema not available for registry.terraform.io/has
hicorp/test
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "8": "OpTypePreloadEmbeddedSchema" for {"file:
///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic"} (
err = %!s(<nil>), deferredJobs: [])
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "10" (scheduler prio: 1, job prio: 0, i
sDirOpen: true): "OpTypeDecodeReferenceTargets" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/
T/terraform-ls/TestLangServer_ExtractPropToOutput_basic"}
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 provider_schema.go:306: PSS: getting provider schema (/var/folders/73/kpm5cv3j1
ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic, registry.terraform.io/-/test,
 )
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "10": "OpTypeDecodeReferenceTargets" for {"fil
e:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic"}
 (err = %!s(<nil>), deferredJobs: [])
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "11" (scheduler prio: 1, job prio: 0, i
sDirOpen: true): "OpTypeDecodeReferenceOrigins" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/
T/terraform-ls/TestLangServer_ExtractPropToOutput_basic"}
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 provider_schema.go:306: PSS: getting provider schema (/var/folders/73/kpm5cv3j1
ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic, registry.terraform.io/-/test,
 )
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "11": "OpTypeDecodeReferenceOrigins" for {"fil
e:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic"}
 (err = %!s(<nil>), deferredJobs: [])
[SERVER] 2023/12/19 14:11:53 rpc_logger.go:53: Response to "textDocument/didOpen" (ID 2): null
[SERVER] 2023/12/19 14:11:53 opts.go:215: Completed 1 requests [3.817083ms elapsed]
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[CLIENT] 2023/12/19 14:11:53 opts.go:215: Received 1 responses
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "12" (scheduler prio: 1, job prio: 0, i
sDirOpen: true): "OpTypeReferenceValidation" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/t
erraform-ls/TestLangServer_ExtractPropToOutput_basic"}
[CLIENT] 2023/12/19 14:11:53 opts.go:215: Completed request for ID "2"
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 provider_schema.go:306: PSS: getting provider schema (/var/folders/73/kpm5cv3j1
ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic, registry.terraform.io/-/test,
 )
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "12": "OpTypeReferenceValidation" for {"file:/
//var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic"} (e
rr = %!s(<nil>), deferredJobs: [])
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "9" (scheduler prio: 1, job prio: 0, is
DirOpen: true): "OpTypeSchemaModuleValidation" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T
/terraform-ls/TestLangServer_ExtractPropToOutput_basic"}
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 provider_schema.go:306: PSS: getting provider schema (/var/folders/73/kpm5cv3j1
ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic, registry.terraform.io/-/test,
 )
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "9": "OpTypeSchemaModuleValidation" for {"file
:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic"} 
(err = %!s(<nil>), deferredJobs: [])
[CLIENT] 2023/12/19 14:11:53 opts.go:215: Outgoing batch: count=1, bytes=339
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 opts.go:215: Received request batch of size 1 (qlen=0)
[SERVER] 2023/12/19 14:11:53 opts.go:215: Dequeued request batch of length 1 (qlen=0)
[SERVER] 2023/12/19 14:11:53 rpc_logger.go:32: Incoming request for "textDocument/codeAction" (ID 3): {"text
Document":{"uri":"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_Extrac
tPropToOutput_basic/main.tf"},"range":{"start":{"line":3,"character":14},"end":{"line":3,"character":14}},"c
ontext":{"only":["refactor.extract.propToOut"]}}
[SERVER] 2023/12/19 14:11:53 code_action.go:37: Code actions requested: "refactor.extract.propToOut"
[SERVER] 2023/12/19 14:11:53 code_action.go:46: Code actions supported: map[refactor.extract.propToOut:true]
[SERVER] 2023/12/19 14:11:53 rpc_logger.go:53: Response to "textDocument/codeAction" (ID 3): [{"title":"Extr
act Property to Output","kind":"refactor.extract.propToOut","edit":{"changes":{"file:///var/folders/73/kpm5c
v3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_basic/main.tf":[{"range":{"start
":{"line":6,"character":6},"end":{"line":6,"character":6}},"newText":"\noutput \"test_resource_test_name\" {
\n  value = test_resource.test.name\n}\n"}]}}}]
[SERVER] 2023/12/19 14:11:53 opts.go:215: Completed 1 requests [231µs elapsed]
[CLIENT] 2023/12/19 14:11:53 opts.go:215: Received 1 responses
[CLIENT] 2023/12/19 14:11:53 opts.go:215: Completed request for ID "3"
2023/12/19 14:11:53 langserver_mock.go:77: Stopping mock server ...
[SERVER] 2023/12/19 14:11:53 opts.go:215: Server signaled to stop with err=the server has been stopped
[SERVER] 2023/12/19 14:11:53 opts.go:215: Error reading from client: the server has been stopped
[SERVER] 2023/12/19 14:11:53 service.go:568: stopping closedDirWalker for session ...
[SERVER] 2023/12/19 14:11:53 service.go:570: closedDirWalker stopped
[SERVER] 2023/12/19 14:11:53 service.go:573: stopping openDirWalker for session ...
[SERVER] 2023/12/19 14:11:53 service.go:575: openDirWalker stopped
[SERVER] 2023/12/19 14:11:53 scheduler.go:63: stopped scheduler
[SERVER] 2023/12/19 14:11:53 scheduler.go:63: stopped scheduler
--- PASS: TestLangServer_ExtractPropToOutput_basic (0.01s)
=== RUN   TestLangServer_ExtractPropToOutput_oldVersion
[SERVER] 2023/12/19 14:11:53 notifier.go:55: failed to notify a change batch: context canceled
[SERVER] 2023/12/19 14:11:53 notifier.go:48: stopping notifier: context canceled
2023/12/19 14:11:53 langserver_mock.go:91: Starting mock server ...
[SERVER] 2023/12/19 14:11:53 service.go:106: Preparing new session ...
[CLIENT] 2023/12/19 14:11:53 opts.go:215: Outgoing batch: count=1, bytes=220
[SERVER] 2023/12/19 14:11:53 opts.go:215: Received request batch of size 1 (qlen=0)
[SERVER] 2023/12/19 14:11:53 opts.go:215: Dequeued request batch of length 1 (qlen=0)
[SERVER] 2023/12/19 14:11:53 rpc_logger.go:32: Incoming request for "initialize" (ID 1): {"capabilities":{},
"rootUri":"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropTo
Output_oldVersion","processId":12345}
[SERVER] 2023/12/19 14:11:53 scheduler.go:56: launching eval loop 0
[SERVER] 2023/12/19 14:11:53 service.go:482: started low priority scheduler
[SERVER] 2023/12/19 14:11:53 scheduler.go:56: launching eval loop 0
[SERVER] 2023/12/19 14:11:53 service.go:487: started high priority scheduler
[SERVER] 2023/12/19 14:11:53 rpc_logger.go:53: Response to "initialize" (ID 1): {"capabilities":{"textDocume
ntSync":{"openClose":true,"change":2,"save":{}},"completionProvider":{"triggerCharacters":[".","["],"resolve
Provider":true},"hoverProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"declarationPro
vider":true,"definitionProvider":true,"referencesProvider":true,"documentSymbolProvider":true,"codeActionPro
vider":{"codeActionKinds":["refactor.extract.propToOut","source.formatAll.terraform"]},"codeLensProvider":{}
,"documentLinkProvider":{},"workspaceSymbolProvider":true,"documentFormattingProvider":true,"executeCommandP
rovider":{"commands":["terraform-ls.module.callers","terraform-ls.module.calls","terraform-ls.module.provide
rs","terraform-ls.module.terraform","terraform-ls.rootmodules","terraform-ls.terraform.init","terraform-ls.t
erraform.validate"],"workDoneProgress":true},"semanticTokensProvider":{"legend":{"tokenTypes":[],"tokenModif
iers":[]}},"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":"workspace/didChangeWorks
paceFolders"},"fileOperations":{}},"experimental":{"referenceCountCodeLens":false,"refreshModuleProviders":f
alse,"refreshModuleCalls":false,"refreshTerraformVersion":false}},"serverInfo":{"name":"terraform-ls","versi
on":""}}
[SERVER] 2023/12/19 14:11:53 opts.go:215: Completed 1 requests [158.917µs elapsed]
[SERVER] 2023/12/19 14:11:53 walker_paths.go:255: walking next dir: {"file:///var/folders/73/kpm5cv3j1ps0ndg
hmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersion"}
[CLIENT] 2023/12/19 14:11:53 opts.go:215: Received 1 responses
[CLIENT] 2023/12/19 14:11:53 opts.go:215: Completed request for ID "1"
[SERVER] 2023/12/19 14:11:53 walker.go:242: walking of {file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000g
n/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersion} finished
[SERVER] 2023/12/19 14:11:53 walker.go:156: walker: walking through {"file:///var/folders/73/kpm5cv3j1ps0ndg
hmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersion"} finished
[CLIENT] 2023/12/19 14:11:53 opts.go:215: Outgoing batch: count=1, bytes=52
[SERVER] 2023/12/19 14:11:53 opts.go:215: Received request batch of size 1 (qlen=0)
[SERVER] 2023/12/19 14:11:53 opts.go:215: Dequeued request batch of length 1 (qlen=0)
[SERVER] 2023/12/19 14:11:53 rpc_logger.go:32: Incoming notification for "initialized": {}
[SERVER] 2023/12/19 14:11:53 initialized.go:27: Client doesn't support dynamic watched files registration, p
rovider and module changes may not be reflected at runtime
[CLIENT] 2023/12/19 14:11:53 opts.go:215: Outgoing batch: count=1, bytes=291
[SERVER] 2023/12/19 14:11:53 opts.go:215: Received request batch of size 1 (qlen=0)
[SERVER] 2023/12/19 14:11:53 opts.go:215: Dequeued request batch of length 1 (qlen=0)
[SERVER] 2023/12/19 14:11:53 rpc_logger.go:32: Incoming request for "textDocument/didOpen" (ID 2): {"textDoc
ument":{"version":0,"languageId":"terraform","text":"provider  \"test\"   {\n\n}\n","uri":"file:///var/folde
rs/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersion/main.tf"}}
[SERVER] 2023/12/19 14:11:53 did_open.go:56: opened module: /var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T
/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersion
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "1": "OpTypeGetTerraformVersion" for {"fi
le:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVer
sion"} (IsDirOpen: true, IgnoreState: false)
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "2": "OpTypeParseModuleConfiguration" for
 {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_o
ldVersion"} (IsDirOpen: true, IgnoreState: true)
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "3": "OpTypeLoadModuleMetadata" for {"fil
e:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVers
ion"} (IsDirOpen: true, IgnoreState: true)
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "4": "OpTypeGetModuleDataFromRegistry" fo
r {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_
oldVersion"} (IsDirOpen: true, IgnoreState: false)
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "5": "OpTypeParseVariables" for {"file://
/var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersion"
} (IsDirOpen: true, IgnoreState: true)
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "6": "OpTypeSchemaVarsValidation" for {"f
ile:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVe
rsion"} (IsDirOpen: true, IgnoreState: true)
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "7": "OpTypeDecodeVarsReferences" for {"f
ile:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVe
rsion"} (IsDirOpen: true, IgnoreState: false)
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "1" (scheduler prio: 1, job prio: 0, is
DirOpen: true): "OpTypeGetTerraformVersion" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/te
rraform-ls/TestLangServer_ExtractPropToOutput_oldVersion"}
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "1": "OpTypeGetTerraformVersion" for {"file://
/var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersion"
} (err = %!s(<nil>), deferredJobs: [])
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "2" (scheduler prio: 1, job prio: 0, is
DirOpen: true): "OpTypeParseModuleConfiguration" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn
/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersion"}
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "2": "OpTypeParseModuleConfiguration" for {"fi
le:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVer
sion"} (err = %!s(<nil>), deferredJobs: [])
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "3" (scheduler prio: 1, job prio: 0, is
DirOpen: true): "OpTypeLoadModuleMetadata" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/ter
raform-ls/TestLangServer_ExtractPropToOutput_oldVersion"}
[SERVER] 2023/12/19 14:11:53 module_calls.go:64: indexing declared module calls for "file:///var/folders/73/
kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersion": 0
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "8": "OpTypePreloadEmbeddedSchema" for {"
file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldV
ersion"} (IsDirOpen: true, IgnoreState: true)
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "9": "OpTypeSchemaModuleValidation" for {
"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_old
Version"} (IsDirOpen: true, IgnoreState: true)
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "10": "OpTypeDecodeReferenceTargets" for 
{"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_ol
dVersion"} (IsDirOpen: true, IgnoreState: true)
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "11": "OpTypeDecodeReferenceOrigins" for 
{"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_ol
dVersion"} (IsDirOpen: true, IgnoreState: true)
[SERVER] 2023/12/19 14:11:53 jobs.go:140: JOBS: Enqueueing new job "12": "OpTypeReferenceValidation" for {"f
ile:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVe
rsion"} (IsDirOpen: true, IgnoreState: true)
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "3": "OpTypeLoadModuleMetadata" for {"file:///
var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersion"}
 (err = %!s(<nil>), deferredJobs: ["8" "10" "11"])
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "5" (scheduler prio: 1, job prio: 0, is
DirOpen: true): "OpTypeParseVariables" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terrafo
rm-ls/TestLangServer_ExtractPropToOutput_oldVersion"}
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "4" (scheduler prio: -1, job prio: -1, 
isDirOpen: true): "OpTypeGetModuleDataFromRegistry" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr000
0gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersion"}
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "4": "OpTypeGetModuleDataFromRegistry" for {"f
ile:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVe
rsion"} (err = %!s(<nil>), deferredJobs: [])
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "5": "OpTypeParseVariables" for {"file:///var/
folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersion"} (er
r = %!s(<nil>), deferredJobs: [])
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "6" (scheduler prio: 1, job prio: 0, is
DirOpen: true): "OpTypeSchemaVarsValidation" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/t
erraform-ls/TestLangServer_ExtractPropToOutput_oldVersion"}
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "6": "OpTypeSchemaVarsValidation" for {"file:/
//var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersion
"} (err = %!s(<nil>), deferredJobs: [])
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "7" (scheduler prio: 1, job prio: 0, is
DirOpen: true): "OpTypeDecodeVarsReferences" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/t
erraform-ls/TestLangServer_ExtractPropToOutput_oldVersion"}
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "7": "OpTypeDecodeVarsReferences" for {"file:/
//var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersion
"} (err = %!s(<nil>), deferredJobs: [])
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "8" (scheduler prio: 1, job prio: 0, is
DirOpen: true): "OpTypePreloadEmbeddedSchema" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/
terraform-ls/TestLangServer_ExtractPropToOutput_oldVersion"}
[SERVER] 2023/12/19 14:11:53 module_ops.go:301: preloaded schema not available for registry.terraform.io/has
hicorp/test
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "8": "OpTypePreloadEmbeddedSchema" for {"file:
///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersio
n"} (err = %!s(<nil>), deferredJobs: [])
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "10" (scheduler prio: 1, job prio: 0, i
sDirOpen: true): "OpTypeDecodeReferenceTargets" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/
T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersion"}
[SERVER] 2023/12/19 14:11:53 provider_schema.go:306: PSS: getting provider schema (/var/folders/73/kpm5cv3j1
ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersion, registry.terraform.io/-/
test, )
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "10": "OpTypeDecodeReferenceTargets" for {"fil
e:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVers
ion"} (err = %!s(<nil>), deferredJobs: [])
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "11" (scheduler prio: 1, job prio: 0, i
sDirOpen: true): "OpTypeDecodeReferenceOrigins" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/
T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersion"}
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 provider_schema.go:306: PSS: getting provider schema (/var/folders/73/kpm5cv3j1
ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersion, registry.terraform.io/-/
test, )
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "11": "OpTypeDecodeReferenceOrigins" for {"fil
e:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVers
ion"} (err = %!s(<nil>), deferredJobs: [])
[SERVER] 2023/12/19 14:11:53 rpc_logger.go:53: Response to "textDocument/didOpen" (ID 2): null
[SERVER] 2023/12/19 14:11:53 opts.go:215: Completed 1 requests [2.5155ms elapsed]
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "12" (scheduler prio: 1, job prio: 0, i
sDirOpen: true): "OpTypeReferenceValidation" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/t
erraform-ls/TestLangServer_ExtractPropToOutput_oldVersion"}
[CLIENT] 2023/12/19 14:11:53 opts.go:215: Received 1 responses
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[CLIENT] 2023/12/19 14:11:53 opts.go:215: Completed request for ID "2"
[SERVER] 2023/12/19 14:11:53 provider_schema.go:306: PSS: getting provider schema (/var/folders/73/kpm5cv3j1
ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersion, registry.terraform.io/-/
test, )
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "12": "OpTypeReferenceValidation" for {"file:/
//var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersion
"} (err = %!s(<nil>), deferredJobs: [])
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 jobs.go:321: JOBS: Dispatching next job "9" (scheduler prio: 1, job prio: 0, is
DirOpen: true): "OpTypeSchemaModuleValidation" for {"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T
/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersion"}
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[SERVER] 2023/12/19 14:11:53 provider_schema.go:306: PSS: getting provider schema (/var/folders/73/kpm5cv3j1
ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersion, registry.terraform.io/-/
test, )
[SERVER] 2023/12/19 14:11:53 jobs.go:461: JOBS: Finishing job "9": "OpTypeSchemaModuleValidation" for {"file
:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_ExtractPropToOutput_oldVersi
on"} (err = %!s(<nil>), deferredJobs: [])
[SERVER] 2023/12/19 14:11:53 jobs.go:299: retrying on obj is nil
[CLIENT] 2023/12/19 14:11:53 opts.go:215: Outgoing batch: count=1, bytes=218
[SERVER] 2023/12/19 14:11:53 opts.go:215: Received request batch of size 1 (qlen=0)
[SERVER] 2023/12/19 14:11:53 opts.go:215: Dequeued request batch of length 1 (qlen=0)
[SERVER] 2023/12/19 14:11:53 rpc_logger.go:32: Incoming request for "textDocument/formatting" (ID 3): {"text
Document":{"uri":"file:///var/folders/73/kpm5cv3j1ps0ndghmrltkhdr0000gn/T/terraform-ls/TestLangServer_Extrac
tPropToOutput_oldVersion/main.tf"}}
[SERVER] 2023/12/19 14:11:53 formatting.go:45: formatting document via ""
[SERVER] 2023/12/19 14:11:53 formatting.go:50: Failed 'terraform fmt' in 47.375µs
[SERVER] 2023/12/19 14:11:53 rpc_logger.go:48: Error for "textDocument/formatting" (ID 3): [-32098] not impl
emented
[SERVER] 2023/12/19 14:11:53 opts.go:215: Completed 1 requests [186.833µs elapsed]
[CLIENT] 2023/12/19 14:11:53 opts.go:215: Received 1 responses
[CLIENT] 2023/12/19 14:11:53 opts.go:215: Completed request for ID "3"
2023/12/19 14:11:53 langserver_mock.go:77: Stopping mock server ...
[SERVER] 2023/12/19 14:11:53 opts.go:215: Server signaled to stop with err=the server has been stopped
[SERVER] 2023/12/19 14:11:53 opts.go:215: Error reading from client: the server has been stopped
[SERVER] 2023/12/19 14:11:53 service.go:568: stopping closedDirWalker for session ...
[SERVER] 2023/12/19 14:11:53 service.go:570: closedDirWalker stopped
[SERVER] 2023/12/19 14:11:53 service.go:573: stopping openDirWalker for session ...
[SERVER] 2023/12/19 14:11:53 service.go:575: openDirWalker stopped
[SERVER] 2023/12/19 14:11:53 scheduler.go:63: stopped scheduler
[SERVER] 2023/12/19 14:11:53 scheduler.go:63: stopped scheduler
--- PASS: TestLangServer_ExtractPropToOutput_oldVersion (0.01s)
PASS
[SERVER] 2023/12/19 14:11:53 notifier.go:55: failed to notify a change batch: context canceled
[SERVER] 2023/12/19 14:11:53 notifier.go:48: stopping notifier: context canceled
ok      github.com/hashicorp/terraform-ls/internal/langserver/handlers  0.025s

As description in #1525, I'm trying to add some code actions.
Thanks in advance for any suggestion and insight.

@ziyeqf ziyeqf requested a review from a team as a code owner December 19, 2023 06:38
Signed-off-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
@ziyeqf ziyeqf mentioned this pull request Dec 19, 2023
1 task
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ziyeqf
I am actively researching Code Actions and that includes how we can make it easier and more intuitive to add new ones.

We generally track all the Terraform-specific schema, which includes the addressing schema of all blocks, including resource, here: https://github.com/hashicorp/terraform-schema so it is unlikely we'd be open to re-implementing any of that here in terrafom-ls.

This also implies that in order to support code actions as first class citizens we will need to make some changes to https://github.com/hashicorp/hcl-lang

I am anticipating we will end up with an interface similar to the one we have there for code lenses:

I am however not ready to commit to any particular design yet as this area is being actively researched and we need to consider the needs of different kinds of common actions before implementing anything.

Your ideas and contributions in #1525 will certainly help us in that respect as we can validate the design against them.

Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a plan for introducing some abstraction layers first before we begin to introduce more code actions. This is to ensure they all stay reasonably maintainable as we can anticipate many more will come.

I outlined some more details in #1575 but this is mostly for transparency, not in the anticipation of an external contributor picking up any of that work. We do expect external contributors like you to participate in maintaining those individual code actions however, which will hopefully make use of the abstraction layers.

I know this may not be the answer you were hoping for but I prefer to be honest and open, even if that implies high likelihood of the PR being closed in the near term and/or need significant rewrite later.

For now I'm putting it on hold and a team member will revisit this PR later. I cannot commit to any timeline at this point unfortunately.

Thank you for your effort and understanding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants