Skip to content
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

chore: remove preserve--symlink from nodejs debugger option #789

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ This repo contains a minimal vscode client that can be used to easily run and
debug changes to this language server.

1. Run `npm run package` in the root folder
2. Set the breakpoints you need, **make sure to set them in node_modules**, e.g.: to set a breakpoint in the package `aws-lsp-codewhisperer`, set it in the symlinked `node_modules/@aws/lsp-codewhisperer`, not in `server/aws-lsp-codewhisperer`.
2. Set the breakpoints you need.
3. **Make sure that the preLaunchTask option** (for the configuration you are running in `.vscode/launch.json`) is either not set or set to `watch`, **not** `compile`.
4. In the `Run & Debug` menu, run `"Launch as VSCode Extension + Debugging"`. Make sure this is launching the server you wish to use, look at the [launch configuration](.vscode/launch.json#L202). Keep the `Attach to AWS Documents Language Server` to use the debugger.
5. When the debugging is launched, select the `Attach to AWS Documents Language Server` option from the drop down menu (close to pause/stop buttons).
Expand Down Expand Up @@ -225,7 +225,7 @@ Using other clients can also be done with the bundle created from this package.

1. Produce a local server bundle `npm run package`. The `app/` folder contains the configuration of server(s) and it's runtime(s).
2. Take note of the bundle you wish to use. For this example we will use `app/aws-lsp-codewhisperer-runtimes/out/token-standalone.js`.
3. Run the bundle using these args `node --inspect=6012 {rootPath}/app/aws-lsp-codewhisperer-runtimes/out/token-standalone.js --nolazy --preserve-symlinks --stdio --pre-init-encryption --set-credentials-encryption-key` or adjust as needed. Refer to the [activation file](client/vscode/src/activation.ts). *NOTE: make sure that --inspect or --inspect-brk args are passed right after the `node` command*
3. Run the bundle using these args `node --inspect=6012 {rootPath}/app/aws-lsp-codewhisperer-runtimes/out/token-standalone.js --nolazy --stdio --pre-init-encryption --set-credentials-encryption-key` or adjust as needed. Refer to the [activation file](client/vscode/src/activation.ts). *NOTE: make sure that --inspect or --inspect-brk args are passed right after the `node` command*
4. Attach the debugger you wish to use to the node process. Example in Visual Studio [here](https://learn.microsoft.com/en-us/visualstudio/debugger/attach-to-running-processes-with-the-visual-studio-debugger?view=vs-2022#BKMK_Attach_to_a_running_process)

## Testing
Expand Down
2 changes: 1 addition & 1 deletion client/vscode/src/activation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export async function activateDocumentsLanguageServer(extensionContext: Extensio
const enableBearerTokenProvider = process.env.ENABLE_TOKEN_PROVIDER === 'true'
const enableEncryptionInit = enableIamProvider || enableBearerTokenProvider

const debugOptions = { execArgv: ['--nolazy', '--inspect=6012', '--preserve-symlinks'] }
const debugOptions = { execArgv: ['--nolazy', '--inspect=6012'] }

// If the extension is launch in debug mode the debug server options are use
// Otherwise the run options are used
Expand Down
Loading