diff --git a/internal/lsp/command/command_gen.go b/internal/lsp/command/command_gen.go index 5980f353ca..d3dbfd5125 100644 --- a/internal/lsp/command/command_gen.go +++ b/internal/lsp/command/command_gen.go @@ -2,6 +2,10 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Don't include this file during code generation, or it will break the build +// if existing interface methods have been modified. +// +build !generate + package command // Code generated by generate.go. DO NOT EDIT. diff --git a/internal/lsp/command/generate/generate.go b/internal/lsp/command/generate/generate.go index d206e22cec..d31b437489 100644 --- a/internal/lsp/command/generate/generate.go +++ b/internal/lsp/command/generate/generate.go @@ -20,6 +20,10 @@ const src = `// Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Don't include this file during code generation, or it will break the build +// if existing interface methods have been modified. +// +build !generate + package command // Code generated by generate.go. DO NOT EDIT. diff --git a/internal/lsp/command/interface.go b/internal/lsp/command/interface.go index cbfa1c57f5..4f068fa777 100644 --- a/internal/lsp/command/interface.go +++ b/internal/lsp/command/interface.go @@ -12,7 +12,7 @@ // also provided by this package, via code generation. package command -//go:generate go run generate.go +//go:generate go run -tags=generate generate.go import "golang.org/x/tools/internal/lsp/protocol"