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

"Redundant bracket" quickfix deletes first line of file

Open squarespirit opened this issue 11 months ago • 4 comments

Type: Bug

To reproduce: Create a new file with

#!/usr/bin/env stack
-- stack script --snapshot lts-22.28

main = (putStrLn "Hello World")

Mouseover the redundant brackets > Quick fix > Apply hint: redundant bracket

Expected: the brackets get deleted Actual: The first line of the file gets deleted also.

Extension version: 2.4.4 VS Code version: Code 1.96.0 (Universal) (138f619c86f1199955d53b4166bef66ef252935c, 2024-12-11T02:29:09.626Z) OS version: Darwin arm64 23.3.0 Modes:

System Info
Item Value
CPUs Apple M3 Pro (11 x 2400)
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: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 4, 3, 3
Memory (System) 18.00GB (1.89GB free)
Process Argv --crash-reporter-id 865ffc34-d8f2-4754-b968-a881341d18fe
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
vscaac:30438847
c4g48928:30535728
azure-dev_surveyone:30548225
2i9eh265:30646982
962ge761:30959799
pythonnoceb:30805159
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
dvdeprecation:31068756
dwnewjupyter:31046869
nativerepl2:31139839
pythonrstrctxt:31112756
nativeloc2:31192216
cf971741:31144450
iacca1:31171482
notype1:31157159
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530
6074i472:31201624

squarespirit avatar Dec 17 '24 06:12 squarespirit

FYI this is not really an issue with vscode-haskell - it more closely related to haskell-language-server, which contains hlint plugin, which in turn uses apply-refact library to apply automatic fixes to some hlint warnings. The issue has been reported in apply-refact repo some time ago: https://github.com/mpickering/apply-refact/issues/140

jhrcek avatar Dec 17 '24 07:12 jhrcek

Hi, thank you for bug report!

I think the same issue is reported at https://github.com/haskell/haskell-language-server/issues/4143

fendor avatar Dec 17 '24 09:12 fendor

Thanks, didn't realize to check those repos.

squarespirit avatar Dec 18 '24 02:12 squarespirit

No worries!

I am closing this as a duplicate of https://github.com/haskell/haskell-language-server/issues/4143, though. Feel free to reopen or open other issues if you think we've missed something!

fendor avatar Dec 18 '24 08:12 fendor