@@ -11,7 +11,7 @@ import { registerInlineCompletion } from '../app/inline/completion'
1111import { AmazonQLspAuth , encryptionKey , notificationTypes } from './auth'
1212import { AuthUtil } from 'aws-core-vscode/codewhisperer'
1313import { ConnectionMetadata } from '@aws/language-server-runtimes/protocol'
14- import { ResourcePaths , createServerOptions } from 'aws-core-vscode/shared'
14+ import { ResourcePaths , Settings , createServerOptions , globals } from 'aws-core-vscode/shared'
1515
1616const localize = nls . loadMessageBundle ( )
1717
@@ -35,6 +35,9 @@ export async function startLanguageServer(extensionContext: vscode.ExtensionCont
3535
3636 const documentSelector = [ { scheme : 'file' , language : '*' } ]
3737
38+ const clientId = 'amazonq'
39+ const traceServerEnabled = Settings . instance . isSet ( `${ clientId } .trace.server` )
40+
3841 // Options to control the language client
3942 const clientOptions : LanguageClientOptions = {
4043 // Register the server for json documents
@@ -60,10 +63,20 @@ export async function startLanguageServer(extensionContext: vscode.ExtensionCont
6063 providesBearerToken : true ,
6164 } ,
6265 } ,
66+ /**
67+ * When the trace server is enabled it outputs a ton of log messages so:
68+ * When trace server is enabled, logs go to a seperate "Amazon Q Language Server" output.
69+ * Otherwise, logs go to the regular "Amazon Q Logs" channel.
70+ */
71+ ...( traceServerEnabled
72+ ? { }
73+ : {
74+ outputChannel : globals . logOutputChannel ,
75+ } ) ,
6376 }
6477
6578 const client = new LanguageClient (
66- 'amazonq' ,
79+ clientId ,
6780 localize ( 'amazonq.server.name' , 'Amazon Q Language Server' ) ,
6881 serverOptions ,
6982 clientOptions
0 commit comments