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
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
48 changes: 48 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "portmaster-core",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmds/portmaster-core",
"args": ["--data=D:\\delme\\pmdata", "--disable-interception=true", "-log=trace"], // TODO: update the path to the data folder if needed
},
{
"name": "portmaster-start",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmds/portmaster-start",
"args": ["app", "--data=D:\\delme\\pmdata", "-log=trace"], // TODO: update the path to the data folder if needed
},
{
"name": "notifier",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmds/notifier",
"args": ["--data=D:\\delme\\pmdata", "-log=trace"], // TODO: update the path to the data folder if needed
},
{
"name": "observation-hub",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmds/observation-hub",
"args": ["--data=D:\\delme\\pmdata", "-log=trace"], // TODO: update the path to the data folder if needed
} ,
{
"name": "hub",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmds/hub",
"args": ["--data=D:\\delme\\pmdata_hub", "-log=trace"], // TODO: update the path to the data folder if needed
}
]
}
24 changes: 24 additions & 0 deletions desktop/angular/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Run UI in Chrome (npm run start)",
"type": "chrome",
"request": "launch",
"preLaunchTask": "debugproj",
"postDebugTask": "killnode",
"url": "http://localhost:4200/",
"webRoot": "${workspaceFolder}",
"sourceMapPathOverrides": {
"webpack:/*": "${webRoot}/*",
"/./*": "${webRoot}/*",
"/src/*": "${webRoot}/*",
"/*": "*",
"/./~/*": "${webRoot}/node_modules/*"
}
},
]
}
68 changes: 68 additions & 0 deletions desktop/angular/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "debugproj",
"type": "npm",
"script": "start",
"isBackground": true,
"presentation": {
"focus": true,
"panel": "dedicated"
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": {
"owner": "typescript",
"source": "ts",
"applyTo": "closedDocuments",
"fileLocation": [
"relative",
"${cwd}"
],
"pattern": "$tsc",
"background": {
"activeOnStart": true,
"beginsPattern": {
"regexp": "(.*?)"
},
"endsPattern": {
"regexp": "Compiled |Failed to compile."
}
}
},
"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)

{
"label": "killnode",
"type": "process",
"windows": {
"command": "taskkill /F /IM node.exe"
},
"osx":{
"command": "killall node",
},
"linux":{
"command": "killall node",
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"group": {
"kind": "build",
"isDefault": true
},
"isBackground": false,
"dependsOrder": "sequence",
"dependsOn": "debugproj",
"problemMatcher": []
}
]
}
24 changes: 24 additions & 0 deletions desktop/angular/docker-run.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@echo off

setlocal

:: Store the current directory
set "current_dir=%cd%"

:: Get base directory for mounting
cd ..\..
set "mnt=%cd%"
:: Return to the original directory
cd /d "%current_dir%"

REM Run Docker container and start dev server
docker run ^
-ti ^
--rm ^
-v %mnt%:/portmaster ^
-w /portmaster/desktop/angular ^
-p 8081:8080 ^
node:latest ^
npm start -- --host 0.0.0.0 --port 8080

endlocal
40 changes: 40 additions & 0 deletions desktop/tauri/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387

// How to debug Tauri project:
// https://v2.tauri.app/develop/debug/
//
"version": "0.2.0",
"configurations": [
{
"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"
]
},
},
Comment on lines +11 to +22
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)

{
"type": "lldb",
"request": "launch",
"name": "Debug Prod",
"cargo": {
"args": ["build", "--release", "--manifest-path=./src-tauri/Cargo.toml"]
},
},
Comment on lines +23 to +30
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)

{
"name": "Debug Dev (VS Win Debugger)",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceRoot}/src-tauri/target/debug/app.exe",
"cwd": "${workspaceRoot}",
"preLaunchTask": "build:debug"
}
]
}
14 changes: 14 additions & 0 deletions desktop/tauri/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build:debug",
"type": "cargo",
"command": "build",
"args": ["--manifest-path=./src-tauri/Cargo.toml",
"--no-default-features"]
}
]
}
Loading