-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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
x/tools/gopls: spurious errors from template files (umbrella issue) #50602
Comments
Development of Gitea is also affected by this. Is there any way of excluding linting of individual template files or even directories? We have some template files which aren't even intended to be go templates and it's even linting files within vendor and probably in node_modules. Unfortunately:
Is ignored by the template linter and disappointingly it seems like the only solution at present to prevent missing other more serious go errors is to simply turn off template linting through:
|
Hi, for now yes the best solution is to turn off template linting, as you have found. We will prioritize fixing this for the next release (both honoring the directoryFilters, and fixing the spurious 'empty buffer' errors) CC @pjweinbgo |
And I should also add: apologies for the breakage. |
the other possible way is to disable template association using
p.s. the templates in questions used for tests and intentionally empty, if that helps to triage the bug. |
cc @pjweinb |
Renamed this to be a parent issue tracking spurious errors from template files. Leaving it in vscode-go because I suspect there may be some vscode changes required as well. |
Isn't this a gopls (rather than vscode-go) error?
…On Tue, Jan 4, 2022 at 10:38 AM findleyr ***@***.***> wrote:
Renamed this to be a parent issue tracking spurious errors from template
files.
—
Reply to this email directly, view it on GitHub
<https://github.com/golang/vscode-go/issues/1957#issuecomment-1004914437>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACL4QJESWOOAUXNJXONUWKLUUMH65ANCNFSM5KOROTBA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@pjweinbgo yes the errors are coming from gopls. It intersects with vscode-go in the mutually conflicting configuration: I think it's worth leaving this here to track the overarching problem of improving the resolution of template files in vscode, but don't feel strongly. |
Change https://golang.org/cl/375874 mentions this issue: |
Change https://golang.org/cl/376037 mentions this issue: |
Change https://golang.org/cl/376854 mentions this issue: |
Change https://golang.org/cl/376854 mentions this issue: |
Change https://golang.org/cl/378354 mentions this issue: |
Change https://golang.org/cl/378355 mentions this issue: |
Not entirely resolved yet: the CL stack above enabled setting the default templateExtensions to []. |
Change https://golang.org/cl/378314 mentions this issue: |
Change https://golang.org/cl/378394 mentions this issue: |
Honor the file kind provided by clients for overlays, by passing the FileHandle into View.FileKind and checking for overlays. For golang/vscode-go#1957 Change-Id: I4a767cb64dc5205f1d10c3126a2cbe67c21a34e4 Reviewed-on: https://go-review.googlesource.com/c/tools/+/378314 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Suzy Mueller <suzmue@golang.org>
Now that we honor the template file kind provided by LSP clients, we need to use this to derive the set of active templates. For golang/vscode-go#1957 Change-Id: If0883b2acff746fe6d187124b939f3a2d0e0d4f2 Reviewed-on: https://go-review.googlesource.com/c/tools/+/378354 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Suzy Mueller <suzmue@golang.org> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Having the explicit skipTemplate guard should not be necessary, since with templateExtensions empty we should not detect any templates that the user did not ask for. Remove it For golang/vscode-go#1957 Change-Id: Idbe30bc61f47ed405d98fdb029f44a0841769ad0 Reviewed-on: https://go-review.googlesource.com/c/tools/+/378355 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Suzy Mueller <suzmue@golang.org> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
There is no standard for go template file extensions, and users may not want this functionality. Make template support opt-in by changing the default value of templateExtensions to be []. Updates golang/vscode-go#1957 Change-Id: I7e37d22b1bc63d8300634b3b0394b4036b43fa49 Reviewed-on: https://go-review.googlesource.com/c/tools/+/375874 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Suzy Mueller <suzmue@golang.org> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Transferring this to the Go issue tracker for milestone tracking. |
fix coming soon.
…On Thu, Jan 13, 2022 at 7:10 PM achamoux ***@***.***> wrote:
[image: VSCode_error_in_packages_golang-1-17]
<https://user-images.githubusercontent.com/32041339/146828023-a0740b29-2649-431f-a4e5-ad024d729d74.PNG>
What version of Go, VS Code & VS Code Go extension are you using? Version
Information
- Run go version to get version of Go from *the VS Code integrated
terminal*.
-
- Run gopls -v version to get version of Gopls from *the VS Code
integrated terminal*.
-
- Run code -v or code-insiders -v to get version of VS Code or VS Code
Insiders.
-
- Check your installed extensions to get the version of the VS Code Go
extension
-
- Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go
Tools command.
-
Share the Go related settings you have added/edited
Run Preferences: Open Settings (JSON) command to open your settings.json
file.
Share all the settings with the go. or ["go"] or gopls prefixes.
Describe the bug
A clear and concise description of what the bug.
A clear and concise description of what you expected to happen.
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. See error
Screenshots or recordings
If applicable, add screenshots or recordings to help explain your problem.
I'm using Go 1.17 in Windows 10 64
—
Reply to this email directly, view it on GitHub
<#50602>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJIAI6EBJNIJ4J6LGSKLV3UV5SWBANCNFSM5L5J4V5A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
go version
to get version of Go from the VS Code integrated terminal.gopls -v version
to get version of Gopls from the VS Code integrated terminal.code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.Go: Locate Configured Go Tools
command.Share the Go related settings you have added/edited
Run
Preferences: Open Settings (JSON)
command to open your settings.json file.Share all the settings with the
go.
or["go"]
orgopls
prefixes.Describe the bug
A clear and concise description of what the bug.
A clear and concise description of what you expected to happen.
Steps to reproduce the behavior:
Screenshots or recordings
If applicable, add screenshots or recordings to help explain your problem.
I'm using Go 1.17 in Windows 10 64
The text was updated successfully, but these errors were encountered: