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

Feature/vs code launch tasks #1802

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Conversation

stenya
Copy link
Contributor

@stenya stenya commented Jan 31, 2025

Visual Studio Code launch configurations

Summary by CodeRabbit

  • Development Tools
    • Added Visual Studio Code configuration files for:
      • Go application debugging with multiple launch configurations
      • Angular UI development with Chrome launch configuration
      • Tauri desktop application debugging with multiple configurations
    • Introduced Docker run script for Angular development server
    • Added build and task configurations for Tauri project, including a debug build task

@stenya stenya requested review from vlabo and dhaavi January 31, 2025 16:03
Copy link
Contributor

coderabbitai bot commented Jan 31, 2025

📝 Walkthrough

Walkthrough

This pull request introduces several Visual Studio Code configuration files (.vscode/launch.json and .vscode/tasks.json) across multiple project directories, including the main project, Angular desktop application, and Tauri desktop application. These configurations define launch and task setups for various Go programs, an Angular application, and Tauri projects, facilitating development and debugging workflows. Additionally, a Docker run batch script is added for the Angular development environment.

Changes

File Change Summary
.vscode/launch.json Added launch configurations for five Go programs: portmaster-core, portmaster-start, notifier, observation-hub, and hub with specific execution paths and arguments.
desktop/angular/.vscode/launch.json Added Chrome debugging configuration for running Angular application with a specified URL and source map overrides.
desktop/angular/.vscode/tasks.json Added two tasks: debugproj for starting the project and killnode for terminating Node.js processes.
desktop/angular/docker-run.bat New batch script for running Node.js development server in a Docker container with specified options.
desktop/tauri/.vscode/launch.json Added three debugging configurations for Tauri project: Debug Dev, Debug Prod, and Debug Dev (VS Win Debugger).
desktop/tauri/.vscode/tasks.json New file created with a task labeled "build:debug" for building the project in debug mode using Cargo.

Suggested Reviewers

  • dhaavi

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (2)
desktop/angular/.vscode/tasks.json (1)

40-66: Consider adding error handling for the killnode task.

The killnode task is well-structured for cross-platform support, but it might fail silently if no Node.js processes are running.

Consider adding error handling by modifying the commands:

            "windows": {
-                "command": "taskkill /F /IM node.exe"
+                "command": "taskkill /F /IM node.exe || exit 0"
            },
            "osx":{
-                "command": "killall node"
+                "command": "killall node || true"
            },
            "linux":{
-                "command": "killall node"
+                "command": "killall node || true"
            },
🧰 Tools
🪛 Biome (1.9.4)

[error] 48-48: Expected a property but instead found '}'.

Expected a property here.

(parse)


[error] 51-51: Expected a property but instead found '}'.

Expected a property here.

(parse)

desktop/angular/.vscode/launch.json (1)

15-21: Fix indentation in sourceMapPathOverrides.

The indentation in the sourceMapPathOverrides object is inconsistent with the rest of the file.

Apply this diff to fix the indentation:

            "sourceMapPathOverrides": {
-              "webpack:/*": "${webRoot}/*",
-              "/./*": "${webRoot}/*",
-              "/src/*": "${webRoot}/*",
-              "/*": "*",
-              "/./~/*": "${webRoot}/node_modules/*"
+                "webpack:/*": "${webRoot}/*",
+                "/./*": "${webRoot}/*",
+                "/src/*": "${webRoot}/*",
+                "/*": "*",
+                "/./~/*": "${webRoot}/node_modules/*"
            }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 98137ca and 24c0f96.

📒 Files selected for processing (6)
  • .vscode/launch.json (1 hunks)
  • desktop/angular/.vscode/launch.json (1 hunks)
  • desktop/angular/.vscode/tasks.json (1 hunks)
  • desktop/angular/docker-run.bat (1 hunks)
  • desktop/tauri/.vscode/launch.json (1 hunks)
  • desktop/tauri/.vscode/tasks.json (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • desktop/angular/docker-run.bat
  • desktop/tauri/.vscode/tasks.json
  • .vscode/launch.json
🧰 Additional context used
🪛 Biome (1.9.4)
desktop/angular/.vscode/tasks.json

[error] 39-39: Expected a property but instead found '}'.

Expected a property here.

(parse)


[error] 48-48: Expected a property but instead found '}'.

Expected a property here.

(parse)


[error] 51-51: Expected a property but instead found '}'.

Expected a property here.

(parse)

desktop/angular/.vscode/launch.json

[error] 23-23: Expected an array, an object, or a literal but instead found ']'.

Expected an array, an object, or a literal here.

(parse)

desktop/tauri/.vscode/launch.json

[error] 22-22: Expected a property but instead found '}'.

Expected a property here.

(parse)


[error] 30-30: Expected a property but instead found '}'.

Expected a property here.

(parse)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Build
  • GitHub Check: Build
🔇 Additional comments (4)
desktop/angular/.vscode/tasks.json (1)

4-39: LGTM: Well-configured TypeScript build task.

The debugproj task is well-configured with:

  • TypeScript problem matcher for compilation monitoring
  • Background execution with dedicated panel
  • Proper working directory setup
🧰 Tools
🪛 Biome (1.9.4)

[error] 39-39: Expected a property but instead found '}'.

Expected a property here.

(parse)

desktop/angular/.vscode/launch.json (1)

7-22: LGTM: Well-configured Chrome debugger setup.

The launch configuration is well-structured with:

  • Integration with tasks defined in tasks.json
  • Comprehensive source map path overrides for proper debugging
  • Local development URL setup
desktop/tauri/.vscode/launch.json (2)

31-38: LGTM!

The Windows debug configuration is well-structured with all the required properties and correctly uses the Windows-specific debugger.


37-37: Verify the pre-launch task exists in tasks.json.

The Windows debug configuration references a pre-launch task "build:debug". Please ensure this task is properly defined in the tasks.json file.

Run the following script to verify the task definition:

✅ Verification successful

The pre-launch task "build:debug" exists and is properly configured

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the pre-launch task exists in tasks.json.

# Test: Check if tasks.json exists and contains the build:debug task.
cat desktop/tauri/.vscode/tasks.json | jq '.tasks[] | select(.label == "build:debug")'

Length of output: 145


Script:

#!/bin/bash
# First, check if tasks.json exists
if [ -f "desktop/tauri/.vscode/tasks.json" ]; then
    echo "File exists. Contents:"
    cat desktop/tauri/.vscode/tasks.json
else
    echo "tasks.json does not exist in desktop/tauri/.vscode/"
fi

Length of output: 502

"options": {
"cwd": "${workspaceFolder}/src"
},
},
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix JSON syntax errors: Remove trailing commas.

The JSON file contains trailing commas that need to be removed to ensure valid JSON syntax.

Apply this diff to fix the JSON syntax:

            "options": {
                "cwd": "${workspaceFolder}/src"
-            },
+            }
            "osx":{
-                "command": "killall node",
+                "command": "killall node"
            },
            "linux":{
-                "command": "killall node",
+                "command": "killall node"
            },

Also applies to: 48-48, 51-51

🧰 Tools
🪛 Biome (1.9.4)

[error] 39-39: Expected a property but instead found '}'.

Expected a property here.

(parse)

Comment on lines +23 to +30
{
"type": "lldb",
"request": "launch",
"name": "Debug Prod",
"cargo": {
"args": ["build", "--release", "--manifest-path=./src-tauri/Cargo.toml"]
},
},
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add missing required properties for LLDB debugging (release mode).

The LLDB debug configuration for release mode is missing several required properties:

  • program: Path to the release executable
  • args: Arguments to pass to the program
  • cwd: Working directory for the debugger

Apply this diff to add the missing properties:

 {
   "type": "lldb",
   "request": "launch",
   "name": "Debug Prod",
+  "program": "${workspaceRoot}/src-tauri/target/release/app",
+  "args": [],
+  "cwd": "${workspaceRoot}",
   "cargo": {
     "args": ["build", "--release", "--manifest-path=./src-tauri/Cargo.toml"]
   },
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
"type": "lldb",
"request": "launch",
"name": "Debug Prod",
"cargo": {
"args": ["build", "--release", "--manifest-path=./src-tauri/Cargo.toml"]
},
},
{
"type": "lldb",
"request": "launch",
"name": "Debug Prod",
"program": "${workspaceRoot}/src-tauri/target/release/app",
"args": [],
"cwd": "${workspaceRoot}",
"cargo": {
"args": ["build", "--release", "--manifest-path=./src-tauri/Cargo.toml"]
},
},
🧰 Tools
🪛 Biome (1.9.4)

[error] 30-30: Expected a property but instead found '}'.

Expected a property here.

(parse)

Comment on lines +11 to +22
{
"type": "lldb", // `vscode-lldb` extension has to be installed (https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb)
"request": "launch",
"name": "Debug Dev",
"cargo": {
"args": [
"build",
"--manifest-path=./src-tauri/Cargo.toml",
"--no-default-features"
]
},
},
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add missing required properties for LLDB debugging.

The LLDB debug configuration is missing several required properties:

  • program: Path to the executable to debug
  • args: Arguments to pass to the program
  • cwd: Working directory for the debugger

Apply this diff to add the missing properties:

 {
   "type": "lldb",
   "request": "launch",
   "name": "Debug Dev",
+  "program": "${workspaceRoot}/src-tauri/target/debug/app",
+  "args": [],
+  "cwd": "${workspaceRoot}",
   "cargo": {
     "args": [
       "build",
       "--manifest-path=./src-tauri/Cargo.toml",
       "--no-default-features"
     ]
   },
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
"type": "lldb", // `vscode-lldb` extension has to be installed (https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb)
"request": "launch",
"name": "Debug Dev",
"cargo": {
"args": [
"build",
"--manifest-path=./src-tauri/Cargo.toml",
"--no-default-features"
]
},
},
{
"type": "lldb", // `vscode-lldb` extension has to be installed (https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb)
"request": "launch",
"name": "Debug Dev",
"program": "${workspaceRoot}/src-tauri/target/debug/app",
"args": [],
"cwd": "${workspaceRoot}",
"cargo": {
"args": [
"build",
"--manifest-path=./src-tauri/Cargo.toml",
"--no-default-features"
]
},
},
🧰 Tools
🪛 Biome (1.9.4)

[error] 22-22: Expected a property but instead found '}'.

Expected a property here.

(parse)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (6)
.vscode/launch.json (6)

12-14: Inline Comment Placement in "portmaster-core" Configuration
The "args" property currently ends with an inline comment on line 13, which appears to trigger static analysis errors (e.g., “Expected a property but instead found '}'” on line 14). Since Visual Studio Code’s configuration files support JSON with comments (JSONC), the inline comment may be acceptable in VS Code but not to all linters. Consider moving the comment to a dedicated preceding line. For example:

-            "args": ["--data=D:\\delme\\pmdata", "--disable-interception=true", "-log=trace"],  // TODO: update the path to the data folder if needed
+            // TODO: update the path to the data folder if needed
+            "args": ["--data=D:\\delme\\pmdata", "--disable-interception=true", "-log=trace"],

This will improve compatibility with strict JSON parsers.

🧰 Tools
🪛 Biome (1.9.4)

[error] 14-14: Expected a property but instead found '}'.

Expected a property here.

(parse)


20-22: Inline Comment Placement in "portmaster-start" Configuration
Similar to the previous configuration, the "args" property in the "portmaster-start" block includes an inline comment (line 21) that may trigger static analysis errors. Moving the comment above the property enhances clarity and avoids potential parsing issues. For example:

-            "args": ["app", "--data=D:\\delme\\pmdata", "-log=trace"],                          // TODO: update the path to the data folder if needed
+            // TODO: update the path to the data folder if needed
+            "args": ["app", "--data=D:\\delme\\pmdata", "-log=trace"],
🧰 Tools
🪛 Biome (1.9.4)

[error] 22-22: Expected a property but instead found '}'.

Expected a property here.

(parse)


28-30: Refine Inline Comment in "notifier" Configuration
The "notifier" configuration (lines 24-30) also embeds a TODO comment on the same line as the "args" property. Moving this comment to its own line will help prevent static analysis warnings:

-            "args": ["--data=D:\\delme\\pmdata", "-log=trace"],                                 // TODO: update the path to the data folder if needed
+            // TODO: update the path to the data folder if needed
+            "args": ["--data=D:\\delme\\pmdata", "-log=trace"],
🧰 Tools
🪛 Biome (1.9.4)

[error] 30-30: Expected a property but instead found '}'.

Expected a property here.

(parse)


36-38: Improve Comment Placement in "observation-hub" Configuration
For the "observation-hub" entry, the inline comment on the "args" property (line 37) is similarly placed. To ensure consistency and avoid static analysis errors, consider relocating the comment:

-            "args": ["--data=D:\\delme\\pmdata", "-log=trace"],                                 // TODO: update the path to the data folder if needed
+            // TODO: update the path to the data folder if needed
+            "args": ["--data=D:\\delme\\pmdata", "-log=trace"],
🧰 Tools
🪛 Biome (1.9.4)

[error] 38-38: Expected a property but instead found '}'.

Expected a property here.

(parse)


44-46: Adjust Inline Comment in "hub" Configuration
The "hub" configuration (lines 40-46) follows the same pattern with an inline comment on the "args" property (line 45). As with the others, moving the comment out of the line can help avoid parsing issues:

-            "args": ["--data=D:\\delme\\pmdata_hub", "-log=trace"],                             // TODO: update the path to the data folder if needed
+            // TODO: update the path to the data folder if needed
+            "args": ["--data=D:\\delme\\pmdata_hub", "-log=trace"],
🧰 Tools
🪛 Biome (1.9.4)

[error] 46-46: Expected a property but instead found '}'.

Expected a property here.

(parse)


1-48: Cross-Platform Considerations & Hard-Coded Paths
The configurations currently use absolute Windows paths (e.g., D:\\delme\\pmdata and D:\\delme\\pmdata_hub). If the project is used in a cross-platform context or by collaborators on non-Windows systems, consider replacing these with workspace-relative paths or environment variables. This might further improve the development experience.

🧰 Tools
🪛 Biome (1.9.4)

[error] 14-14: Expected a property but instead found '}'.

Expected a property here.

(parse)


[error] 22-22: Expected a property but instead found '}'.

Expected a property here.

(parse)


[error] 30-30: Expected a property but instead found '}'.

Expected a property here.

(parse)


[error] 38-38: Expected a property but instead found '}'.

Expected a property here.

(parse)


[error] 46-46: Expected a property but instead found '}'.

Expected a property here.

(parse)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 24c0f96 and b967070.

📒 Files selected for processing (1)
  • .vscode/launch.json (1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
.vscode/launch.json

[error] 14-14: Expected a property but instead found '}'.

Expected a property here.

(parse)


[error] 22-22: Expected a property but instead found '}'.

Expected a property here.

(parse)


[error] 30-30: Expected a property but instead found '}'.

Expected a property here.

(parse)


[error] 38-38: Expected a property but instead found '}'.

Expected a property here.

(parse)


[error] 46-46: Expected a property but instead found '}'.

Expected a property here.

(parse)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Build
  • GitHub Check: Build
🔇 Additional comments (1)
.vscode/launch.json (1)

1-6: Overall File Structure and Configuration Format
The file is well-organized and clearly defines multiple launch configurations for various Go applications. The use of descriptive keys like "name", "type", "request", etc., enhances readability and maintainability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants