You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
In #1425 (which fixes #1295), VSCode will show a warning if the first line of the code contains the comment matching ^// Code generated .* DO NOT EDIT\.$. However, as specified in https://golang.org/pkg/cmd/go/internal/generate/, this comment can appear anywhere, so it is wrong to just detect the first line.
To convey to humans and machine tools that code is generated, generated source should have a line that matches the following regular expression (in Go syntax):
^//Codegenerated.*DONOTEDIT\.$
The line may appear anywhere in the file, but is typically placed near the beginning so it is easy to find.
The text was updated successfully, but these errors were encountered:
#1425 was a best effort made under the circumstances to provide a warning.
In order to support the DO NOT EDIT comment on any line, we will have to parse the entire file which I would prefer not to do as it can get expensive on very large files.
Now that we have support for language servers, they are in a better state to handle parsed file contents.
In #1425 (which fixes #1295), VSCode will show a warning if the first line of the code contains the comment matching
^// Code generated .* DO NOT EDIT\.$
. However, as specified in https://golang.org/pkg/cmd/go/internal/generate/, this comment can appear anywhere, so it is wrong to just detect the first line.The text was updated successfully, but these errors were encountered: