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
5 changes: 3 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
interval: "monthly"
open-pull-requests-limit: 10
labels:
- "dependencies"
Expand All @@ -16,4 +16,5 @@ updates:
open-pull-requests-limit: 10
labels:
- "dependencies"
- "github-actions"
- "github-actions"

109 changes: 95 additions & 14 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
workflow_dispatch:

jobs:
test:
name: Run Tests
unit-tests:
name: Unit Tests and Code Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -21,14 +21,23 @@ jobs:
check-latest: true
cache: true

- name: Build
run: go build -o mcp-language-server

- name: Install just
run: curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin

- name: Install gopls
run: go install golang.org/x/tools/gopls@latest

- name: Run tests
run: go test ./...
- name: Run unit tests
run: go test ./internal/...

- name: Run code quality checks
run: just check

check:
name: Build and Code Quality Checks
go-integration-tests:
name: Go Integration Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -40,14 +49,86 @@ jobs:
check-latest: true
cache: true

- name: Build
run: go build -o mcp-language-server

- name: Install just
run: curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin

- name: Install gopls
run: go install golang.org/x/tools/gopls@latest

- name: Run code quality checks
run: just check
- name: Run Go integration tests
run: go test ./integrationtests/languages/go/...

python-integration-tests:
name: Python Integration Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24"
check-latest: true
cache: true

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install pyright
run: npm install -g pyright

- name: Run Python integration tests
run: go test ./integrationtests/languages/python/...

rust-integration-tests:
name: Rust Integration Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24"
check-latest: true
cache: true

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rust-src
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

- name: Run Rust integration tests
run: go test ./integrationtests/languages/rust/...

typescript-integration-tests:
name: TypeScript Integration Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.24"
check-latest: true
cache: true

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install typescript-language-server
run: npm install -g typescript typescript-language-server

- name: Run TypeScript integration tests
run: go test ./integrationtests/languages/typescript/...
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Code: default
8| fmt.Println("Unreachable code") // This is unreachable code
9|}


===
/TEST_OUTPUT/workspace/main.go
Location: Line 9, Column 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/TEST_OUTPUT/workspace/main.go
References in File: 1
===

Reference at Line 12, Column 14:
11|func main() {
12| fmt.Println(FooBar())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/TEST_OUTPUT/workspace/another_consumer.go
References in File: 1
===

Reference at Line 8, Column 34:
6|func AnotherConsumer() {
7| // Use helper function
Expand Down Expand Up @@ -41,12 +40,10 @@ Reference at Line 8, Column 34:
40| }
41|}


===
/TEST_OUTPUT/workspace/consumer.go
References in File: 1
===

Reference at Line 7, Column 13:
6|func ConsumerFunction() {
7| message := HelperFunction()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/TEST_OUTPUT/workspace/another_consumer.go
References in File: 1
===

Reference at Line 19, Column 15:
6|func AnotherConsumer() {
7| // Use helper function
Expand Down Expand Up @@ -41,12 +40,10 @@ Reference at Line 19, Column 15:
40| }
41|}


===
/TEST_OUTPUT/workspace/consumer.go
References in File: 1
===

Reference at Line 24, Column 20:
6|func ConsumerFunction() {
7| message := HelperFunction()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/TEST_OUTPUT/workspace/another_consumer.go
References in File: 1
===

Reference at Line 15, Column 23:
6|func AnotherConsumer() {
7| // Use helper function
Expand Down Expand Up @@ -41,12 +40,10 @@ Reference at Line 15, Column 23:
40| }
41|}


===
/TEST_OUTPUT/workspace/consumer.go
References in File: 1
===

Reference at Line 15, Column 23:
6|func ConsumerFunction() {
7| message := HelperFunction()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/TEST_OUTPUT/workspace/another_consumer.go
References in File: 1
===

Reference at Line 33, Column 12:
6|func AnotherConsumer() {
7| // Use helper function
Expand Down Expand Up @@ -41,12 +40,10 @@ Reference at Line 33, Column 12:
40| }
41|}


===
/TEST_OUTPUT/workspace/consumer.go
References in File: 1
===

Reference at Line 23, Column 12:
6|func ConsumerFunction() {
7| message := HelperFunction()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/TEST_OUTPUT/workspace/another_consumer.go
References in File: 2
===

Reference at Line 11, Column 8:
6|func AnotherConsumer() {
7| // Use helper function
Expand Down Expand Up @@ -80,12 +79,10 @@ Reference at Line 25, Column 3:
40| }
41|}


===
/TEST_OUTPUT/workspace/consumer.go
References in File: 1
===

Reference at Line 11, Column 8:
6|func ConsumerFunction() {
7| message := HelperFunction()
Expand All @@ -112,12 +109,10 @@ Reference at Line 11, Column 8:
28| fmt.Println(t)
29|}


===
/TEST_OUTPUT/workspace/types.go
References in File: 3
===

Reference at Line 14, Column 10:
14|func (s *SharedStruct) Method() string {
15| return s.Name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/TEST_OUTPUT/workspace/another_consumer.go
References in File: 1
===

Reference at Line 37, Column 14:
6|func AnotherConsumer() {
7| // Use helper function
Expand Down Expand Up @@ -41,12 +40,10 @@ Reference at Line 37, Column 14:
40| }
41|}


===
/TEST_OUTPUT/workspace/consumer.go
References in File: 1
===

Reference at Line 27, Column 8:
6|func ConsumerFunction() {
7| message := HelperFunction()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/TEST_OUTPUT/workspace/consumer.go
References in File: 1
===

Reference at Line 19, Column 16:
6|func ConsumerFunction() {
7| message := HelperFunction()
Expand Down
50 changes: 50 additions & 0 deletions integrationtests/fixtures/snapshots/python/definition/class.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
===
Symbol: TestClass
/TEST_OUTPUT/workspace/main.py
Kind: Class
Start Position: Line 18, Column 1
End Position: Line 59, Column 22
===
18|class TestClass:
19| """A test class with methods and attributes."""
20|
21| class_variable: str = "class variable"
22|
23| def __init__(self, value: int = 0):
24| """Initialize the TestClass.
25|
26| Args:
27| value: The initial value
28| """
29| self.value: int = value
30|
31| def test_method(self, increment: int) -> int:
32| """Increment the value by the given amount.
33|
34| Args:
35| increment: The amount to increment by
36|
37| Returns:
38| The new value
39| """
40| self.value += increment
41| return self.value
42|
43| @staticmethod
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:
48| items: A list of strings
49|
50| Returns:
51| A dictionary mapping items to their counts
52| """
53| result: Dict[str, int] = {}
54| for item in items:
55| if item in result:
56| result[item] += 1
57| else:
58| result[item] = 1
59| return result

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
===
Symbol: TEST_CONSTANT
/TEST_OUTPUT/workspace/main.py
Kind: Constant
Start Position: Line 79, Column 1
End Position: Line 79, Column 14
===
79|TEST_CONSTANT: str = "test constant"

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
===
Symbol: DerivedClass
/TEST_OUTPUT/workspace/main.py
Kind: Class
Start Position: Line 70, Column 1
End Position: Line 75, Column 13
===
70|class DerivedClass(BaseClass):
71| """A class that inherits from BaseClass."""
72|
73| def derived_method(self) -> None:
74| """A method defined in the derived class."""
75| pass

Loading
Loading