haskell / haskell/vscode-haskell

"Redundant bracket" quickfix deletes first line of file

Open
#1,183 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
597
Forks
98
PR merge metrics
No merged PRs in 30d

Description

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

```

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in VS Code using the Haskell file and the “redundant bracket” quick fix described above. Trace the quick-fix edit and verify that applying it removes only the brackets, preserves the shebang and other lines, and is covered by a regression test if the project has an applicable test location.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell, typescript, vscode
Domain
devtools, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.