Skip to content

Commit 8e72b6c

Browse files
authored
feat(amazonq): setting toggle for using the amazonq language server (#6142)
## Problem We want to experiment with the amazon q language server ## Solution Set up the structure for the eventual amazon q language srever
1 parent fe709e8 commit 8e72b6c

File tree

5 files changed

+36
-5
lines changed

5 files changed

+36
-5
lines changed

packages/amazonq/src/extensionNode.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@ import * as vscode from 'vscode'
77
import { activateAmazonQCommon, amazonQContextPrefix, deactivateCommon } from './extension'
88
import { DefaultAmazonQAppInitContext } from 'aws-core-vscode/amazonq'
99
import { activate as activateQGumby } from 'aws-core-vscode/amazonqGumby'
10-
import { ExtContext, globals, CrashMonitoring, getLogger, isNetworkError, isSageMaker } from 'aws-core-vscode/shared'
10+
import {
11+
ExtContext,
12+
globals,
13+
CrashMonitoring,
14+
getLogger,
15+
isNetworkError,
16+
isSageMaker,
17+
Experiments,
18+
} from 'aws-core-vscode/shared'
1119
import { filetypes, SchemaService } from 'aws-core-vscode/sharedNode'
1220
import { updateDevMode } from 'aws-core-vscode/dev'
1321
import { CommonAuthViewProvider } from 'aws-core-vscode/login'
@@ -21,6 +29,7 @@ import { beta } from 'aws-core-vscode/dev'
2129
import { activate as activateNotifications, NotificationsController } from 'aws-core-vscode/notifications'
2230
import { AuthState, AuthUtil } from 'aws-core-vscode/codewhisperer'
2331
import { telemetry, AuthUserState } from 'aws-core-vscode/telemetry'
32+
import { activate as activateAmazonqLsp } from './lsp/activation'
2433

2534
export async function activate(context: vscode.ExtensionContext) {
2635
// IMPORTANT: No other code should be added to this function. Place it in one of the following 2 functions where appropriate.
@@ -42,8 +51,13 @@ async function activateAmazonQNode(context: vscode.ExtensionContext) {
4251
const extContext = {
4352
extensionContext: context,
4453
}
45-
await activateCWChat(context)
46-
await activateQGumby(extContext as ExtContext)
54+
55+
if (Experiments.instance.get('amazonqLSP', false)) {
56+
await activateAmazonqLsp(context)
57+
} else {
58+
await activateCWChat(context)
59+
await activateQGumby(extContext as ExtContext)
60+
}
4761

4862
const authProvider = new CommonAuthViewProvider(
4963
context,
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*!
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
import vscode from 'vscode'
7+
8+
export async function activate(ctx: vscode.ExtensionContext): Promise<void> {
9+
/**
10+
* download install and run the language server
11+
*/
12+
}

packages/core/src/shared/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export { activate as activateLogger } from './logger/activation'
1313
export { activate as activateTelemetry } from './telemetry/activation'
1414
export { DefaultAwsContext } from './awsContext'
1515
export { DefaultAWSClientBuilder, ServiceOptions } from './awsClientBuilder'
16-
export { Settings, DevSettings } from './settings'
16+
export { Settings, Experiments, DevSettings } from './settings'
1717
export * from './extensionUtilities'
1818
export * from './extensionStartup'
1919
export { RegionProvider } from './regions/regionProvider'

packages/core/src/shared/settings-toolkit.gen.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ export const toolkitSettings = {
4141
"ssoCacheError": {}
4242
},
4343
"aws.experiments": {
44-
"jsonResourceModification": {}
44+
"jsonResourceModification": {},
45+
"amazonqLSP": {}
4546
},
4647
"aws.resources.enabledResources": {},
4748
"aws.lambda.recentlyUploaded": {},

packages/toolkit/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,10 @@
246246
"jsonResourceModification": {
247247
"type": "boolean",
248248
"default": false
249+
},
250+
"amazonqLSP": {
251+
"type": "boolean",
252+
"default": false
249253
}
250254
},
251255
"additionalProperties": false

0 commit comments

Comments
 (0)