|
|
@@ -2,6 +2,7 @@ import { LSP } from "../../../lsp"
|
|
|
import { bootstrap } from "../../bootstrap"
|
|
|
import { cmd } from "../cmd"
|
|
|
import { Log } from "../../../util/log"
|
|
|
+import { EOL } from "os"
|
|
|
|
|
|
export const LSPCommand = cmd({
|
|
|
command: "lsp",
|
|
|
@@ -16,7 +17,7 @@ const DiagnosticsCommand = cmd({
|
|
|
async handler(args) {
|
|
|
await bootstrap(process.cwd(), async () => {
|
|
|
await LSP.touchFile(args.file, true)
|
|
|
- console.log(JSON.stringify(await LSP.diagnostics(), null, 2))
|
|
|
+ process.stdout.write(JSON.stringify(await LSP.diagnostics(), null, 2) + EOL)
|
|
|
})
|
|
|
},
|
|
|
})
|
|
|
@@ -28,7 +29,7 @@ export const SymbolsCommand = cmd({
|
|
|
await bootstrap(process.cwd(), async () => {
|
|
|
using _ = Log.Default.time("symbols")
|
|
|
const results = await LSP.workspaceSymbol(args.query)
|
|
|
- console.log(JSON.stringify(results, null, 2))
|
|
|
+ process.stdout.write(JSON.stringify(results, null, 2) + EOL)
|
|
|
})
|
|
|
},
|
|
|
})
|
|
|
@@ -40,7 +41,7 @@ export const DocumentSymbolsCommand = cmd({
|
|
|
await bootstrap(process.cwd(), async () => {
|
|
|
using _ = Log.Default.time("document-symbols")
|
|
|
const results = await LSP.documentSymbol(args.uri)
|
|
|
- console.log(JSON.stringify(results, null, 2))
|
|
|
+ process.stdout.write(JSON.stringify(results, null, 2) + EOL)
|
|
|
})
|
|
|
},
|
|
|
})
|