Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions aws-toolkit-vscode.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
{
"path": "packages/amazonq",
},
{
"path": "../language-servers",
},
{
"path": "../language-server-runtimes",
},
],
"settings": {
"typescript.tsdk": "node_modules/typescript/lib",
Expand Down
5 changes: 5 additions & 0 deletions docs/lsp.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ sequenceDiagram
```

## Language Server Debugging

If you want to connect a local version of language-servers to aws-toolkit-vscode, follow these steps:

1. Clone https://github.com/aws/language-servers.git and set it up in the same workspace as this project by cmd+shift+p and "add folder to workspace" and selecting the language-servers folder that you just cloned. Your VS code folder structure should look like below.
Expand Down Expand Up @@ -57,13 +58,16 @@ If you want to connect a local version of language-servers to aws-toolkit-vscode
6. (Optional): Enable `"amazonq.trace.server": "on"` or `"amazonq.trace.server": "verbose"` in your VSCode settings to view detailed log messages sent to/from the language server. These log messages will show up in the "Amazon Q Language Server" output channel

### Breakpoints Work-Around

If the breakpoints in your language-servers project remain greyed out and do not trigger when you run `Launch LSP with Debugging`, your debugger may be attaching to the language server before it has launched. You can follow the work-around below to avoid this problem. If anyone fixes this issue, please remove this section.

1. Set your breakpoints and click `Launch LSP with Debugging`
2. Once the debugging session has started, click `Launch LSP with Debugging` again, then `Cancel` on any pop-ups that appear
3. On the debug panel, click `Attach to Language Server (amazonq)` next to the red stop button
4. Click `Launch LSP with Debugging` again, then `Cancel` on any pop-ups that appear

## Language Server Runtimes Debugging

If you want to connect a local version of language-server-runtimes to aws-toolkit-vscode, follow these steps:

1. Clone https://github.com/aws/language-server-runtimes.git and set it up in the same workspace as this project by cmd+shift+p and "add folder to workspace" and selecting the language-server-runtimes folder that you just cloned. Your VS code folder structure should look like below.
Expand All @@ -75,6 +79,7 @@ If you want to connect a local version of language-server-runtimes to aws-toolki
/amazonq
/language-server-runtimes
```

2. Inside of the language-server-runtimes project run:
```
npm install
Expand Down
137 changes: 75 additions & 62 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/amazonq/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"env": {
"SSMDOCUMENT_LANGUAGESERVER_PORT": "6010",
"WEBPACK_DEVELOPER_SERVER": "http://localhost:8080"
"WEBPACK_DEVELOPER_SERVER": "http://localhost:8080",
// Below allows for overrides used during development
// "__AMAZONQLSP_PATH": "${workspaceFolder}/../../../language-servers/app/aws-lsp-codewhisperer-runtimes/out/agent-standalone.js",
// "__AMAZONQLSP_UI": "${workspaceFolder}/../../../language-servers/chat-client/build/amazonq-ui.js"
"__AMAZONQLSP_PATH": "${workspaceFolder}/../../../language-servers/app/aws-lsp-codewhisperer-runtimes/out/agent-standalone.js",
"__AMAZONQLSP_UI": "${workspaceFolder}/../../../language-servers/chat-client/build/amazonq-ui.js"
},
"envFile": "${workspaceFolder}/.local.env",
"outFiles": ["${workspaceFolder}/dist/**/*.js", "${workspaceFolder}/../core/dist/**/*.js"],
Expand Down
53 changes: 50 additions & 3 deletions packages/amazonq/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,21 @@
]
},
"commands": [
{
"command": "aws.amazonq.stopCmdExecution",
"title": "Stop Amazon Q Command Execution",
"category": "%AWS.amazonq.title%"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the stop shortcut will also used for global stop, right? if yes, then we should change the title. IMO

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but regular prompt without tool execution can be still considered as Q Command right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure why no tool execution can be considered Q command stop / run / reject?

},
{
"command": "aws.amazonq.runCmdExecution",
"title": "Run Amazon Q Command Execution",
"category": "%AWS.amazonq.title%"
},
{
"command": "aws.amazonq.rejectCmdExecution",
"title": "Reject Amazon Q Command Execution",
"category": "%AWS.amazonq.title%"
},
{
"command": "_aws.amazonq.notifications.dismiss",
"title": "%AWS.generic.dismiss%",
Expand Down Expand Up @@ -843,6 +858,24 @@
}
],
"keybindings": [
{
"command": "aws.amazonq.stopCmdExecution",
"key": "ctrl+shift+backspace",
"mac": "cmd+shift+backspace",
"when": "aws.amazonq.amazonqChatLSP.isRunning"
},
{
"command": "aws.amazonq.runCmdExecution",
"key": "ctrl+shift+enter",
"mac": "cmd+shift+enter",
"when": "aws.amazonq.amazonqChatLSP.isRunning"
},
{
"command": "aws.amazonq.rejectCmdExecution",
"key": "ctrl+shift+r",
"mac": "cmd+shift+r",
"when": "aws.amazonq.amazonqChatLSP.isRunning"
},
{
"command": "_aws.amazonq.focusChat.keybinding",
"win": "win+alt+i",
Expand Down Expand Up @@ -1325,26 +1358,40 @@
"fontCharacter": "\\f1de"
}
},
"aws-schemas-registry": {
"aws-sagemaker-code-editor": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was because of npm install not sure why, I reverted it, then the next npm install will change this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the catch na

"description": "AWS Contributed Icon",
"default": {
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
"fontCharacter": "\\f1df"
}
},
"aws-schemas-schema": {
"aws-sagemaker-jupyter-lab": {
"description": "AWS Contributed Icon",
"default": {
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
"fontCharacter": "\\f1e0"
}
},
"aws-stepfunctions-preview": {
"aws-schemas-registry": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yueny2020 got added here after npm install run for dependencies.

"description": "AWS Contributed Icon",
"default": {
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
"fontCharacter": "\\f1e1"
}
},
"aws-schemas-schema": {
"description": "AWS Contributed Icon",
"default": {
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
"fontCharacter": "\\f1e2"
}
},
"aws-stepfunctions-preview": {
"description": "AWS Contributed Icon",
"default": {
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
"fontCharacter": "\\f1e3"
}
}
},
"walkthroughs": [
Expand Down
Loading
Loading