Skip to content

Commit 3e2b6e7

Browse files
committed
Changes to address PR review comments
1 parent 92397b5 commit 3e2b6e7

File tree

9 files changed

+75
-75
lines changed

9 files changed

+75
-75
lines changed

server/dist/ql-mcp-server.js

Lines changed: 48 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/dist/ql-mcp-server.js.map

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/src/lib/language-server.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import { spawn, ChildProcess } from 'child_process';
77
import { EventEmitter } from 'events';
88
import { setTimeout, clearTimeout } from 'timers';
9+
import { pathToFileURL } from 'url';
10+
import { join } from 'path';
911
import { logger } from '../utils/logger';
1012
import { getProjectTmpDir } from '../utils/temp-dir';
1113

@@ -263,7 +265,7 @@ export class CodeQLLanguageServer extends EventEmitter {
263265
}
264266

265267
// Default to a project-local virtual URI rather than /tmp
266-
const documentUri = uri || `file://${getProjectTmpDir('lsp-eval')}/eval.ql`;
268+
const documentUri = uri || pathToFileURL(join(getProjectTmpDir('lsp-eval'), 'eval.ql')).href;
267269

268270
return new Promise((resolve, reject) => {
269271
let diagnosticsReceived = false;

server/src/tools/codeql/language-server-eval.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import { z } from 'zod';
88
import { CodeQLLanguageServer, Diagnostic, LanguageServerOptions } from '../../lib/language-server';
99
import { logger } from '../../utils/logger';
1010
import { getProjectTmpDir } from '../../utils/temp-dir';
11-
import { resolve } from 'path';
11+
import { join, resolve } from 'path';
12+
import { pathToFileURL } from 'url';
1213

1314
// Global language server instance for reuse across evaluations
1415
let globalLanguageServer: CodeQLLanguageServer | null = null;
@@ -128,7 +129,7 @@ export async function evaluateQLCode({
128129
const languageServer = await getLanguageServer(serverOptions);
129130

130131
// Generate unique URI for this evaluation
131-
const evalUri = `file://${getProjectTmpDir('lsp-eval')}/eval_${Date.now()}.ql`;
132+
const evalUri = pathToFileURL(join(getProjectTmpDir('lsp-eval'), `eval_${Date.now()}.ql`)).href;
132133

133134
const diagnostics = await languageServer.evaluateQL(qlCode, evalUri);
134135

server/src/tools/codeql/quick-evaluate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
1010
import { z } from 'zod';
11-
import { resolve } from 'path';
11+
import { join, resolve } from 'path';
1212
import { findClassPosition } from './find-class-position';
1313
import { findPredicatePosition } from './find-predicate-position';
1414
import { logger } from '../../utils/logger';
@@ -43,7 +43,7 @@ export async function quickEvaluate({
4343
}
4444
}
4545

46-
const resolvedOutput = resolve(output_path || getProjectTmpDir('quickeval') + '/quickeval.bqrs');
46+
const resolvedOutput = resolve(output_path || join(getProjectTmpDir('quickeval'), 'quickeval.bqrs'));
4747

4848
// For now, return the resolved output path
4949
// In a full implementation, this would use the CodeQL CLI or query server

0 commit comments

Comments
 (0)