Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,10 @@ jobs:
override: true

- name: Install rust-analyzer
run: |
mkdir -p ~/.local/bin
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
chmod +x ~/.local/bin/rust-analyzer
echo "$HOME/.local/bin" >> $GITHUB_PATH
run: rustup component add rust-analyzer

- run: rustc --version
- run: rust-analyzer --version

- name: Run Rust integration tests
run: go test ./integrationtests/languages/rust/...
Expand Down
12 changes: 12 additions & 0 deletions integrationtests/fixtures/snapshots/go/hover/constant.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
```go
const SharedConstant untyped string = "shared value"
```

---

SharedConstant is used in multiple files


---

[`main.SharedConstant` on pkg.go.dev](https://pkg.go.dev/github.com/isaacphi/mcp-language-server/integrationtests/test-output/go/workspace#SharedConstant)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```go
type SharedStruct struct {
ID int
Name string
Value float64
Constants []string
}
```

---

SharedStruct is a struct used across multiple files


```go
func (s *SharedStruct) GetName() string
func (s *SharedStruct) Method() string
func (s *SharedStruct) Process() error
```

---

[`main.SharedStruct` on pkg.go.dev](https://pkg.go.dev/github.com/isaacphi/mcp-language-server/integrationtests/test-output/go/workspace#SharedStruct)
15 changes: 15 additions & 0 deletions integrationtests/fixtures/snapshots/go/hover/interface-type.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```go
type SharedInterface interface { // size=16 (0x10)
Process() error
GetName() string
}
```

---

SharedInterface defines behavior implemented across files


---

[`main.SharedInterface` on pkg.go.dev](https://pkg.go.dev/github.com/isaacphi/mcp-language-server/integrationtests/test-output/go/workspace#SharedInterface)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
No hover information available for this position on the following line:
import "fmt"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
failed to get hover information: request failed: line number 999 out of range 0-40 (code: 0)
23 changes: 23 additions & 0 deletions integrationtests/fixtures/snapshots/go/hover/struct-method.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```go
type SharedStruct struct {
ID int
Name string
Value float64
Constants []string
}
```

---

SharedStruct is a struct used across multiple files


```go
func (s *SharedStruct) GetName() string
func (s *SharedStruct) Method() string
func (s *SharedStruct) Process() error
```

---

[`main.SharedStruct` on pkg.go.dev](https://pkg.go.dev/github.com/isaacphi/mcp-language-server/integrationtests/test-output/go/workspace#SharedStruct)
23 changes: 23 additions & 0 deletions integrationtests/fixtures/snapshots/go/hover/struct-type.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
```go
type SharedStruct struct { // size=56 (0x38)
ID int
Name string
Value float64
Constants []string
}
```

---

SharedStruct is a struct used across multiple files


```go
func (s *SharedStruct) GetName() string
func (s *SharedStruct) Method() string
func (s *SharedStruct) Process() error
```

---

[`main.SharedStruct` on pkg.go.dev](https://pkg.go.dev/github.com/isaacphi/mcp-language-server/integrationtests/test-output/go/workspace#SharedStruct)
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ End Position: Line 59, Column 22
41| return self.value
42|
43| @staticmethod
44| def static_method(items: List[str]) -> Dict[str, int]:
44| def static_method(items: list[str]) -> dict[str, int]:
45| """Convert a list of items to a dictionary with item counts.
46|
47| Args:
Expand All @@ -40,7 +40,7 @@ End Position: Line 59, Column 22
50| Returns:
51| A dictionary mapping items to their counts
52| """
53| result: Dict[str, int] = {}
53| result: dict[str, int] = {}
54| for item in items:
55| if item in result:
56| result[item] += 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ End Position: Line 59, Column 22
41| return self.value
42|
43| @staticmethod
44| def static_method(items: List[str]) -> Dict[str, int]:
44| def static_method(items: list[str]) -> dict[str, int]:
45| """Convert a list of items to a dictionary with item counts.
46|
47| Args:
Expand All @@ -41,7 +41,7 @@ End Position: Line 59, Column 22
50| Returns:
51| A dictionary mapping items to their counts
52| """
53| result: Dict[str, int] = {}
53| result: dict[str, int] = {}
54| for item in items:
55| if item in result:
56| result[item] += 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ End Position: Line 59, Column 22
41| return self.value
42|
43| @staticmethod
44| def static_method(items: List[str]) -> Dict[str, int]:
44| def static_method(items: list[str]) -> dict[str, int]:
45| """Convert a list of items to a dictionary with item counts.
46|
47| Args:
Expand All @@ -41,7 +41,7 @@ End Position: Line 59, Column 22
50| Returns:
51| A dictionary mapping items to their counts
52| """
53| result: Dict[str, int] = {}
53| result: dict[str, int] = {}
54| for item in items:
55| if item in result:
56| result[item] += 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ Kind: Variable
Start Position: Line 83, Column 1
End Position: Line 83, Column 14
===
83|test_variable: List[int] = [1, 2, 3, 4, 5]
83|test_variable: list[int] = [1, 2, 3, 4, 5]

Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
===
/TEST_OUTPUT/workspace/consumer_clean.py
Location: Line 10, Column 15
Location: Line 9, Column 15
Message: Argument missing for parameter "age"
Source: Pyright
Code: reportCallIssue
===
7|def consumer_function() -> None:
8| """Function that consumes the helper functions."""
9| # Use the helper function
10| message = helper_function("World")
11| print(message)
12|
13| # Get and process items from the helper
14| items = get_items()
15| for item in items:
16| print(f"Processing {item}")
6|def consumer_function() -> None:
7| """Function that consumes the helper functions."""
8| # Use the helper function
9| message = helper_function("World")
10| print(message)
11|
12| # Get and process items from the helper
13| items = get_items()
14| for item in items:
15| print(f"Processing {item}")

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Code: reportReturnType
===
25|def function_with_type_error() -> str:
26| """A function with a type error.
27|
27|
28| Returns:
29| Should return a string but actually returns an int
30| """
Expand All @@ -23,15 +23,15 @@ Code: reportUndefinedVariable
===
34|class ErrorClass:
35| """A class with errors."""
36|
37| def __init__(self, value: Dict[str, Any]):
36|
37| def __init__(self, value: dict[str, Any]):
38| """Initialize with errors.
39|
39|
40| Args:
41| value: A dictionary
42| """
43| self.value = value
44|
44|
45| def method_with_undefined_variable(self) -> None:
46| """A method that uses an undefined variable."""
47| print(undefined_variable) # Error: undefined_variable is not defined
Expand Down
12 changes: 12 additions & 0 deletions integrationtests/fixtures/snapshots/python/hover/class-method.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(method) def test_method(
self: Self@TestClass,
increment: int
) -> int

Increment the value by the given amount.

Args:
increment: The amount to increment by

Returns:
The new value
3 changes: 3 additions & 0 deletions integrationtests/fixtures/snapshots/python/hover/class.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(class) TestClass

A test class with methods and attributes.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(constant) TEST_CONSTANT: Literal['test constant']
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(class) DerivedClass

A class that inherits from BaseClass.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(function) def test_function(name: str) -> str

A simple test function that returns a greeting message.

Args:
name: The name to greet

Returns:
A greeting message
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
No hover information available for this position on the following line:

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
No hover information available for this position on the following line:
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(method) def static_method(items: list[str]) -> Unknown

Convert a list of items to a dictionary with item counts.

Args:
items: A list of strings

Returns:
A dictionary mapping items to their counts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(variable) test_variable: list[int]
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,28 @@ Reference at Line 40, Column 19:
/TEST_OUTPUT/workspace/consumer.py
References in File: 1
===
Reference at Line 48, Column 41:
35|def consumer_function() -> None:
36| """Function that consumes the helper functions."""
37| # Use the helper function
38| message = helper_function("World")
39| print(message)
40|
41| # Get and process items from the helper
42| items = get_items()
43| for item in items:
44| print(f"Processing {item}")
45|
46| # Use the shared class
47| shared = SharedClass[str]("consumer", SHARED_CONSTANT)
48| print(f"Using shared class: {shared.get_name()} - {shared.get_value()}")
49|
50| # Use our implementation of the shared interface
51| impl = MyImplementation()
52| result = impl.process(items)
53| print(f"Processed items: {result}")
54|
55| # Use the enum
56| color = Color.RED
57| print(f"Selected color: {color}")
Reference at Line 47, Column 41:
34|def consumer_function() -> None:
35| """Function that consumes the helper functions."""
36| # Use the helper function
37| message = helper_function("World")
38| print(message)
39|
40| # Get and process items from the helper
41| items = get_items()
42| for item in items:
43| print(f"Processing {item}")
44|
45| # Use the shared class
46| shared = SharedClass[str]("consumer", SHARED_CONSTANT)
47| print(f"Using shared class: {shared.get_name()} - {shared.get_value()}")
48|
49| # Use our implementation of the shared interface
50| impl = MyImplementation()
51| result = impl.process(items)
52| print(f"Processed items: {result}")
53|
54| # Use the enum
55| color = Color.RED
56| print(f"Selected color: {color}")

Loading
Loading