haskell / haskell/haskell-mode
haskell-mode-find-def failing; additional quote characters needed; fix included
- Dominant language
- Emacs Lisp
- Stars
- 1.4k
- Forks
- 354
- Avg merge
- 5d 10h
- Merged PRs (30d)
- 2
Description
With recent versions of GHC, the :info name command returns a module name in quotes that are unicode characters (in particular x2018 ‘ and x2019 ’). The matching in `haskell-mode-find-def` only has the ASCII `' quotes.
In line 443 in the current HEAD
```
(string-match "`\\(.+?\\):\\(.+?\\)'$" defined)
```
could be changed to
```
(string-match "[`‘]\\(.+?\\):\\(.+?\\)['’]$" defined)
```
and in line 448 in the current HEAD
```
(string-match "`\\(.+?\\)'$" defined))
```
could be changed to
```
(string-match "[`‘]\\(.+?\\)['’]$" defined)
```
When making these changes only, `haskell-mode-find-def` now works, whereas before it returned `nil`.
Contributor guide
Research direction
Start at haskell-mode-find-def and inspect the matching expressions around lines 443 and 448. Reproduce the recent GHC :info name output with its Unicode quotation marks, then verify that the function returns a definition instead of nil for that output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- emacs-lisp, haskell
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100