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

templ-vscode: Request textDocument/codeLens failed error #426

Open
RaniAgus opened this issue Jan 15, 2024 · 13 comments
Open

templ-vscode: Request textDocument/codeLens failed error #426

RaniAgus opened this issue Jan 15, 2024 · 13 comments
Labels
bug Something isn't working NeedsInvestigation Issue needs some investigation before being fixed vscode WaitingForMoreInfo

Comments

@RaniAgus
Copy link

I'm not really sure on how to reproduce this, but after working on a project for quite some time I'm getting this error every time I focus on a templ file:

[Error - 8:07:31 PM] Request textDocument/codeLens failed.
  Message: no views in session
  Code: 0 
[Error - 8:07:33 PM] Request textDocument/codeLens failed.
  Message: no views in session
  Code: 0 
[Error - 8:07:36 PM] Request textDocument/codeLens failed.
  Message: no views in session
  Code: 0 
[Error - 8:07:39 PM] Request textDocument/codeLens failed.
  Message: no views in session
  Code: 0 
[Error - 8:10:18 PM] Request textDocument/codeAction failed.
  Message: no views in session
  Code: 0 
[Error - 8:10:18 PM] Request textDocument/codeLens failed.
  Message: no views in session
  Code: 0 
[Error - 8:10:19 PM] Request textDocument/codeLens failed.
  Message: no views in session
  Code: 0 

The only way I found to solve it is to reboot my machine. Uninstalling and reinstalling the plugin doesn't work.

@joerdav joerdav changed the title [VSCode] Request textDocument/codeLens templ-vscode: Request textDocument/codeLens failed error Jan 19, 2024
@joerdav joerdav added bug Something isn't working vscode labels Jan 19, 2024
@rael346
Copy link

rael346 commented Jan 19, 2024

also having the same issue with an empty .templ file

@kazakh-in-nz
Copy link

Having the same errors when a .templ file is active.

@RaniAgus
Copy link
Author

Was able to reproduce it when creating a new file

@lewisd1996
Copy link

Experiencing this too, while a .templ file is open

@joerdav joerdav added the NeedsInvestigation Issue needs some investigation before being fixed label Jan 30, 2024
@SJ22032003
Copy link

Same issue. I switched the extension version to 0.0.7 and the issue did not appear but autocompletion and definitions stopped working.

@blackfyre
Copy link

Can confirm the issue

@joerdav
Copy link
Collaborator

joerdav commented Apr 9, 2024

We have a troubleshooting guide here aimed at getting the most useful logs when these issues happen. Would greatly help if you could run through the steps @RaniAgus

https://templ.guide/commands-and-tools/ide-support#troubleshooting-1

@joerdav
Copy link
Collaborator

joerdav commented Apr 17, 2024

Hi all, after some digging, I think that this is an issue with the extension being able to find gopls if you run vscode from your terminal with code . this might be a workaround.

@EduartePaiva
Copy link

Same here

@a-h
Copy link
Owner

a-h commented May 22, 2024

I think this issue is going to be stuck until someone can provide logs or a solid reproduction. If you can enable logs, and you've got a solid reproduction @EduartePaiva - please do!

@EduartePaiva
Copy link

I think this issue is going to be stuck until someone can provide logs or a solid reproduction. If you can enable logs, and you've got a solid reproduction @EduartePaiva - please do!

Sorry for not providing any kind of useful info, I'll try to detail the troubleshooting steps:

System: windows wsl, I went to my project folder and typed code .
after visiting any .templ file the issue happened.

which go gopls templ
output:

/usr/local/go/bin/go  
/home/eduarte/go/bin/gopls  
/home/eduarte/go/bin/templ  

templ lsp --help

output

usage: templ lsp [<args> ...]

Starts a language server for templ.

Args:
  -log string
    The file to log templ LSP output to, or leave empty to disable logging.
  -goplsLog string
    The file to log gopls output, or leave empty to disable logging.
  -goplsRPCTrace
    Set gopls to log input and output messages.
  -help
    Print help and exit.
  -pprof
    Enable pprof web server (default address is localhost:9999)
  -http string
    Enable http debug server by setting a listen address (e.g. localhost:7474)

gopls.log:

[Trace - 18:31:22.523 PM] Sending request 'initialize - (1)'.
Params: {"processId":13508,"clientInfo":{"name":"Visual Studio Code","version":"1.89.1"},"locale":"en","rootPath":"/home/eduarte","rootUri":"file:///home/eduarte","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"failureHandling":"textOnlyTransactional","resourceOperations":["create","rename","delete"],"normalizesLineEndings":true,"changeAnnotationSupport":{"groupsOnLabel":true}},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"tagSupport":{"valueSet":[1]}},"executeCommand":{"dynamicRegistration":true},"workspaceFolders":true,"configuration":true,"semanticTokens":{"refreshSupport":true},"codeLens":{"refreshSupport":true},"fileOperations":{"dynamicRegistration":true,"didCreate":true,"willCreate":true,"didRename":true,"willRename":true,"didDelete":true,"willDelete":true}},"textDocument":{"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]},"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"insertTextModeSupport":{"valueSet":[1,2]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]},"contextSupport":true},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true},"activeParameterSupport":true},"contextSupport":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true,"tagSupport":{"valueSet":[1]},"labelSupport":true},"codeAction":{"dynamicRegistration":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"isPreferredSupport":true,"disabledSupport":true,"dataSupport":true,"resolveSupport":{"properties":["edit"]},"honorsChangeAnnotations":true},"codeLens":{"dynamicRegistration":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"colorProvider":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"publishDiagnostics":{"relatedInformation":true,"tagSupport":{"valueSet":[1,2]},"codeDescriptionSupport":true,"dataSupport":true},"rename":{"dynamicRegistration":true,"prepareSupport":true,"prepareSupportDefaultBehavior":1,"honorsChangeAnnotations":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"selectionRange":{"dynamicRegistration":true},"callHierarchy":{"dynamicRegistration":true},"semanticTokens":{"dynamicRegistration":true,"requests":{"range":true,"full":{"delta":true}},"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","method","macro","keyword","modifier","comment","string","number","regexp","operator","decorator"],"tokenModifiers":["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"],"formats":["relative"]},"linkedEditingRange":{"dynamicRegistration":true}},"window":{"workDoneProgress":true,"showMessage":{"messageActionItem":{"additionalPropertiesSupport":true}},"showDocument":{"support":true}},"general":{"regularExpressions":{"engine":"ECMAScript","version":"ES2020"},"markdown":{"parser":"marked","version":"1.1.0"}}},"trace":"off","workspaceFolders":[{"uri":"file:///home/eduarte","name":"eduarte"}]}


[Trace - 18:31:22.528 PM] Received response 'initialize - (1)' in 4ms.
Result: {"capabilities":{"textDocumentSync":{"openClose":true,"change":2,"save":{}},"completionProvider":{"triggerCharacters":["."]},"hoverProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"definitionProvider":true,"typeDefinitionProvider":true,"implementationProvider":true,"referencesProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor.extract","refactor.inline","refactor.rewrite","source.fixAll","source.organizeImports"],"resolveProvider":true},"codeLensProvider":{},"documentLinkProvider":{},"workspaceSymbolProvider":true,"documentFormattingProvider":true,"renameProvider":{"prepareProvider":true},"foldingRangeProvider":true,"selectionRangeProvider":true,"executeCommandProvider":{"commands":["gopls.add_dependency","gopls.add_import","gopls.add_telemetry_counters","gopls.apply_fix","gopls.change_signature","gopls.check_upgrades","gopls.diagnose_files","gopls.edit_go_directive","gopls.fetch_vulncheck_result","gopls.gc_details","gopls.generate","gopls.go_get_package","gopls.list_imports","gopls.list_known_packages","gopls.maybe_prompt_for_telemetry","gopls.mem_stats","gopls.regenerate_cgo","gopls.remove_dependency","gopls.reset_go_mod_diagnostics","gopls.run_go_work_command","gopls.run_govulncheck","gopls.run_tests","gopls.start_debugging","gopls.start_profile","gopls.stop_profile","gopls.test","gopls.tidy","gopls.toggle_gc_details","gopls.update_go_sum","gopls.upgrade_dependency","gopls.vendor","gopls.views","gopls.workspace_stats"]},"callHierarchyProvider":true,"semanticTokensProvider":{"legend":{"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","method","macro","keyword","modifier","comment","string","number","regexp","operator","decorator"],"tokenModifiers":["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"]},"range":true,"full":true},"inlayHintProvider":{},"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":"workspace/didChangeWorkspaceFolders"}}},"serverInfo":{"name":"gopls","version":"{\"GoVersion\":\"go1.22.2\",\"Path\":\"golang.org/x/tools/gopls\",\"Main\":{\"Path\":\"golang.org/x/tools/gopls\",\"Version\":\"v0.15.3\",\"Sum\":\"h1:zbdOidFrPTc8Bx0YrN5QKgJ0zCjyGi0L27sKQ/bDG5o=\",\"Replace\":null},\"Deps\":[{\"Path\":\"github.com/BurntSushi/toml\",\"Version\":\"v1.2.1\",\"Sum\":\"h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=\",\"Replace\":null},{\"Path\":\"github.com/google/go-cmp\",\"Version\":\"v0.6.0\",\"Sum\":\"h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=\",\"Replace\":null},{\"Path\":\"golang.org/x/exp/typeparams\",\"Version\":\"v0.0.0-20221212164502-fae10dda9338\",\"Sum\":\"h1:2O2DON6y3XMJiQRAS1UWU+54aec2uopH3x7MAiqGW6Y=\",\"Replace\":null},{\"Path\":\"golang.org/x/mod\",\"Version\":\"v0.15.0\",\"Sum\":\"h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8=\",\"Replace\":null},{\"Path\":\"golang.org/x/sync\",\"Version\":\"v0.6.0\",\"Sum\":\"h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=\",\"Replace\":null},{\"Path\":\"golang.org/x/telemetry\",\"Version\":\"v0.0.0-20240209200032-7b892fcb8a78\",\"Sum\":\"h1:vcVnuftN4J4UKLRcgetjzfU9FjjgXUUYUc3JhFplgV4=\",\"Replace\":null},{\"Path\":\"golang.org/x/text\",\"Version\":\"v0.14.0\",\"Sum\":\"h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=\",\"Replace\":null},{\"Path\":\"golang.org/x/tools\",\"Version\":\"v0.18.1-0.20240412183611-d92ae0781217\",\"Sum\":\"h1:uH9jJYgeLCvblH0S+03kFO0qUDxRkbLRLFiKVVDl7ak=\",\"Replace\":null},{\"Path\":\"golang.org/x/vuln\",\"Version\":\"v1.0.1\",\"Sum\":\"h1:KUas02EjQK5LTuIx1OylBQdKKZ9jeugs+HiqO5HormU=\",\"Replace\":null},{\"Path\":\"honnef.co/go/tools\",\"Version\":\"v0.4.6\",\"Sum\":\"h1:oFEHCKeID7to/3autwsWfnuv69j3NsfcXbvJKuIcep8=\",\"Replace\":null},{\"Path\":\"mvdan.cc/gofumpt\",\"Version\":\"v0.6.0\",\"Sum\":\"h1:G3QvahNDmpD+Aek/bNOLrFR2XC6ZAdo62dZu65gmwGo=\",\"Replace\":null},{\"Path\":\"mvdan.cc/xurls/v2\",\"Version\":\"v2.5.0\",\"Sum\":\"h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8=\",\"Replace\":null}],\"Settings\":[{\"Key\":\"-buildmode\",\"Value\":\"exe\"},{\"Key\":\"-compiler\",\"Value\":\"gc\"},{\"Key\":\"DefaultGODEBUG\",\"Value\":\"httplaxcontentlength=1,httpmuxgo121=1,panicnil=1,tls10server=1,tlsrsakex=1,tlsunsafeekm=1\"},{\"Key\":\"CGO_ENABLED\",\"Value\":\"1\"},{\"Key\":\"CGO_CFLAGS\",\"Value\":\"\"},{\"Key\":\"CGO_CPPFLAGS\",\"Value\":\"\"},{\"Key\":\"CGO_CXXFLAGS\",\"Value\":\"\"},{\"Key\":\"CGO_LDFLAGS\",\"Value\":\"\"},{\"Key\":\"GOARCH\",\"Value\":\"amd64\"},{\"Key\":\"GOOS\",\"Value\":\"linux\"},{\"Key\":\"GOAMD64\",\"Value\":\"v1\"}],\"Version\":\"v0.15.3\"}"}}


[Trace - 18:31:22.756 PM] Sending notification 'initialized'.
Params: {}


[Trace - 18:31:22.756 PM] Received request 'window/workDoneProgress/create - (1)'.
Params: {"token":"5219527396410968773"}


[Trace - 18:31:24.363 PM] Sending response 'window/workDoneProgress/create - (1)' in 1606ms.
Result: 


[Trace - 18:31:24.364 PM] Received notification '$/progress'.
Params: {"token":"5219527396410968773","value":{"kind":"begin","title":"Setting up workspace","message":"Loading packages..."}}


[Trace - 18:31:24.364 PM] Received request 'workspace/configuration - (2)'.
Params: {"items":[{"scopeUri":"file:///home/eduarte","section":"gopls"}]}


[Trace - 18:31:24.497 PM] Sending response 'workspace/configuration - (2)' in 132ms.
Result: [{}]


[Trace - 18:31:24.583 PM] Received notification '$/progress'.
Params: {"token":"5219527396410968773","value":{"kind":"end","message":"Error loading packages: err: go command required, not found: exec: \"go\": executable file not found in $PATH: stderr: "}}


[Trace - 18:31:24.583 PM] Received request 'client/registerCapability - (3)'.
Params: {"registrations":[{"id":"workspace/didChangeWatchedFiles-0","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"**/*.{mod,work}","kind":7}]}}]}


[Trace - 18:31:24.680 PM] Sending response 'client/registerCapability - (3)' in 96ms.
Result: 


[Trace - 18:31:24.681 PM] Received notification 'window/showMessage'.
Params: {"type":1,"message":"Error loading workspace folders (expected 1, got 0)\nfailed to load view for file:///home/eduarte: err: go command required, not found: exec: \"go\": executable file not found in $PATH: stderr: \n"}


[Trace - 18:31:24.681 PM] Received request 'client/registerCapability - (4)'.
Params: {"registrations":[{"id":"workspace/didChangeConfiguration","method":"workspace/didChangeConfiguration"}]}


[Trace - 18:31:24.735 PM] Sending response 'client/registerCapability - (4)' in 53ms.
Result: 

templ.log:

{"level":"info","ts":"2024-05-22T18:29:40-03:00","caller":"lspcmd/main.go:76","msg":"lsp: starting up..."}
{"level":"info","ts":"2024-05-22T18:29:40-03:00","caller":"lspcmd/main.go:83","msg":"lsp: starting gopls..."}
{"level":"info","ts":"2024-05-22T18:29:40-03:00","caller":"lspcmd/main.go:96","msg":"creating gopls client"}
{"level":"info","ts":"2024-05-22T18:29:40-03:00","caller":"lspcmd/main.go:101","msg":"creating proxy"}
{"level":"info","ts":"2024-05-22T18:29:40-03:00","caller":"lspcmd/main.go:106","msg":"creating templ server"}
{"level":"info","ts":"2024-05-22T18:29:40-03:00","caller":"lspcmd/main.go:116","msg":"starting debug http server","addr":"localhost:7575"}
{"level":"info","ts":"2024-05-22T18:29:40-03:00","caller":"lspcmd/main.go:125","msg":"listening"}
{"level":"info","ts":"2024-05-22T18:29:40-03:00","caller":"proxy/server.go:204","msg":"client -> server: Initialize"}
{"level":"info","ts":"2024-05-22T18:29:41-03:00","caller":"proxy/server.go:234","msg":"client -> server: Initialize end"}
{"level":"info","ts":"2024-05-22T18:29:41-03:00","caller":"proxy/server.go:238","msg":"client -> server: Initialized"}
{"level":"info","ts":"2024-05-22T18:29:41-03:00","caller":"proxy/server.go:240","msg":"client -> server: Initialized end"}
{"level":"info","ts":"2024-05-22T18:29:41-03:00","caller":"proxy/client.go:42","msg":"client <- server: WorkDoneProgressCreate"}
{"level":"info","ts":"2024-05-22T18:29:41-03:00","caller":"proxy/server.go:602","msg":"client -> server: DidOpen","uri":"file:///home/eduarte/github/dreampicai/view/components/navigation.templ"}
{"level":"info","ts":"2024-05-22T18:29:41-03:00","caller":"proxy/server.go:626","msg":"setting source map cache contents","uri":"file:///home/eduarte/github/dreampicai/view/components/navigation.templ"}
{"level":"info","ts":"2024-05-22T18:29:41-03:00","caller":"proxy/server.go:633","msg":"client -> server: DidOpen end"}
{"level":"info","ts":"2024-05-22T18:29:41-03:00","caller":"proxy/client.go:38","msg":"client <- server: Progress"}
{"level":"info","ts":"2024-05-22T18:29:41-03:00","caller":"proxy/client.go:136","msg":"client <- server: Configuration"}
{"level":"info","ts":"2024-05-22T18:29:41-03:00","caller":"proxy/client.go:38","msg":"client <- server: Progress"}
{"level":"info","ts":"2024-05-22T18:29:41-03:00","caller":"proxy/client.go:121","msg":"client <- server: RegisterCapability"}
{"level":"info","ts":"2024-05-22T18:29:41-03:00","caller":"proxy/client.go:103","msg":"client <- server: ShowMessage","message":"Error loading workspace folders (expected 1, got 0)\nfailed to load view for file:///home/eduarte/github/dreampicai: err: go command required, not found: exec: \"go\": executable file not found in $PATH: stderr: \n"}
{"level":"info","ts":"2024-05-22T18:29:41-03:00","caller":"proxy/client.go:121","msg":"client <- server: RegisterCapability"}
{"level":"info","ts":"2024-05-22T18:29:41-03:00","caller":"proxy/client.go:42","msg":"client <- server: WorkDoneProgressCreate"}
{"level":"info","ts":"2024-05-22T18:29:41-03:00","caller":"proxy/client.go:38","msg":"client <- server: Progress"}
{"level":"info","ts":"2024-05-22T18:29:41-03:00","caller":"proxy/client.go:136","msg":"client <- server: Configuration"}
{"level":"info","ts":"2024-05-22T18:29:41-03:00","caller":"proxy/client.go:38","msg":"client <- server: Progress"}
{"level":"info","ts":"2024-05-22T18:29:41-03:00","caller":"proxy/client.go:103","msg":"client <- server: ShowMessage","message":"Error loading workspace folders (expected 1, got 0)\nfailed to load view for file:///home/eduarte/github/dreampicai/view/components: err: go command required, not found: exec: \"go\": executable file not found in $PATH: stderr: \n"}
{"level":"info","ts":"2024-05-22T18:29:41-03:00","caller":"proxy/client.go:52","msg":"client <- server: PublishDiagnostics"}
{"level":"info","ts":"2024-05-22T18:29:41-03:00","caller":"proxy/client.go:59","msg":"client <- server: PublishDiagnostics: [0]","diagnostic":{"range":{"start":{"line":2,"character":8},"end":{"line":2,"character":18}},"severity":2,"source":"go list","message":"No active builds contain /home/eduarte/github/dreampicai/view/components/navigation_templ.go: consider opening a new workspace folder containing it"}}
{"level":"info","ts":"2024-05-22T18:29:41-03:00","caller":"proxy/client.go:83","msg":"diagnostic [0] rewritten","diagnostic":{"range":{"start":{"line":0,"character":8},"end":{"line":0,"character":18}},"severity":2,"source":"go list","message":"No active builds contain /home/eduarte/github/dreampicai/view/components/navigation_templ.go: consider opening a new workspace folder containing it"}}
{"level":"info","ts":"2024-05-22T18:29:42-03:00","caller":"proxy/server.go:703","msg":"client -> server: DocumentSymbol"}
{"level":"info","ts":"2024-05-22T18:29:42-03:00","caller":"proxy/server.go:707","msg":"client -> server: DocumentSymbol end"}
{"level":"info","ts":"2024-05-22T18:29:42-03:00","caller":"proxy/server.go:274","msg":"client -> server: CodeAction"}
{"level":"info","ts":"2024-05-22T18:29:42-03:00","caller":"proxy/server.go:284","msg":"client -> server: CodeAction end"}
{"level":"info","ts":"2024-05-22T18:29:42-03:00","caller":"proxy/server.go:268","msg":"client -> server: SetTrace"}
{"level":"info","ts":"2024-05-22T18:29:42-03:00","caller":"proxy/server.go:270","msg":"client -> server: SetTrace end"}
{"level":"info","ts":"2024-05-22T18:29:42-03:00","caller":"proxy/server.go:674","msg":"client -> server: DocumentLink","uri":"file:///home/eduarte/github/dreampicai/view/components/navigation.templ"}
{"level":"info","ts":"2024-05-22T18:29:42-03:00","caller":"proxy/server.go:676","msg":"client -> server: DocumentLink end"}
{"level":"info","ts":"2024-05-22T18:29:42-03:00","caller":"proxy/server.go:717","msg":"client -> server: FoldingRanges"}
{"level":"info","ts":"2024-05-22T18:29:42-03:00","caller":"proxy/server.go:721","msg":"client -> server: FoldingRanges end"}
{"level":"info","ts":"2024-05-22T18:29:42-03:00","caller":"proxy/server.go:306","msg":"client -> server: CodeLens"}
{"level":"info","ts":"2024-05-22T18:29:42-03:00","caller":"proxy/server.go:316","msg":"client -> server: CodeLens end"}
{"level":"info","ts":"2024-05-22T18:29:42-03:00","caller":"proxy/server.go:703","msg":"client -> server: DocumentSymbol"}
{"level":"info","ts":"2024-05-22T18:29:42-03:00","caller":"proxy/server.go:707","msg":"client -> server: DocumentSymbol end"}
{"level":"info","ts":"2024-05-22T18:29:42-03:00","caller":"proxy/server.go:274","msg":"client -> server: CodeAction"}
{"level":"info","ts":"2024-05-22T18:29:42-03:00","caller":"proxy/server.go:284","msg":"client -> server: CodeAction end"}
{"level":"info","ts":"2024-05-22T18:29:42-03:00","caller":"proxy/server.go:569","msg":"client -> server: DidChangeConfiguration"}
{"level":"info","ts":"2024-05-22T18:29:42-03:00","caller":"proxy/server.go:571","msg":"client -> server: DidChangeConfiguration end"}
{"level":"info","ts":"2024-05-22T18:29:42-03:00","caller":"proxy/client.go:136","msg":"client <- server: Configuration"}
{"level":"info","ts":"2024-05-22T18:29:42-03:00","caller":"proxy/server.go:674","msg":"client -> server: DocumentLink","uri":"file:///home/eduarte/github/dreampicai/view/components/navigation.templ"}
{"level":"info","ts":"2024-05-22T18:29:42-03:00","caller":"proxy/server.go:676","msg":"client -> server: DocumentLink end"}
{"level":"info","ts":"2024-05-22T18:29:43-03:00","caller":"proxy/server.go:274","msg":"client -> server: CodeAction"}
{"level":"info","ts":"2024-05-22T18:29:43-03:00","caller":"proxy/server.go:284","msg":"client -> server: CodeAction end"}
{"level":"info","ts":"2024-05-22T18:29:43-03:00","caller":"proxy/server.go:674","msg":"client -> server: DocumentLink","uri":"file:///home/eduarte/github/dreampicai/view/components/navigation.templ"}
{"level":"info","ts":"2024-05-22T18:29:43-03:00","caller":"proxy/server.go:676","msg":"client -> server: DocumentLink end"}
{"level":"info","ts":"2024-05-22T18:29:43-03:00","caller":"proxy/server.go:306","msg":"client -> server: CodeLens"}
{"level":"info","ts":"2024-05-22T18:29:43-03:00","caller":"proxy/server.go:316","msg":"client -> server: CodeLens end"}
{"level":"info","ts":"2024-05-22T18:29:43-03:00","caller":"proxy/server.go:274","msg":"client -> server: CodeAction"}
{"level":"info","ts":"2024-05-22T18:29:43-03:00","caller":"proxy/server.go:284","msg":"client -> server: CodeAction end"}
{"level":"info","ts":"2024-05-22T18:29:43-03:00","caller":"proxy/server.go:674","msg":"client -> server: DocumentLink","uri":"file:///home/eduarte/github/dreampicai/view/components/navigation.templ"}
{"level":"info","ts":"2024-05-22T18:29:43-03:00","caller":"proxy/server.go:676","msg":"client -> server: DocumentLink end"}
{"level":"info","ts":"2024-05-22T18:29:43-03:00","caller":"proxy/server.go:703","msg":"client -> server: DocumentSymbol"}
{"level":"info","ts":"2024-05-22T18:29:43-03:00","caller":"proxy/server.go:707","msg":"client -> server: DocumentSymbol end"}
{"level":"info","ts":"2024-05-22T18:29:44-03:00","caller":"proxy/server.go:717","msg":"client -> server: FoldingRanges"}
{"level":"info","ts":"2024-05-22T18:29:44-03:00","caller":"proxy/server.go:721","msg":"client -> server: FoldingRanges end"}
{"level":"info","ts":"2024-05-22T18:29:45-03:00","caller":"proxy/server.go:306","msg":"client -> server: CodeLens"}
{"level":"info","ts":"2024-05-22T18:29:45-03:00","caller":"proxy/server.go:316","msg":"client -> server: CodeLens end"}
{"level":"info","ts":"2024-05-22T18:29:46-03:00","caller":"proxy/server.go:274","msg":"client -> server: CodeAction"}
{"level":"info","ts":"2024-05-22T18:29:46-03:00","caller":"proxy/server.go:284","msg":"client -> server: CodeAction end"}
{"level":"info","ts":"2024-05-22T18:29:51-03:00","caller":"proxy/server.go:274","msg":"client -> server: CodeAction"}
{"level":"info","ts":"2024-05-22T18:29:51-03:00","caller":"proxy/server.go:284","msg":"client -> server: CodeAction end"}
{"level":"info","ts":"2024-05-22T18:29:51-03:00","caller":"proxy/server.go:674","msg":"client -> server: DocumentLink","uri":"file:///home/eduarte/github/dreampicai/view/components/navigation.templ"}
{"level":"info","ts":"2024-05-22T18:29:51-03:00","caller":"proxy/server.go:676","msg":"client -> server: DocumentLink end"}
{"level":"info","ts":"2024-05-22T18:30:15-03:00","caller":"proxy/server.go:755","msg":"client -> server: Hover"}
{"level":"info","ts":"2024-05-22T18:30:15-03:00","caller":"proxy/server.go:74","msg":"updatePosition: found","uri":"file:///home/eduarte/github/dreampicai/view/components/navigation.templ","fromTempl":"0:18","toGo":"2:18"}
{"level":"info","ts":"2024-05-22T18:30:15-03:00","caller":"proxy/server.go:766","msg":"client -> server: Hover end"}
{"level":"info","ts":"2024-05-22T18:30:15-03:00","caller":"proxy/server.go:306","msg":"client -> server: CodeLens"}
{"level":"info","ts":"2024-05-22T18:30:15-03:00","caller":"proxy/server.go:316","msg":"client -> server: CodeLens end"}
{"level":"info","ts":"2024-05-22T18:31:01-03:00","caller":"proxy/server.go:306","msg":"client -> server: CodeLens"}
{"level":"info","ts":"2024-05-22T18:31:01-03:00","caller":"proxy/server.go:316","msg":"client -> server: CodeLens end"}
{"level":"info","ts":"2024-05-22T18:31:04-03:00","caller":"lspcmd/stdrwc.go:36","msg":"rwc: closing","name":"templStream"}
{"level":"info","ts":"2024-05-22T18:31:04-03:00","caller":"lspcmd/main.go:131","msg":"templConn closed"}
{"level":"info","ts":"2024-05-22T18:31:04-03:00","caller":"lspcmd/main.go:135","msg":"shutdown complete"}
{"level":"info","ts":"2024-05-22T18:31:04-03:00","caller":"lspcmd/stdrwc.go:36","msg":"rwc: closing","name":"templStream"}
{"level":"error","ts":"2024-05-22T18:31:04-03:00","caller":"lspcmd/stdrwc.go:40","msg":"rwc: error closing reader","name":"templStream","error":"close /dev/stdin: file already closed","stacktrace":"github.com/a-h/templ/cmd/templ/lspcmd.stdrwc.Close\n\t/home/eduarte/go/pkg/mod/github.com/a-h/[email protected]/cmd/templ/lspcmd/stdrwc.go:40\ngo.lsp.dev/jsonrpc2.(*stream).Close\n\t/home/eduarte/go/pkg/mod/go.lsp.dev/[email protected]/stream.go:225\ngo.lsp.dev/jsonrpc2.(*conn).Close\n\t/home/eduarte/go/pkg/mod/go.lsp.dev/[email protected]/conn.go:225\ngithub.com/a-h/templ/cmd/templ/lspcmd.run\n\t/home/eduarte/go/pkg/mod/github.com/a-h/[email protected]/cmd/templ/lspcmd/main.go:136\ngithub.com/a-h/templ/cmd/templ/lspcmd.Run\n\t/home/eduarte/go/pkg/mod/github.com/a-h/[email protected]/cmd/templ/lspcmd/main.go:72\nmain.lspCmd\n\t/home/eduarte/go/pkg/mod/github.com/a-h/[email protected]/cmd/templ/main.go:325\nmain.run\n\t/home/eduarte/go/pkg/mod/github.com/a-h/[email protected]/cmd/templ/main.go:54\nmain.main\n\t/home/eduarte/go/pkg/mod/github.com/a-h/[email protected]/cmd/templ/main.go:21\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:271"}
{"level":"error","ts":"2024-05-22T18:31:04-03:00","caller":"lspcmd/stdrwc.go:46","msg":"rwc: error closing writer","name":"templStream","error":"close /dev/stdout: file already closed","stacktrace":"github.com/a-h/templ/cmd/templ/lspcmd.stdrwc.Close\n\t/home/eduarte/go/pkg/mod/github.com/a-h/[email protected]/cmd/templ/lspcmd/stdrwc.go:46\ngo.lsp.dev/jsonrpc2.(*stream).Close\n\t/home/eduarte/go/pkg/mod/go.lsp.dev/[email protected]/stream.go:225\ngo.lsp.dev/jsonrpc2.(*conn).Close\n\t/home/eduarte/go/pkg/mod/go.lsp.dev/[email protected]/conn.go:225\ngithub.com/a-h/templ/cmd/templ/lspcmd.run\n\t/home/eduarte/go/pkg/mod/github.com/a-h/[email protected]/cmd/templ/lspcmd/main.go:136\ngithub.com/a-h/templ/cmd/templ/lspcmd.Run\n\t/home/eduarte/go/pkg/mod/github.com/a-h/[email protected]/cmd/templ/lspcmd/main.go:72\nmain.lspCmd\n\t/home/eduarte/go/pkg/mod/github.com/a-h/[email protected]/cmd/templ/main.go:325\nmain.run\n\t/home/eduarte/go/pkg/mod/github.com/a-h/[email protected]/cmd/templ/main.go:54\nmain.main\n\t/home/eduarte/go/pkg/mod/github.com/a-h/[email protected]/cmd/templ/main.go:21\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:271"}
{"level":"info","ts":"2024-05-22T18:31:22-03:00","caller":"lspcmd/main.go:76","msg":"lsp: starting up..."}
{"level":"info","ts":"2024-05-22T18:31:22-03:00","caller":"lspcmd/main.go:83","msg":"lsp: starting gopls..."}
{"level":"info","ts":"2024-05-22T18:31:22-03:00","caller":"lspcmd/main.go:96","msg":"creating gopls client"}
{"level":"info","ts":"2024-05-22T18:31:22-03:00","caller":"lspcmd/main.go:101","msg":"creating proxy"}
{"level":"info","ts":"2024-05-22T18:31:22-03:00","caller":"lspcmd/main.go:106","msg":"creating templ server"}
{"level":"info","ts":"2024-05-22T18:31:22-03:00","caller":"lspcmd/main.go:116","msg":"starting debug http server","addr":"localhost:7575"}
{"level":"info","ts":"2024-05-22T18:31:22-03:00","caller":"lspcmd/main.go:125","msg":"listening"}
{"level":"info","ts":"2024-05-22T18:31:22-03:00","caller":"proxy/server.go:204","msg":"client -> server: Initialize"}
{"level":"info","ts":"2024-05-22T18:31:22-03:00","caller":"proxy/server.go:234","msg":"client -> server: Initialize end"}
{"level":"info","ts":"2024-05-22T18:31:22-03:00","caller":"proxy/server.go:238","msg":"client -> server: Initialized"}
{"level":"info","ts":"2024-05-22T18:31:22-03:00","caller":"proxy/server.go:240","msg":"client -> server: Initialized end"}
{"level":"info","ts":"2024-05-22T18:31:22-03:00","caller":"proxy/client.go:42","msg":"client <- server: WorkDoneProgressCreate"}
{"level":"info","ts":"2024-05-22T18:31:24-03:00","caller":"proxy/client.go:38","msg":"client <- server: Progress"}
{"level":"info","ts":"2024-05-22T18:31:24-03:00","caller":"proxy/client.go:136","msg":"client <- server: Configuration"}
{"level":"info","ts":"2024-05-22T18:31:24-03:00","caller":"proxy/client.go:38","msg":"client <- server: Progress"}
{"level":"info","ts":"2024-05-22T18:31:24-03:00","caller":"proxy/client.go:121","msg":"client <- server: RegisterCapability"}
{"level":"info","ts":"2024-05-22T18:31:24-03:00","caller":"proxy/client.go:103","msg":"client <- server: ShowMessage","message":"Error loading workspace folders (expected 1, got 0)\nfailed to load view for file:///home/eduarte: err: go command required, not found: exec: \"go\": executable file not found in $PATH: stderr: \n"}
{"level":"info","ts":"2024-05-22T18:31:24-03:00","caller":"proxy/client.go:121","msg":"client <- server: RegisterCapability"}

@EduartePaiva
Copy link

So, after checking my error seems to be caused by templ not been able to call the go command?, then I removed the go path from .profile that the official go installation recommend and then added directly to my .zshrc file and everything worked fine. I'm new to go and linux so I don't really know what happened.

@rsvix
Copy link

rsvix commented May 27, 2024

i added export PATH=$PATH:/usr/local/go/bin to both .bashrc and .profile and it fixed it for me on debian WSL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working NeedsInvestigation Issue needs some investigation before being fixed vscode WaitingForMoreInfo
Projects
None yet
Development

No branches or pull requests

10 participants