Skip to content

Commit 7fd5bca

Browse files
committed
Demo to show issue
1 parent 0b44235 commit 7fd5bca

File tree

8 files changed

+62
-9
lines changed

8 files changed

+62
-9
lines changed

README.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,37 @@
1-
# Demo: Jump to defintion issue
1+
# Demo: Jump to definition issue
2+
3+
## Steps
4+
5+
- Open `test/Spec.hs`
6+
- Jump to def with `testHelper` works
7+
- Jump to def with `libraryFunction` doesn't work
8+
9+
## Known workaround
10+
11+
`package.yaml` contains
12+
13+
```yaml
14+
tests:
15+
demo-hls-jump-to-definition-test:
16+
source-dirs: test
17+
dependencies: demo-hls-jump-to-definition
18+
```
19+
20+
if `src` is additionally added as directory, it'll work.
21+
Downside: Higher compile times, redundant
22+
23+
```yaml
24+
tests:
25+
demo-hls-jump-to-definition-test:
26+
source-dirs: test
27+
dependencies: demo-hls-jump-to-definition
28+
```
29+
30+
## Versions
31+
32+
```
33+
haskell-language-server version: 0.9.0.0 (GHC: 8.8.3) (GIT hash: 6b6c405d14a29ab3d2e7dbb4e2f79229758d26ba)
34+
cabal: 3.2.0.0
35+
stack: 2.5.1
36+
ghc: 8.8.3
37+
```

Setup.hs

Lines changed: 0 additions & 2 deletions
This file was deleted.

app/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ module Main where
33
import Lib
44

55
main :: IO ()
6-
main = someFunc
6+
main = libraryFunction

demo-hls-jump-to-definition.cabal

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cabal-version: 1.12
44
--
55
-- see: https://github.com/sol/hpack
66
--
7-
-- hash: c7959c36bf6aaa8424d22c1798f778516f3aa142da2756764ed808b597794177
7+
-- hash: 9da40c309046377d92b7f821cb757c7f0e7d46ee05cb86a09cb46aa3c804eb92
88

99
name: demo-hls-jump-to-definition
1010
version: 0.1.0.0
@@ -52,6 +52,7 @@ test-suite demo-hls-jump-to-definition-test
5252
type: exitcode-stdio-1.0
5353
main-is: Spec.hs
5454
other-modules:
55+
SpecHelper
5556
Paths_demo_hls_jump_to_definition
5657
hs-source-dirs:
5758
test

hie.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
cradle:
2+
stack:
3+
- path: "./app"
4+
component: "demo-hls-jump-to-definition:exe:demo-hls-jump-to-definition-exe"
5+
- path: "./test"
6+
component: "demo-hls-jump-to-definition:test:demo-hls-jump-to-definition-test"
7+
- path: "./src"
8+
component: "demo-hls-jump-to-definition:lib"

src/Lib.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Lib
2-
( someFunc
2+
( libraryFunction
33
) where
44

5-
someFunc :: IO ()
6-
someFunc = putStrLn "someFunc"
5+
libraryFunction :: IO ()
6+
libraryFunction = putStrLn "libraryFunction"

test/Spec.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1+
import Lib ( libraryFunction )
2+
import SpecHelper ( testHelper )
3+
4+
15
main :: IO ()
2-
main = putStrLn "Test suite not yet implemented"
6+
main = do
7+
testHelper -- Jump to defintion with testHelper is working
8+
libraryFunction -- Jump to defintion with libraryFunction is not working

test/SpecHelper.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module SpecHelper where
2+
3+
testHelper :: IO ()
4+
testHelper = putStrLn "testHelp"

0 commit comments

Comments
 (0)