From 43a41819cbb1d400c8787936e3d35b8b65c55a29 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sun, 16 Feb 2020 21:03:24 +0200 Subject: docs: remove obsolescence notice in debugging.md --- docs/dev/debugging.md | 2 -- 1 file changed, 2 deletions(-) (limited to 'docs/dev') diff --git a/docs/dev/debugging.md b/docs/dev/debugging.md index 1ccf4dca2..f868e6998 100644 --- a/docs/dev/debugging.md +++ b/docs/dev/debugging.md @@ -1,7 +1,5 @@ # Debugging vs Code plugin and the Language Server -**NOTE:** the information here is mostly obsolete - Install [LLDB](https://lldb.llvm.org/) and the [LLDB Extension](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb). Checkout rust rust-analyzer and open it in vscode. -- cgit v1.2.3 From 64112b0b61cd842f2186240374a89ae05a8d0bb9 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sun, 16 Feb 2020 22:58:17 +0200 Subject: docs: update debugging.md with the freshest VSCode debugging information --- docs/dev/debugging.md | 61 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 18 deletions(-) (limited to 'docs/dev') diff --git a/docs/dev/debugging.md b/docs/dev/debugging.md index f868e6998..5a942ba5d 100644 --- a/docs/dev/debugging.md +++ b/docs/dev/debugging.md @@ -1,34 +1,58 @@ # Debugging vs Code plugin and the Language Server -Install [LLDB](https://lldb.llvm.org/) and the [LLDB Extension](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb). +## Prerequsities -Checkout rust rust-analyzer and open it in vscode. +- Install [LLDB](https://lldb.llvm.org/) and the [LLDB Extension](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb) VSCode extensions. +- Open the root folder in VSCode. Here you can access the preconfigured debug setups. -``` -$ git clone https://github.com/rust-analyzer/rust-analyzer.git --depth 1 -$ cd rust-analyzer -$ code . -``` + Debug options view + +- Install all TypeScript dependencies + ```bash + cd editors/code + npm i + ``` + +## Common knowledge + +* All debug configurations open new `[Extension Development Host]` VSCode instance +where **only** your `rust-analyzer` extension is enabled. +* To activate the extension you need to open any Rust project folder in `[Extension Development Host]`. -- To attach to the `lsp server` in linux you'll have to run: - `echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope` +## Debug TypeScript VSCode extension - This enables ptrace on non forked processes +- `Run Extension` - runs the extension with globally installed `ra_lsp_server` binary. +- `Run Extension (Dev Server)` - runs extension with binary from your locally built `target/debug/ra_lsp_server`. -- Ensure the dependencies for the extension are installed, run the `npm: install - editors/code` task in vscode. +TypeScript debugging is configured to watch your source edits and recompile. +To apply changes to already running debug process press Ctrl+Shift+P and run the following command in your `[Extension Development Host]` + +``` +> Developer: Reload Window +``` + +## Debug Rust LSP server + +- To attach to the `lsp server` in linux you'll have to run: -- Launch the `Debug Extension`, this will build the extension and the `lsp server`. + ``` + echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope + ``` -- A new instance of vscode with `[Extension Development Host]` in the title. + This enables ptrace on non-forked processes - Don't worry about disabling `rls` all other extensions will be disabled but this one. +- Enable debug symbols in `Cargo.toml`: + ```toml + [profile.dev] + debug = 2 + ``` -- In the new vscode instance open a rust project, and navigate to a rust file +- Select `Run Extension (Dev Server)` to run your local built `target/debug/ra_lsp_server`. -- In the original vscode start an additional debug session (the three periods in the launch) and select `Debug Lsp Server`. +- In the original VSCode window once again select `Attach To Server` debug configuration. -- A list of running processes should appear select the `ra_lsp_server` from this repo. +- A list of running processes should appear. Select the `ra_lsp_server` from this repo. - Navigate to `crates/ra_lsp_server/src/main_loop.rs` and add a breakpoint to the `on_task` function. @@ -36,7 +60,8 @@ $ code . ## Demo -![demonstration of debugging](https://user-images.githubusercontent.com/1711539/51384036-254fab80-1b2c-11e9-824d-95f9a6e9cf4f.gif) +- [Debugging TypeScript VScode extension](https://www.youtube.com/watch?v=T-hvpK6s4wM). +- [Debugging Rust LSP server](https://www.youtube.com/watch?v=EaNb5rg4E0M). ## Troubleshooting -- cgit v1.2.3 From 200a2475a2044f101f7bb70d053dafe3409b8ff6 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sun, 16 Feb 2020 23:21:11 +0200 Subject: docs: fix typo --- docs/dev/debugging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/dev') diff --git a/docs/dev/debugging.md b/docs/dev/debugging.md index 5a942ba5d..8208b1435 100644 --- a/docs/dev/debugging.md +++ b/docs/dev/debugging.md @@ -48,7 +48,7 @@ To apply changes to already running debug process press Ctrl+Shift+P debug = 2 ``` -- Select `Run Extension (Dev Server)` to run your local built `target/debug/ra_lsp_server`. +- Select `Run Extension (Dev Server)` to run your locally built `target/debug/ra_lsp_server`. - In the original VSCode window once again select `Attach To Server` debug configuration. -- cgit v1.2.3 From 351cc9021e7e3f91a4779852dabd2d2ed04faa0c Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sun, 16 Feb 2020 23:33:23 +0200 Subject: Add the article MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Laurențiu Nicola --- docs/dev/debugging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/dev') diff --git a/docs/dev/debugging.md b/docs/dev/debugging.md index 8208b1435..86386dd0d 100644 --- a/docs/dev/debugging.md +++ b/docs/dev/debugging.md @@ -22,7 +22,7 @@ where **only** your `rust-analyzer` extension is enabled. ## Debug TypeScript VSCode extension -- `Run Extension` - runs the extension with globally installed `ra_lsp_server` binary. +- `Run Extension` - runs the extension with the globally installed `ra_lsp_server` binary. - `Run Extension (Dev Server)` - runs extension with binary from your locally built `target/debug/ra_lsp_server`. TypeScript debugging is configured to watch your source edits and recompile. -- cgit v1.2.3 From 79625e2dc2c6a94c84d93684f6860ec1493d8854 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sun, 16 Feb 2020 23:35:10 +0200 Subject: Apply better wording as per lnicola MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Laurențiu Nicola --- docs/dev/debugging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/dev') diff --git a/docs/dev/debugging.md b/docs/dev/debugging.md index 86386dd0d..9346aab53 100644 --- a/docs/dev/debugging.md +++ b/docs/dev/debugging.md @@ -23,7 +23,7 @@ where **only** your `rust-analyzer` extension is enabled. ## Debug TypeScript VSCode extension - `Run Extension` - runs the extension with the globally installed `ra_lsp_server` binary. -- `Run Extension (Dev Server)` - runs extension with binary from your locally built `target/debug/ra_lsp_server`. +- `Run Extension (Dev Server)` - runs extension with the locally built LSP server (`target/debug/ra_lsp_server`). TypeScript debugging is configured to watch your source edits and recompile. To apply changes to already running debug process press Ctrl+Shift+P and run the following command in your `[Extension Development Host]` -- cgit v1.2.3 From 1a96d4c15c278a3e574c50a00b97c0290945d214 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sun, 16 Feb 2020 23:35:41 +0200 Subject: Make Rust Great Again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Laurențiu Nicola --- docs/dev/debugging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/dev') diff --git a/docs/dev/debugging.md b/docs/dev/debugging.md index 9346aab53..2078ac219 100644 --- a/docs/dev/debugging.md +++ b/docs/dev/debugging.md @@ -56,7 +56,7 @@ To apply changes to already running debug process press Ctrl+Shift+P - Navigate to `crates/ra_lsp_server/src/main_loop.rs` and add a breakpoint to the `on_task` function. -- Go back to the `[Extension Development Host]` instance and hover over a rust variable and your breakpoint should hit. +- Go back to the `[Extension Development Host]` instance and hover over a Rust variable and your breakpoint should hit. ## Demo -- cgit v1.2.3 From dc90507dbeccc62ee14b45df83ee6f5f4baae24d Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sun, 16 Feb 2020 23:36:16 +0200 Subject: Migrate from 'npm i' to 'npm install' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Laurențiu Nicola --- docs/dev/debugging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/dev') diff --git a/docs/dev/debugging.md b/docs/dev/debugging.md index 2078ac219..4ff3fc572 100644 --- a/docs/dev/debugging.md +++ b/docs/dev/debugging.md @@ -10,7 +10,7 @@ - Install all TypeScript dependencies ```bash cd editors/code - npm i + npm install ``` ## Common knowledge -- cgit v1.2.3 From 329a1b665d88fbba2da7d09539dc12f26e41525c Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sun, 16 Feb 2020 23:38:25 +0200 Subject: Add an article MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Laurențiu Nicola --- docs/dev/debugging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/dev') diff --git a/docs/dev/debugging.md b/docs/dev/debugging.md index 4ff3fc572..c8b466931 100644 --- a/docs/dev/debugging.md +++ b/docs/dev/debugging.md @@ -26,7 +26,7 @@ where **only** your `rust-analyzer` extension is enabled. - `Run Extension (Dev Server)` - runs extension with the locally built LSP server (`target/debug/ra_lsp_server`). TypeScript debugging is configured to watch your source edits and recompile. -To apply changes to already running debug process press Ctrl+Shift+P and run the following command in your `[Extension Development Host]` +To apply changes to an already running debug process press Ctrl+Shift+P and run the following command in your `[Extension Development Host]` ``` > Developer: Reload Window -- cgit v1.2.3 From 3db91db4218655531dd5b67751483659eb5132cd Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sun, 16 Feb 2020 23:40:31 +0200 Subject: Reworded abit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Laurențiu Nicola --- docs/dev/debugging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/dev') diff --git a/docs/dev/debugging.md b/docs/dev/debugging.md index c8b466931..6db3645f7 100644 --- a/docs/dev/debugging.md +++ b/docs/dev/debugging.md @@ -34,7 +34,7 @@ To apply changes to an already running debug process press Ctrl+Shift+P Date: Sun, 16 Feb 2020 23:42:10 +0200 Subject: Add the article MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Laurențiu Nicola --- docs/dev/debugging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/dev') diff --git a/docs/dev/debugging.md b/docs/dev/debugging.md index 6db3645f7..0c8c5ec45 100644 --- a/docs/dev/debugging.md +++ b/docs/dev/debugging.md @@ -50,7 +50,7 @@ To apply changes to an already running debug process press Ctrl+Shift+P Date: Sun, 16 Feb 2020 23:42:48 +0200 Subject: Add more verbose description MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Laurențiu Nicola --- docs/dev/debugging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/dev') diff --git a/docs/dev/debugging.md b/docs/dev/debugging.md index 0c8c5ec45..8f794d707 100644 --- a/docs/dev/debugging.md +++ b/docs/dev/debugging.md @@ -42,7 +42,7 @@ To apply changes to an already running debug process press Ctrl+Shift+P Date: Sun, 16 Feb 2020 23:43:13 +0200 Subject: Remove ptrace note MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Laurențiu Nicola --- docs/dev/debugging.md | 1 - 1 file changed, 1 deletion(-) (limited to 'docs/dev') diff --git a/docs/dev/debugging.md b/docs/dev/debugging.md index 8f794d707..ae1f39f8e 100644 --- a/docs/dev/debugging.md +++ b/docs/dev/debugging.md @@ -40,7 +40,6 @@ To apply changes to an already running debug process press Ctrl+Shift+P Date: Sun, 16 Feb 2020 23:47:12 +0200 Subject: Fix typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Laurențiu Nicola --- docs/dev/debugging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/dev') diff --git a/docs/dev/debugging.md b/docs/dev/debugging.md index ae1f39f8e..2e133184d 100644 --- a/docs/dev/debugging.md +++ b/docs/dev/debugging.md @@ -1,6 +1,6 @@ # Debugging vs Code plugin and the Language Server -## Prerequsities +## Prerequisites - Install [LLDB](https://lldb.llvm.org/) and the [LLDB Extension](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb) VSCode extensions. - Open the root folder in VSCode. Here you can access the preconfigured debug setups. -- cgit v1.2.3 From 2d7fe230f57bdbd8e0bb7ac89632a43a65210c1f Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sun, 16 Feb 2020 23:52:41 +0200 Subject: docs: Fix grammar mistakes --- docs/dev/debugging.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/dev') diff --git a/docs/dev/debugging.md b/docs/dev/debugging.md index 2e133184d..e6b082156 100644 --- a/docs/dev/debugging.md +++ b/docs/dev/debugging.md @@ -1,8 +1,8 @@ -# Debugging vs Code plugin and the Language Server +# Debugging VSCode plugin and the language server ## Prerequisites -- Install [LLDB](https://lldb.llvm.org/) and the [LLDB Extension](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb) VSCode extensions. +- Install [LLDB](https://lldb.llvm.org/) and the [LLDB Extension](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb). - Open the root folder in VSCode. Here you can access the preconfigured debug setups. Debug options view @@ -15,8 +15,8 @@ ## Common knowledge -* All debug configurations open new `[Extension Development Host]` VSCode instance -where **only** your `rust-analyzer` extension is enabled. +* All debug configurations open a new `[Extension Development Host]` VSCode instance +where **only** the `rust-analyzer` extension being debugged is enabled. * To activate the extension you need to open any Rust project folder in `[Extension Development Host]`. -- cgit v1.2.3