vscode-go icon indicating copy to clipboard operation
vscode-go copied to clipboard

Error duplicating functions after deleting a file

Open massarakhsh opened this issue 1 year ago • 2 comments

Type: Bug

In a go project, the function description is transferred to another file, and the source file is deleted. After that, the "Duplicate function" error is fixed before exporting the branch

Extension version: 0.42.1 VS Code version: Code 1.94.0 (d78a74bcdfad14d5d3b1b782f87255d802b57511, 2024-10-02T13:08:12.626Z) OS version: Linux x64 5.15.0-122-generic Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz (8 x 3774)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
webnn: disabled_off
Load (avg) 1, 1, 1
Memory (System) 7.60GB (3.57GB free)
Process Argv --crash-reporter-id b7cb3dd1-70e5-4f26-b141-2ee2914d2dee
Screen Reader no
VM 0%
DESKTOP_SESSION cinnamon
XDG_CURRENT_DESKTOP X-Cinnamon
XDG_SESSION_DESKTOP cinnamon
XDG_SESSION_TYPE x11
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
pythonnoceb:30805159
asynctok:30898717
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
0ee40948:31013168
a69g1124:31058053
dvdeprecation:31068756
dwnewjupytercf:31046870
impr_priority:31102340
nativerepl2:31139839
refactort:31108082
pythonrstrctxt:31112756
flightc:31134773
wkspc-onlycs-t:31132770
nativeloc1:31134641
wkspc-ranged-t:31151552
cf971741:31144450
defaultse:31146405
iacca1:31150322
notype1cf:31151524
5fd0e150:31146321

massarakhsh avatar Oct 06 '24 14:10 massarakhsh

Can confirm this bug happens.

vscode-go sees files even if they are deleted, which leads to a lot of "function already declared" errors.

Restarting vscode doesn't help, clearing edit history doesn't help, restarting gopls doesn't help.

Edit: seems deleting the build cache and restarting vscode works maybe even only restarting vscode

sandbankdisperser avatar Oct 19 '24 08:10 sandbankdisperser

I see errors like this fairly often when switching branches in git. It may happen more/exclusively when I use the CLI to switch but I'm not sure. I'm pretty sure this is a gopls bug, not a vscode-go bug.

firelizzard18 avatar Oct 19 '24 17:10 firelizzard18

I don't believe this specific instance is a gopls bug, as if it were restarting gopls would fix the problem. I think VS Code is holding files open.

@sandbankdisperser when you say "deleting the build cache", can you clarify exactly what you mean? I would expect that simply restarting VS Code would fix the problem.

findleyr avatar Oct 24 '24 19:10 findleyr

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.)

gopherbot avatar Nov 25 '24 13:11 gopherbot