-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Labels
ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.gopls/completionIssues related to auto-completion in gopls.Issues related to auto-completion in gopls.
Milestone
Description
gopls version
v0.18.1
go env
irrevelantWhat did you do?
func _() {
for {
if true {
con| // | is the cursor position
}
}
}
What did you see happen?
The const is put as the best option.
What did you expect to see?
I expect to see the continue as the best option. My reason is:
- when we use
ifinside a for loop, we have more confidence typedconwants to usecontinuerather thanconst. constdeclared constants are prefered to put in file level.
Hence, I want to adjust the gopls logic for this part:
- check whether direct parent node is if-stmt
- check whether parent's ancestor has for stmt
If both of them are satisfied, provide continue with a higher score. I can help to do the code change.
Editor and settings
No response
Logs
No response
Metadata
Metadata
Assignees
Labels
ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.gopls/completionIssues related to auto-completion in gopls.Issues related to auto-completion in gopls.
