Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9d78713

Browse files
mizchiclaude
andcommitted
fix: correct MCP tool names and parameters in language tests
- Fix tool names: get_hover → lsp_get_hover, get_definitions → lsp_get_definitions- Fix parameter names: filePath → relativePath, target → textTarget- Extend timeout for Haskell Language Server tests (60s)- Simplify testMcpHelpers.ts with optional testFile parameter- Remove complex presetId logic that was causing type errors- All language tests now pass locally (TypeScript, Deno, Rust, MoonBit, F#, Python, HLS, OCaml)🤖 Generated with [Claude Code](https://claude.ai/code)Co-Authored-By: Claude <noreply@anthropic.com>
1 parent5b99921 commit9d78713

File tree

15 files changed

+178
-121
lines changed

15 files changed

+178
-121
lines changed

‎tests/fixtures/moonbit/.gitignore‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.mooncakes
1+
.mooncakes
2+
target

‎tests/fixtures/moonbit/target/wasm-gc/release/check/.moon-lock‎

Whitespace-only changes.
-8 Bytes
Binary file not shown.
-147 Bytes
Binary file not shown.

‎tests/languages/language-tests/deno.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe("Deno Adapter", () => {
3434
});
3535

3636
it("should provide MCP tools including get_project_overview, get_diagnostics, get_definitions, search_symbols, and get_symbol_details",async()=>{
37-
constresult=awaittestMcpConnection(denoAdapter,projectRoot);
37+
constresult=awaittestMcpConnection(denoAdapter,projectRoot,"main.ts");
3838

3939
expect(result.connected).toBe(true);
4040
expect(result.hasGetProjectOverview).toBe(true);

‎tests/languages/language-tests/fsharp.test.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,11 @@ describe("F# Adapter", () => {
169169

170170
it("should provide MCP tools including get_project_overview, get_diagnostics, and get_definitions",async()=>{
171171
constprojectRoot=join(import.meta.dirname,"../../fixtures","fsharp");
172-
constresult=awaittestMcpConnection(fsharpAdapter,projectRoot);
172+
constresult=awaittestMcpConnection(
173+
fsharpAdapter,
174+
projectRoot,
175+
"Program.fs",
176+
);
173177

174178
if(!result.connected){
175179
console.warn("MCP connection failed, skipping test");

‎tests/languages/language-tests/haskell-simple.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ describe("Haskell Language Server Basic Tests", () => {
3131
expect(result.error).toBeDefined();
3232
console.warn("HLS not available, skipping test");
3333
}
34-
},30000);
34+
},60000);
3535
});

‎tests/languages/language-tests/haskell.test.ts‎

Lines changed: 67 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -13,49 +13,69 @@ describe("Haskell Language Server Adapter", () => {
1313
constisCI=process.env.CI==="true";
1414
consttestTimeout=isCI ?60000 :30000;
1515

16-
it("should connect to HLS",async()=>{
17-
constcheckFiles=["Main.hs"];
18-
constresult=awaittestLspConnection(hlsAdapter,projectRoot,checkFiles);
16+
it(
17+
"should connect to HLS",
18+
async()=>{
19+
constcheckFiles=["Main.hs"];
20+
constresult=awaittestLspConnection(
21+
hlsAdapter,
22+
projectRoot,
23+
checkFiles,
24+
);
1925

20-
// HLS might not be installed in CI
21-
expect(result.connected).toBeDefined();
22-
if(result.connected){
23-
expect(result.diagnostics).toBeDefined();
24-
}else{
25-
expect(result.error).toBeDefined();
26-
console.warn("HLS not available, skipping test");
27-
}
28-
});
29-
30-
it("should detect type errors in Haskell files",async()=>{
31-
constcheckFiles=["Main.hs"];
32-
constresult=awaittestLspConnection(hlsAdapter,projectRoot,checkFiles);
33-
34-
if(!result.connected){
35-
console.warn("HLS not available, skipping diagnostics test");
36-
return;
37-
}
38-
39-
expect(result.diagnostics).toBeDefined();
40-
constmainDiagnostics=(result.diagnosticsasany)?.["Main.hs"];
41-
42-
if(mainDiagnostics&&mainDiagnostics.length>0){
43-
// Should have at least 2 type errors
44-
expect(mainDiagnostics.length).toBeGreaterThanOrEqual(2);
45-
46-
// Check for type errors
47-
consthasTypeErrors=mainDiagnostics.some(
48-
(d:any)=>
49-
d.severity===1&&d.message.toLowerCase().includes("type"),
26+
// HLS might not be installed in CI
27+
expect(result.connected).toBeDefined();
28+
if(result.connected){
29+
expect(result.diagnostics).toBeDefined();
30+
}else{
31+
expect(result.error).toBeDefined();
32+
console.warn("HLS not available, skipping test");
33+
}
34+
},
35+
testTimeout,
36+
);
37+
38+
it(
39+
"should detect type errors in Haskell files",
40+
async()=>{
41+
constcheckFiles=["Main.hs"];
42+
constresult=awaittestLspConnection(
43+
hlsAdapter,
44+
projectRoot,
45+
checkFiles,
5046
);
51-
expect(hasTypeErrors).toBe(true);
52-
}
53-
});
47+
48+
if(!result.connected){
49+
console.warn("HLS not available, skipping diagnostics test");
50+
return;
51+
}
52+
53+
expect(result.diagnostics).toBeDefined();
54+
constmainDiagnostics=(result.diagnosticsasany)?.["Main.hs"];
55+
56+
if(mainDiagnostics&&mainDiagnostics.length>0){
57+
// Should have at least 2 type errors
58+
expect(mainDiagnostics.length).toBeGreaterThanOrEqual(2);
59+
60+
// Check for type errors
61+
consthasTypeErrors=mainDiagnostics.some(
62+
(d:any)=>
63+
d.severity===1&&d.message.toLowerCase().includes("type"),
64+
);
65+
expect(hasTypeErrors).toBe(true);
66+
}
67+
},
68+
testTimeout,
69+
);
5470

5571
it(
5672
"should provide MCP tools including get_project_overview, get_diagnostics, get_definitions, and get_hover",
5773
async()=>{
58-
constresult=awaittestMcpConnection(hlsAdapter,projectRoot);
74+
constresult=awaittestMcpConnection(
75+
hlsAdapter,
76+
projectRoot,
77+
"Main.hs",
78+
);
5979

6080
expect(result.connected).toBe(true);
6181
expect(result.hasGetProjectOverview).toBe(true);
@@ -111,10 +131,10 @@ describe("Haskell Language Server Adapter", () => {
111131
try{
112132
// Try to get definition from where User is referenced
113133
constuserDefResult=awaitclient.callTool({
114-
name:"get_definitions",
134+
name:"lsp_get_definitions",
115135
arguments:{
116136
root:projectRoot,
117-
filePath:"Main.hs",
137+
relativePath:"Main.hs",
118138
line:'User "Alice"',// Find line with User constructor usage
119139
symbolName:"User",
120140
include_body:true,
@@ -131,10 +151,10 @@ describe("Haskell Language Server Adapter", () => {
131151
}catch(error){
132152
// If the first approach fails, try with the type definition line
133153
constuserDefResult=awaitclient.callTool({
134-
name:"get_definitions",
154+
name:"lsp_get_definitions",
135155
arguments:{
136156
root:projectRoot,
137-
filePath:"Main.hs",
157+
relativePath:"Main.hs",
138158
line:4,// Line where User is defined
139159
symbolName:"User",
140160
include_body:true,
@@ -186,12 +206,12 @@ describe("Haskell Language Server Adapter", () => {
186206

187207
try{
188208
consthoverResult=awaitclient.callTool({
189-
name:"get_hover",
209+
name:"lsp_get_hover",
190210
arguments:{
191211
root:projectRoot,
192-
filePath:"Main.hs",
212+
relativePath:"Main.hs",
193213
line:"show (processUsers users)",// Find line with processUsers call
194-
target:"processUsers",
214+
textTarget:"processUsers",
195215
},
196216
});
197217

@@ -207,12 +227,12 @@ describe("Haskell Language Server Adapter", () => {
207227
}catch(error){
208228
// If the first approach fails, try with the definition line
209229
consthoverResult=awaitclient.callTool({
210-
name:"get_hover",
230+
name:"lsp_get_hover",
211231
arguments:{
212232
root:projectRoot,
213-
filePath:"Main.hs",
233+
relativePath:"Main.hs",
214234
line:14,// Line where processUsers is defined
215-
target:"processUsers",
235+
textTarget:"processUsers",
216236
},
217237
});
218238
consthoverContent=hoverResult.contentasany;

‎tests/languages/language-tests/moonbit.test.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ describe("MoonBit Adapter", () => {
105105

106106
it("should provide MCP tools including get_project_overview, get_diagnostics, and get_definitions",async()=>{
107107
constprojectRoot=join(import.meta.dirname,"../../fixtures","moonbit");
108-
constresult=awaittestMcpConnection(moonbitAdapter,projectRoot);
108+
constresult=awaittestMcpConnection(
109+
moonbitAdapter,
110+
projectRoot,
111+
"main.mbt",
112+
);
109113

110114
if(!result.connected){
111115
console.warn("MCP connection failed, skipping test");

‎tests/languages/language-tests/ocaml.test.ts‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ describe("OCaml Language Server Adapter", () => {
6363
it(
6464
"should provide MCP tools including get_project_overview, get_diagnostics, get_definitions, and get_hover with expected symbol counts",
6565
async()=>{
66-
constresult=awaittestMcpConnection(ocamlAdapter,projectRoot);
66+
constresult=awaittestMcpConnection(
67+
ocamlAdapter,
68+
projectRoot,
69+
"main.ml",
70+
);
6771

6872
expect(result.connected).toBe(true);
6973
expect(result.hasGetProjectOverview).toBe(true);
@@ -140,10 +144,10 @@ describe("OCaml Language Server Adapter", () => {
140144

141145
try{
142146
constuserDefResult=awaitclient.callTool({
143-
name:"get_definitions",
147+
name:"lsp_get_definitions",
144148
arguments:{
145149
root:projectRoot,
146-
filePath:"main.ml",
150+
relativePath:"main.ml",
147151
line:10,// Line where user.name is accessed
148152
symbolName:"name",
149153
},
@@ -198,12 +202,12 @@ describe("OCaml Language Server Adapter", () => {
198202

199203
try{
200204
consthoverResult=awaitclient.callTool({
201-
name:"get_hover",
205+
name:"lsp_get_hover",
202206
arguments:{
203207
root:projectRoot,
204-
filePath:"main.ml",
208+
relativePath:"main.ml",
205209
line:29,// Line where process_users is called
206-
target:"process_users",
210+
textTarget:"process_users",
207211
},
208212
});
209213

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp