Skip to content

Commit d34205c

Browse files
authored
Hover tool (#18)
* Hover tool * test edit * fix * edit * update snaps * log version * change rust-analyzer install * update snaps
1 parent 455e7ad commit d34205c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1175
-279
lines changed

.github/workflows/go.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,10 @@ jobs:
100100
override: true
101101

102102
- name: Install rust-analyzer
103-
run: |
104-
mkdir -p ~/.local/bin
105-
curl -L https://github.com/rust-analyzer/rust-analyzer/releases/latest/download/rust-analyzer-x86_64-unknown-linux-gnu.gz | gunzip -c - > ~/.local/bin/rust-analyzer
106-
chmod +x ~/.local/bin/rust-analyzer
107-
echo "$HOME/.local/bin" >> $GITHUB_PATH
103+
run: rustup component add rust-analyzer
104+
105+
- run: rustc --version
106+
- run: rust-analyzer --version
108107

109108
- name: Run Rust integration tests
110109
run: go test ./integrationtests/languages/rust/...
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
```go
2+
const SharedConstant untyped string = "shared value"
3+
```
4+
5+
---
6+
7+
SharedConstant is used in multiple files
8+
9+
10+
---
11+
12+
[`main.SharedConstant` on pkg.go.dev](https://pkg.go.dev/github.com/isaacphi/mcp-language-server/integrationtests/test-output/go/workspace#SharedConstant)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
```go
2+
type SharedStruct struct {
3+
ID int
4+
Name string
5+
Value float64
6+
Constants []string
7+
}
8+
```
9+
10+
---
11+
12+
SharedStruct is a struct used across multiple files
13+
14+
15+
```go
16+
func (s *SharedStruct) GetName() string
17+
func (s *SharedStruct) Method() string
18+
func (s *SharedStruct) Process() error
19+
```
20+
21+
---
22+
23+
[`main.SharedStruct` on pkg.go.dev](https://pkg.go.dev/github.com/isaacphi/mcp-language-server/integrationtests/test-output/go/workspace#SharedStruct)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
```go
2+
type SharedInterface interface { // size=16 (0x10)
3+
Process() error
4+
GetName() string
5+
}
6+
```
7+
8+
---
9+
10+
SharedInterface defines behavior implemented across files
11+
12+
13+
---
14+
15+
[`main.SharedInterface` on pkg.go.dev](https://pkg.go.dev/github.com/isaacphi/mcp-language-server/integrationtests/test-output/go/workspace#SharedInterface)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
No hover information available for this position on the following line:
2+
import "fmt"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
failed to get hover information: request failed: line number 999 out of range 0-40 (code: 0)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
```go
2+
type SharedStruct struct {
3+
ID int
4+
Name string
5+
Value float64
6+
Constants []string
7+
}
8+
```
9+
10+
---
11+
12+
SharedStruct is a struct used across multiple files
13+
14+
15+
```go
16+
func (s *SharedStruct) GetName() string
17+
func (s *SharedStruct) Method() string
18+
func (s *SharedStruct) Process() error
19+
```
20+
21+
---
22+
23+
[`main.SharedStruct` on pkg.go.dev](https://pkg.go.dev/github.com/isaacphi/mcp-language-server/integrationtests/test-output/go/workspace#SharedStruct)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
```go
2+
type SharedStruct struct { // size=56 (0x38)
3+
ID int
4+
Name string
5+
Value float64
6+
Constants []string
7+
}
8+
```
9+
10+
---
11+
12+
SharedStruct is a struct used across multiple files
13+
14+
15+
```go
16+
func (s *SharedStruct) GetName() string
17+
func (s *SharedStruct) Method() string
18+
func (s *SharedStruct) Process() error
19+
```
20+
21+
---
22+
23+
[`main.SharedStruct` on pkg.go.dev](https://pkg.go.dev/github.com/isaacphi/mcp-language-server/integrationtests/test-output/go/workspace#SharedStruct)

integrationtests/fixtures/snapshots/python/definition/class.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ End Position: Line 59, Column 22
3131
41| return self.value
3232
42|
3333
43| @staticmethod
34-
44| def static_method(items: List[str]) -> Dict[str, int]:
34+
44| def static_method(items: list[str]) -> dict[str, int]:
3535
45| """Convert a list of items to a dictionary with item counts.
3636
46|
3737
47| Args:
@@ -40,7 +40,7 @@ End Position: Line 59, Column 22
4040
50| Returns:
4141
51| A dictionary mapping items to their counts
4242
52| """
43-
53| result: Dict[str, int] = {}
43+
53| result: dict[str, int] = {}
4444
54| for item in items:
4545
55| if item in result:
4646
56| result[item] += 1

integrationtests/fixtures/snapshots/python/definition/method.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ End Position: Line 59, Column 22
3232
41| return self.value
3333
42|
3434
43| @staticmethod
35-
44| def static_method(items: List[str]) -> Dict[str, int]:
35+
44| def static_method(items: list[str]) -> dict[str, int]:
3636
45| """Convert a list of items to a dictionary with item counts.
3737
46|
3838
47| Args:
@@ -41,7 +41,7 @@ End Position: Line 59, Column 22
4141
50| Returns:
4242
51| A dictionary mapping items to their counts
4343
52| """
44-
53| result: Dict[str, int] = {}
44+
53| result: dict[str, int] = {}
4545
54| for item in items:
4646
55| if item in result:
4747
56| result[item] += 1

0 commit comments

Comments
 (0)