Skip to content

Commit 25bc738

Browse files
committed
docs(amazonq): add instructions for language-server-runtimes setup and Flare breakpoint work-around
1 parent 8e870bf commit 25bc738

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

docs/lsp.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ sequenceDiagram
2525
```
2626

2727
## Language Server Debugging
28+
If you want to connect a local version of language-servers to aws-toolkit-vscode, follow these steps:
2829

2930
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.
3031

@@ -55,6 +56,43 @@ sequenceDiagram
5556
5. Use the `Launch LSP with Debugging` configuration and set breakpoints in VSCode or the language server, Once you run "Launch LSP with Debugging" a new window should start, wait for the plugin to show up there. Then go to the run menu again and run "Attach to Language Server (amazonq)" after this you should be able to add breakpoints in the LSP code.
5657
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
5758
59+
### Breakpoints Work-Around
60+
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.
61+
1. Set your breakpoints and click `Launch LSP with Debugging`
62+
2. Once the debugging session has started, click `Launch LSP with Debugging` again, then `Cancel` on any pop-ups that appear
63+
3. On the debug panel, click `Attach to Language Server (amazonq)` next to the red stop button
64+
4. Click `Launch LSP with Debugging` again, then `Cancel` on any pop-ups that appear
65+
66+
## Language Server Runtimes Debugging
67+
If you want to connect a local version of language-server-runtimes to aws-toolkit-vscode, follow these steps:
68+
69+
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.
70+
71+
```
72+
/aws-toolkit-vscode
73+
/toolkit
74+
/core
75+
/amazonq
76+
/language-server-runtimes
77+
```
78+
2. Inside of the language-server-runtimes project run:
79+
```
80+
npm install
81+
npm run compile
82+
cd runtimes
83+
npm run prepub
84+
cd out
85+
npm link
86+
cd ../../types
87+
npm link
88+
```
89+
If you get an error running `npm run prepub`, you can instead run `npm run prepub:copyFiles` to skip cleaning and testing.
90+
3. Inside of aws-toolkit-vscode run:
91+
```
92+
npm install
93+
npm link @aws/language-server-runtimes @aws/language-server-runtimes-types
94+
```
95+
5896
## Amazon Q Inline Activation
5997
6098
- In order to get inline completion working you must open a supported file type defined in CodewhispererInlineCompletionLanguages in `packages/amazonq/src/app/inline/completion.ts`

0 commit comments

Comments
 (0)