haskell / haskell/haskell-language-server
HLS deletes shebang line
- Dominant language
- Haskell
- Stars
- 3k
- Forks
- 455
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 12
Description
HLS deletes the shebang line in single file scripts when accepting a suggestion.
### Your environment
**Which OS do you use?**
Windows WSL2 running CentOS Stream 9
**Which version of GHC do you use and how did you install it?**
GHC 9.4.8 from ghcup
**Which LSP client (editor/plugin) do you use?**
vscode haskell
**Which version of HLS do you use and how did you install it?**
HLS 2.7.0.0 from ghcup
### Steps to reproduce
Use the following the code:
```
#!/usr/bin/env cabal
{- cabal:
default-language: GHC2021
build-depends:
base ^>=4.17.0.0,
-}
main :: IO ()
main = print $ fmap (\x -> x + 1) [1,2,3]
```

Accept the suggestion.
### Expected behaviour
```
#!/usr/bin/env cabal
default-language: GHC2021
{- cabal:
default-language: GHC2021
build-depends:
base ^>=4.17.0.0,
-}
main :: IO ()
main = print $ fmap (+ 1) [1,2,3]
```
### Actual behaviour
```
{- cabal:
default-language: GHC2021
build-depends:
base ^>=4.17.0.0,
-}
main :: IO ()
main = print $ fmap (+ 1) [1,2,3]
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.