@@ -2,6 +2,7 @@ import { LSP } from "../../../lsp"
22import { bootstrap } from "../../bootstrap"
33import { cmd } from "../cmd"
44import { Log } from "../../../util/log"
5+ import { EOL } from "os"
56
67export const LSPCommand = cmd ( {
78 command : "lsp" ,
@@ -16,7 +17,7 @@ const DiagnosticsCommand = cmd({
1617 async handler ( args ) {
1718 await bootstrap ( process . cwd ( ) , async ( ) => {
1819 await LSP . touchFile ( args . file , true )
19- console . log ( JSON . stringify ( await LSP . diagnostics ( ) , null , 2 ) )
20+ process . stdout . write ( JSON . stringify ( await LSP . diagnostics ( ) , null , 2 ) + EOL )
2021 } )
2122 } ,
2223} )
@@ -28,7 +29,7 @@ export const SymbolsCommand = cmd({
2829 await bootstrap ( process . cwd ( ) , async ( ) => {
2930 using _ = Log . Default . time ( "symbols" )
3031 const results = await LSP . workspaceSymbol ( args . query )
31- console . log ( JSON . stringify ( results , null , 2 ) )
32+ process . stdout . write ( JSON . stringify ( results , null , 2 ) + EOL )
3233 } )
3334 } ,
3435} )
@@ -40,7 +41,7 @@ export const DocumentSymbolsCommand = cmd({
4041 await bootstrap ( process . cwd ( ) , async ( ) => {
4142 using _ = Log . Default . time ( "document-symbols" )
4243 const results = await LSP . documentSymbol ( args . uri )
43- console . log ( JSON . stringify ( results , null , 2 ) )
44+ process . stdout . write ( JSON . stringify ( results , null , 2 ) + EOL )
4445 } )
4546 } ,
4647} )
0 commit comments