Skip to content

Commit

Permalink
cmd/templ/lspcmd/proxy: append ';templ' in initialize client info
Browse files Browse the repository at this point in the history
This allows gopls to recognize gopls instances serving for templ
and count separately in go telemetry data processing.
  • Loading branch information
hyangah committed Oct 24, 2024
1 parent bb5e41b commit 69b3826
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cmd/templ/lspcmd/proxy/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ func (p *Server) parseTemplate(ctx context.Context, uri uri.URI, templateText st
func (p *Server) Initialize(ctx context.Context, params *lsp.InitializeParams) (result *lsp.InitializeResult, err error) {
p.Log.Info("client -> server: Initialize")
defer p.Log.Info("client -> server: Initialize end")
params.ClientInfo.Name += ";templ" // e.g. "Visual Studio Code;templ"
result, err = p.Target.Initialize(ctx, params)
if err != nil {
p.Log.Error("Initialize failed", zap.Error(err))
Expand Down

0 comments on commit 69b3826

Please sign in to comment.