From 7416fa9873cd360d93a88bc7980d3b3b4add1b18 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Thu, 19 Aug 2021 12:55:12 -0700 Subject: [PATCH 1/3] Add launch file debug configuration to folder's `launch.json` --- .vscode/launch.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index e27b257da4..6661f21b66 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -47,6 +47,12 @@ "${workspaceFolder}/out/**/*.js" ], "preLaunchTask": "Build" - } + }, + { + "name": "PowerShell Launch Current File", + "type": "PowerShell", + "request": "launch", + "script": "${file}", + }, ] } From 2101b7a16934d0962782ff2800f411641dfe0872 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Mon, 23 Aug 2021 11:00:24 -0700 Subject: [PATCH 2/3] Remove `*All` build tasks from project These existed to invoke tasks in the associated PowerShellEditorServices folder; however, the `Build` task was previously fixed to automatically build and copy that dependency when needed. Furthermore, the existing VS Code tasks meant that for developers' ease-of-use we could already clean, build, and test that dependency. Finally, CI did not depend on the `All` section of these for testing, as we have separate CI/CD pipelines for each project, so these were redundant and confusing. --- .vscode/launch.json | 2 +- .vscode/tasks.json | 33 ++++++++------------------------- vscode-powershell.build.ps1 | 8 +------- 3 files changed, 10 insertions(+), 33 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 6661f21b66..270395ae14 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -14,7 +14,7 @@ "outFiles": [ "${workspaceFolder}/out/src/**/*.js" ], - "preLaunchTask": "BuildAll" + "preLaunchTask": "Build" }, { "name": "Launch Extension (Build client only)", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 16dc6000d5..75bd70aa16 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -37,49 +37,32 @@ }, "tasks": [ { - "label": "Install", + "label": "Restore", "type": "shell", "command": "Invoke-Build Restore", - "problemMatcher": [] - }, - { - "label": "CleanAll", - "type": "shell", - "command": "Invoke-Build CleanAll", - "problemMatcher": [] }, { "label": "Clean", "type": "shell", "command": "Invoke-Build Clean", - "problemMatcher": [] - }, - { - "label": "BuildAll", - "type": "shell", - "command": "Invoke-Build BuildAll", - "group": { - "kind": "build", - "isDefault": true - }, - "problemMatcher": [] }, { "label": "Build", "type": "shell", "command": "Invoke-Build Build", "group": "build", - "problemMatcher": [] }, { "label": "Test", "type": "shell", "command": "Invoke-Build Test", - "group": { - "kind": "test", - "isDefault": true - }, - "problemMatcher": [] + "group": "test", + }, + { + "label": "Package", + "type": "shell", + "command": "Invoke-Build Package", + "group": "build" } ] } diff --git a/vscode-powershell.build.ps1 b/vscode-powershell.build.ps1 index 1904c1376c..8ae05d3222 100644 --- a/vscode-powershell.build.ps1 +++ b/vscode-powershell.build.ps1 @@ -49,8 +49,6 @@ task CleanEditorServices -If (Get-EditorServicesPath) { Invoke-Build Clean (Get-EditorServicesPath) } -task CleanAll CleanEditorServices, Clean - #endregion #region Build tasks @@ -69,8 +67,6 @@ task Build CopyEditorServices, Restore, { exec { & npm run compile } } -task BuildAll BuildEditorServices, Build - #endregion #region Test tasks @@ -84,8 +80,6 @@ task TestEditorServices -If (Get-EditorServicesPath) { Invoke-Build Test (Get-EditorServicesPath) } -task TestAll TestEditorServices, Test - #endregion #region Package tasks @@ -106,7 +100,7 @@ task UpdateReadme -If { $script:IsPreviewExtension } { } } -task Package UpdateReadme, { +task Package UpdateReadme, Build, { assert { Test-Path ./modules/PowerShellEditorServices } Write-Host "`n### Packaging $($script:PackageJson.name)-$($script:PackageJson.version).vsix`n" -ForegroundColor Green exec { & npm run package } From 8ebbb5504adf74d3bd2d8182263e9509037355be Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Mon, 23 Aug 2021 11:03:22 -0700 Subject: [PATCH 3/3] Fix `cwd` for PowerShell: Launch Current File contributed configuration --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a12569c5fa..c8a0822040 100644 --- a/package.json +++ b/package.json @@ -459,7 +459,7 @@ "type": "PowerShell", "request": "launch", "script": "^\"\\${file}\"", - "cwd": "^\"\\${file}\"" + "cwd": "^\"\\${workspaceFolder}\"" } }, {