Skip to content

Tab character incorrectly assumed to be composed of 8 characters #1987

Open
@LiraOnGithub

Description

@LiraOnGithub

Your environment

Output of haskell-language-server --probe-tools or haskell-language-server-wrapper --probe-tools:

haskell-language-server version: 1.0.0.0 (GHC: 8.10.4) (PATH: [MYHOME]/.ghcup/bin/haskell-language-server-wrapper-1.0.0) (GIT hash: 4cd1cf934638881e52b3eba9f70157a4b799c0e9)
Tool versions found on the $PATH
cabal:          3.4.0.0
stack:          2.7.1
ghc:            8.6.5

Which OS do you use: Ubuntu

Which lsp-client do you use: Vim with Coc

Describe your project (alternative: link to the project): stack-project

Contents of hie.yaml:

cradle:
  stack:
      component: "name-of-project:lib"

Steps to reproduce

Type the following code

module Test where

main :: IO ()
main = do
	putStr "hello" -- there is a tab-character (\t) in front of putStr

And request information about putStr

Expected behaviour

I should get a pop-up with type information and a short description.

Actual behaviour

I get a pop-up about IO instead.
If I put my cursor further ahead, over the string "hello", I do get information about putStr. It seems HLS treats a tab as 8 separate characters. Setting a tab-size of 8 does not help, since it is still one character.

Include debug information

Paste the logs from the lsp-client, e.g. for VS Code

LSP logs: The first part is when the cursor is on `putStr` and gives information about `IO`, the second part is when the cursor is on the last part of "hello" and gives information about `putStr`

File: hls-output.txt

Gist: hls-output.txt gist

Please let me know if you need more of the output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: ghcidetype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions