Skip to content
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

(wrong-type-argument hash-table-p nil) when renaming with Haskell Language Server #4473

Open
2 of 3 tasks
dschrempf opened this issue Jun 10, 2024 · 1 comment
Open
2 of 3 tasks
Labels

Comments

@dschrempf
Copy link

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain

Bug description

When trying to lsp-rename a symbol in Haskell (Haskell Language Server, lsp-haskell), I get the following error:

(wrong-type-argument hash-table-p nil) (see also backtrace below).

The lsp-mode logs indicate the language server is not giving a proper response. Is that so?

Steps to reproduce

See above.

Expected behavior

Symbol can be renamed.

Which Language Server did you use?

Haskell Language Server with lsp-haskell.

OS

Linux

Error callstack

Debugger entered--Lisp error: (wrong-type-argument hash-table-p nil)
  lsp--position-to-point(nil)
  lsp--range-to-region(nil)
  lsp--get-symbol-to-rename()
  byte-code("\300\301 !C\207" [lsp--read-rename lsp--get-symbol-to-rename] 2)
  command-execute(lsp-rename)

LSP-log:
[Trace - 09:32:04 AM] Sending request 'textDocument/prepareRename - (4509)'.
Params: {
  "textDocument": {
    "uri": "file:///home/dominik/scratch/haskell/app/Scratch.hs"
  },
  "position": {
    "line": 27,
    "character": 25
  }
}


[Trace - 09:32:04 AM] Received response 'textDocument/prepareRename - (4509)' in 1ms.
Result: {
  "defaultBehavior": true
}


[Trace - 09:32:47 AM] Sending request 'textDocument/hover - (4510)'.
Params: {
  "textDocument": {
    "uri": "file:///home/dominik/scratch/haskell/app/Scratch.hs"
  },
  "position": {
    "line": 27,
    "character": 25
  }
}

[Trace - 09:32:47 AM] Sending request 'textDocument/codeAction - (4511)'.
Params: {
  "textDocument": {
    "uri": "file:///home/dominik/scratch/haskell/app/Scratch.hs"
  },
  "range": {
    "start": {
      "line": 27,
      "character": 25
    },
    "end": {
      "line": 27,
      "character": 25
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 09:32:47 AM] Received response 'textDocument/codeAction - (4511)' in 3ms.
Result: []

Anything else?

No response

@dschrempf dschrempf added the bug label Jun 10, 2024
@vst
Copy link

vst commented Jun 13, 2024

I am getting a slightly different error message.

In my case, the stack shows one more function call (lsp--line-character-to-point(nil nil)) that results in:

wrong-type-argument number-or-marker-p nil

... instead of:

wrong-type-argument hash-table-p nil

... as reported in the original bug report.

In case that it matters: I am using emacs-lsp-booster as well.

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  lsp--line-character-to-point(nil nil)
  lsp--position-to-point(nil)
  lsp--range-to-region(nil)
  lsp--get-symbol-to-rename()
  byte-code("\300\301 !C\207" [lsp--read-rename lsp--get-symbol-to-rename] 2)
  command-execute(lsp-rename)
LSP :: lsp-mode 20240610.524, Emacs 29.3, gnu/linux
  "clientInfo": {
    "name": "emacs",
    "version": "GNU Emacs 29.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cairo version 1.18.0)"
  }
[Trace - 09:52:52 AM] Sending request 'textDocument/prepareRename - (68)'.
Params: {
  "textDocument": {
    "uri": "file:///<REDACTED>/Repositories/Assessment.hs"
  },
  "position": {
    "line": 739,
    "character": 19
  }
}


[Trace - 09:52:52 AM] Received response 'textDocument/prepareRename - (68)' in 1ms.
Result: {
  "defaultBehavior": true
}


[Trace - 09:52:54 AM] Sending request 'textDocument/codeAction - (69)'.
Params: {
  "textDocument": {
    "uri": "file:///<REDACTED>/Repositories/Assessment.hs"
  },
  "range": {
    "start": {
      "line": 739,
      "character": 19
    },
    "end": {
      "line": 739,
      "character": 19
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 09:52:54 AM] Received response 'textDocument/codeAction - (69)' in 81ms.
Result: []

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants