Skip to content

Data.Text.Internal.Fusion.Common.index: Index too large #2602

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fendor opened this issue Jan 18, 2022 · 8 comments · Fixed by #2629
Closed

Data.Text.Internal.Fusion.Common.index: Index too large #2602

fendor opened this issue Jan 18, 2022 · 8 comments · Fixed by #2629
Labels
status: needs triage type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@fendor
Copy link
Collaborator

fendor commented Jan 18, 2022

Your environment

Which OS do you use: Ubuntu
Which LSP client (editor/plugin) do you use: VSCode
Describe your project (alternative: link to the project):
bios project with custom hie.yaml. I do not believe the project itself is important, but it does use TH.

Noticeably, this HLS version is installed via nix, is based on the hackage release 1.5.1, and applies the patch #2359.

Steps to reproduce

Open HLS and perform some arbitrary editing of files.

Expected behaviour

HLS should be happy and report diagnostics.

Actual behaviour

Stops responding and shows no diagnostics any more. Logs contain:

haskell-language-server: Data.Text.Internal.Fusion.Common.index: Index too large
CallStack (from HasCallStack):
  error, called at libraries/text/src/Data/Text/Internal/Fusion/Common.hs:943:24 in text-1.2.4.1:Data.Text.Internal.Fusion.Common

Include debug information

Since HLS has been installed via nix, I am not sure at the moment, whether an outdated dependency might cause the issue.
The error was thrown while all non-essential plugins were disabled via the VSCode settings.

@fendor fendor added type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. status: needs triage labels Jan 18, 2022
@jneira
Copy link
Member

jneira commented Jan 18, 2022

I've just seen this issue: #2149 which is reporting the same error 😟

@fendor
Copy link
Collaborator Author

fendor commented Jan 18, 2022

Ah, I knew I've seen this before! Unfortunately, no solution yet.
Going to run with profiling mode to get a proper stack-trace.

@fendor
Copy link
Collaborator Author

fendor commented Jan 18, 2022

According to #2149, the first commit with this issue is: 9c40dcf

@drsooch
Copy link
Collaborator

drsooch commented Jan 22, 2022

Just ran into this. Can't tell when the error fired (wasn't paying attention). I've been working on TypeLenses.hs from ghcide/src/development/ide/plugin/. On Emacs with all plugins enabled (plus a WIP plugin).

@Bodigrim
Copy link
Contributor

openingBacktick :: T.Text -> T.Text -> T.Text -> Position -> Bool
openingBacktick line prefixModule prefixText Position { _character=(fromIntegral -> c) }
| backtickIndex < 0 || backtickIndex > T.length line = False
| otherwise = (line `T.index` backtickIndex) == '`'

This is wrong, should be backtickIndex >= T.length line.

@Bodigrim
Copy link
Contributor

(I'll appreciate if someone else raises a PR)

@pepeiborra
Copy link
Collaborator

Raised #2629

@fendor
Copy link
Collaborator Author

fendor commented Jan 23, 2022

At the same time, I raised #2630 :D

I was slower, so closed in favour of #2629

@mergify mergify bot closed this as completed in #2629 Jan 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
5 participants