-
Notifications
You must be signed in to change notification settings - Fork 747
feat(amazonq): sync lsp logging with local configuration. #7186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,14 +2,34 @@ | |||||
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||||||
| * SPDX-License-Identifier: Apache-2.0 | ||||||
| */ | ||||||
|
|
||||||
| import * as vscode from 'vscode' | ||||||
| import { DevSettings, getServiceEnvVarConfig } from 'aws-core-vscode/shared' | ||||||
| import { LspConfig } from 'aws-core-vscode/amazonq' | ||||||
|
|
||||||
| export interface ExtendedAmazonQLSPConfig extends LspConfig { | ||||||
| ui?: string | ||||||
| } | ||||||
|
|
||||||
| // Taken from language server runtimes since they are not exported: | ||||||
| // https://github.com/aws/language-server-runtimes/blob/eae85672c345d8adaf4c8cbd741260b8a59750c4/runtimes/runtimes/util/loggingUtil.ts#L4-L10 | ||||||
| const validLspLogLevels = ['error', 'warn', 'info', 'log', 'debug'] as const | ||||||
| export type LspLogLevel = (typeof validLspLogLevels)[number] | ||||||
| export const lspLogLevelMapping: Map<vscode.LogLevel, LspLogLevel> = new Map([ | ||||||
|
||||||
| export const lspLogLevelMapping: Map<vscode.LogLevel, LspLogLevel> = new Map([ | |
| const lspLogLevelMapping: Map<vscode.LogLevel, LspLogLevel> = new Map([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets explain why briefly: "Maps the VS Code log level to an equivalent Amazon Q language server log level, since they are not 1:1"
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ | |
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| import { ExtensionContext, OutputChannel } from 'vscode' | ||
| import { ExtensionContext, LogOutputChannel, OutputChannel } from 'vscode' | ||
| import { LoginManager } from '../auth/deprecated/loginManager' | ||
| import { AwsResourceManager } from '../dynamicResources/awsResourceManager' | ||
| import { AWSClientBuilder } from './awsClientBuilder' | ||
|
|
@@ -191,7 +191,7 @@ export interface ToolkitGlobals { | |
| /** | ||
| * Log messages. Use `outputChannel` for application messages. | ||
| */ | ||
| logOutputChannel: OutputChannel | ||
| logOutputChannel: LogOutputChannel | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| loginManager: LoginManager | ||
| awsContextCommands: AwsContextCommands | ||
| awsContext: AwsContext | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -105,11 +105,6 @@ const logLevels = new Map<LogLevel, number>([ | |||
| export type LogLevel = 'error' | 'warn' | 'info' | 'verbose' | 'debug' | ||||
|
|
||||
| export function fromVscodeLogLevel(logLevel: vscode.LogLevel): LogLevel { | ||||
| if (!vscode.LogLevel) { | ||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minimum version has been bumped since this was written
|
||||
| // vscode version <= 1.73 | ||||
| return 'info' | ||||
| } | ||||
|
|
||||
| switch (logLevel) { | ||||
| case vscode.LogLevel.Trace: | ||||
| case vscode.LogLevel.Debug: | ||||
|
|
||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this setting being added?
edit: oh, this is something sent to Q LSP, I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not being added for us no. This is the section used to detect logging level changes for this notification based on their implementation here.