mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-25 19:54:22 +01:00
Remove debug console.log statements and improve LSP diagnostic handling
🤖 Generated with opencode Co-Authored-By: opencode <noreply@opencode.ai>
This commit is contained in:
@@ -51,8 +51,10 @@ export namespace LSPClient {
|
||||
log.info("textDocument/publishDiagnostics", {
|
||||
path,
|
||||
});
|
||||
console.log(path, params);
|
||||
const exists = diagnostics.has(path);
|
||||
diagnostics.set(path, params.diagnostics);
|
||||
// servers seem to send one blank publishDiagnostics event before the first real one
|
||||
if (!exists && !params.diagnostics.length) return;
|
||||
Bus.publish(Event.Diagnostics, { path, serverID: input.serverID });
|
||||
});
|
||||
connection.listen();
|
||||
@@ -131,7 +133,6 @@ export namespace LSPClient {
|
||||
notify: {
|
||||
async open(input: { path: string }) {
|
||||
const file = Bun.file(input.path);
|
||||
if (!file.exists()) return;
|
||||
const text = await file.text();
|
||||
const opened = files.has(input.path);
|
||||
if (!opened) {
|
||||
|
||||
@@ -40,7 +40,6 @@ TIPS:
|
||||
: path.join(app.root, args.path);
|
||||
await LSP.file(normalized);
|
||||
const diagnostics = await LSP.diagnostics();
|
||||
console.log(diagnostics, "diagnostics");
|
||||
const file = diagnostics[normalized];
|
||||
return {
|
||||
metadata: {
|
||||
|
||||
Reference in New Issue
Block a user