Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'doc/development/vs_code_debugging.md')
-rw-r--r--doc/development/vs_code_debugging.md69
1 files changed, 69 insertions, 0 deletions
diff --git a/doc/development/vs_code_debugging.md b/doc/development/vs_code_debugging.md
new file mode 100644
index 00000000000..08aa4688bfd
--- /dev/null
+++ b/doc/development/vs_code_debugging.md
@@ -0,0 +1,69 @@
+---
+stage: none
+group: unassigned
+info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
+---
+
+# VS Code debugging
+
+This document describes how to set up Rails debugging in [VS Code](https://code.visualstudio.com/).
+
+## Setup
+
+1. Install the `debug` gem by running `gem install debug` inside your `gitlab` folder.
+1. Add the following configuration to your `.vscode/tasks.json` file:
+
+ ```json
+ {
+ "version": "2.0.0",
+ "tasks": [
+ {
+ "label": "start rdbg",
+ "type": "shell",
+ "command": "gdk stop rails-web && GITLAB_RAILS_RACK_TIMEOUT_ENABLE_LOGGING=false PUMA_SINGLE_MODE=true rdbg --open -c -- bin/rails s",
+ "isBackground": true,
+ "problemMatcher": {
+ "owner": "rails",
+ "pattern": {
+ "regexp": "^.*$",
+ },
+ "background": {
+ "activeOnStart": false,
+ "beginsPattern": "^(ok: down:).*$",
+ "endsPattern": "^(DEBUGGER: wait for debugger connection\\.\\.\\.)$"
+ }
+ }
+ }
+ ]
+ }
+ ```
+
+1. Add the following configuration to your `.vscode/launch.json` file:
+
+ ```json
+ {
+ // Use IntelliSense to learn about possible attributes.
+ // Hover to view descriptions of existing attributes.
+ // For more information, see https://go.microsoft.com/fwlink/?linkid=830387.
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "type": "rdbg",
+ "name": "Attach with rdbg",
+ "request": "attach",
+ "preLaunchTask": "start rdbg"
+ }
+ ]
+ }
+ ```
+
+## Debugging
+
+Prerequisite:
+
+- You must have a running GDK instance.
+
+To start debugging, do one of the following:
+
+- Press <kbd>F5</kbd>.
+- Run the `Debug: Start Debugging` command.