haskell / haskell/haskell-mode

haskell-mode-find-def failing; additional quote characters needed; fix included

Open
#1,856 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.