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: comment alignment #45156

Closed
ilGobbo00 opened this issue Mar 22, 2021 · 2 comments
Closed

x/tools/gopls: comment alignment #45156

ilGobbo00 opened this issue Mar 22, 2021 · 2 comments
Labels
FrozenDueToAge 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.

Comments

@ilGobbo00
Copy link

ilGobbo00 commented Mar 22, 2021

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

1.16.2 windows/amd64

Does this issue reproduce with the latest release?

Yes

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

Win10 Home 64bit

Issue Type: Bug in Vs Code

After written some code and after aligned all comments, save the file with ctrl+s cause that all comments are displayed immidiately after all row of code (all alignment disappear)

Example:

func f(){		// Create a function
	var a int = 0	// Create a variable
	a = 2 		// Change value
}

--after ctrl-s-->

func f() { // Create a function
	var a int = 0 // Create a variable
	a = 2 // Change value
}

N.B. I have already written to VsCode GitHub page and that's their response:
"@ilGobbo00 this looks like an issue caused by the Go extension. Please report the issue there."


VS Code version: Code 1.54.3 (2b9aebd5354a3629c3aba0a5f5df49f43d6689f8, 2021-03-15T10:55:45.459Z)
OS version: Windows_NT x64 10.0.19042

System Info
Item Value
CPUs AMD A8-7410 APU with AMD Radeon R5 Graphics (4 x 2196)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 6.95GB (2.10GB free)
Process Argv --crash-reporter-id 3d99b2ab-4070-4c08-a4a5-c216b98510ad
Screen Reader no
VM 0%
Extensions (14)
Extension Author (truncated) Version
god bas 0.0.100
code-runner for 0.11.3
go gol 0.23.2
kite kit 0.142.0
vscode-language-pack-it MS- 1.54.2
cpptools ms- 1.2.2
java red 0.76.0
vscodeintellicode Vis 1.2.12
vscode-java-debug vsc 0.32.0
vscode-java-dependency vsc 0.18.1
vscode-java-pack vsc 0.13.0
vscode-java-test vsc 0.28.1
vscode-maven vsc 0.28.0
clang-format xav 1.9.0
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvsdeb440:30248342
pythonvsded773:30248341
pythonvspyt875:30259475
pythontbcf:30265426
vscoresta800cf:30276762
vspre833cf:30267465
vsfjg287:30275553
vshan820cf:30276953

@seankhliao seankhliao changed the title Comment align x/tools/gopls: comment alignment Mar 22, 2021
@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 22, 2021
@gopherbot gopherbot added this to the Unreleased milestone Mar 22, 2021
@stamblerre
Copy link
Contributor

stamblerre commented Mar 30, 2021

Thanks for reporting this. When I try to reproduce it, I see the following:

package main

func f() { // Create a function
	var a int = 0 // Create a variable
	a = 2         // Change value
}

This formatting is introduced by the Go formatter, gofmt, which is the industry standard for formatting Go code. In general, I would always suggest formatting your code in the same way as gofmt does.

Still, can you please share your gopls logs? Information on how to capture them can be found here.

@stamblerre stamblerre added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Mar 30, 2021
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v1.0.0 Mar 30, 2021
@ilGobbo00
Copy link
Author

First of all thanks for the answer. I have understood the align system so the issue was my miss understanding of the system.
May I suggest to align the comments, after the begging of functions, to the rest of the comments below?
Have a nice day, regards. :D

@stamblerre stamblerre removed this from the gopls/v1.0.0 milestone Mar 30, 2021
@golang golang locked and limited conversation to collaborators Mar 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge 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