Skip to content

Commit 39303d6

Browse files
authored
fix(lsp): suppress gopls warning about editing generated file (#1221, fixes #1200)
1 parent 79a8e2f commit 39303d6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmd/templ/lspcmd/proxy/client.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ func (p Client) Progress(ctx context.Context, params *lsp.ProgressParams) (err e
3838
p.Log.Info("client <- server: Progress")
3939
return p.Target.Progress(ctx, params)
4040
}
41+
4142
func (p Client) WorkDoneProgressCreate(ctx context.Context, params *lsp.WorkDoneProgressCreateParams) (err error) {
4243
p.Log.Info("client <- server: WorkDoneProgressCreate")
4344
return p.Target.WorkDoneProgressCreate(ctx, params)
@@ -103,6 +104,9 @@ func (p Client) ShowMessage(ctx context.Context, params *lsp.ShowMessageParams)
103104
if strings.HasPrefix(params.Message, "Do not edit this file!") {
104105
return
105106
}
107+
if strings.HasPrefix(params.Message, "Warning: editing") {
108+
return
109+
}
106110
return p.Target.ShowMessage(ctx, params)
107111
}
108112

0 commit comments

Comments
 (0)