Skip to content
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: gopls formatter incorrect indentation for closing curly bracket inside if condition evaluation clause #51806

Closed
bboysnick5 opened this issue Mar 19, 2022 · 2 comments
Labels
FrozenDueToAge gopls/corruption Issues related to file corruption in gopls gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@bboysnick5
Copy link

bboysnick5 commented Mar 19, 2022

What version of Go are you using (go version)?

$ go version

1.17.8

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

windows vscode go extension

What did you do?

if err := foo.bar(42, 42).On(func() error {
	return nil
}); err != nil {
	return newError("failed to find an available destination").Base(err).AtWarning()
}

What did you expect to see?

if err := foo.bar(42, 42).On(func() error {
	return nil
        }); 
        err != nil {
	return newError("failed to find an available destination").Base(err).AtWarning()
}
// illustrative. solution should be way better than this. 

The err variable is inside the if statement scope hence the closing curly bracket at line 3 should not match the indentation of the outer if otherwise confusing.

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Mar 19, 2022
@gopherbot gopherbot added this to the Unreleased milestone Mar 19, 2022
@findleyr
Copy link
Contributor

Hi, thanks for the report. This is almost certainly a bug in gopls' handling of edits on windows, or perhaps conflicting formatters. If this is reproducible on your end, would you be able to send us the full gopls RPC logs from a session that reproduces the bug? Instructions here:
https://github.com/golang/vscode-go/blob/master/docs/troubleshooting.md#collect-gopls-information

@findleyr findleyr added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Mar 21, 2022
@findleyr findleyr modified the milestones: Unreleased, gopls/on-deck Apr 5, 2022
@findleyr findleyr added the gopls/corruption Issues related to file corruption in gopls label Apr 11, 2022
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@findleyr findleyr closed this as not planned Won't fix, can't repro, duplicate, stale Jul 1, 2022
@golang golang locked and limited conversation to collaborators Jul 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls/corruption Issues related to file corruption in gopls gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants