From 039d45d6f6b0d774c5c77361e53b7d6c81f3e3e1 Mon Sep 17 00:00:00 2001 From: Garry Trinder Date: Fri, 2 May 2025 10:44:02 +0100 Subject: [PATCH 1/2] Increment version to 0.22.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1a45570..d986784 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dev-proxy-toolkit", - "version": "0.22.0", + "version": "0.22.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dev-proxy-toolkit", - "version": "0.22.0", + "version": "0.22.1", "dependencies": { "json-to-ast": "^2.1.0" }, diff --git a/package.json b/package.json index af73fda..cfbb771 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "dev-proxy-toolkit", "displayName": "Dev Proxy Toolkit", "description": "Makes it easy to create and update Dev Proxy configuration files.", - "version": "0.22.0", + "version": "0.22.1", "publisher": "garrytrinder", "engines": { "vscode": "^1.89.0" From 3b2d66cdd4a8e418ef232c012fc18af80ea5b0b5 Mon Sep 17 00:00:00 2001 From: Garry Trinder Date: Fri, 2 May 2025 10:48:16 +0100 Subject: [PATCH 2/2] Fix start command. Closes #248 --- CHANGELOG.md | 6 +++++- src/helpers.ts | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5a09c7..2a258d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 > **Note**: odd version numbers, for example, `0.13.0`, are not included in this changelog. They are used to test the new features and fixes before the final release. -## [0.22.0] - 2025-05-01 +## [0.22.1] - 2025-05-02 ### Added: @@ -20,6 +20,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Snippets: Updated all snippets to use `v0.27.0` schema +### Fixed: + +- Command: Using `dev-proxy-toolkit.start` would throw an error when active file is not a Dev Proxy config file + ## [0.20.0] - 2025-04-01 ### Added: diff --git a/src/helpers.ts b/src/helpers.ts index a186b7e..59fd632 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -47,6 +47,11 @@ export const getStartPositionFromASTNode = ( export const isConfigFile = (document: vscode.TextDocument) => { let isConfigFile = false; + const fileName = document.fileName.toLowerCase(); + if (!(fileName.endsWith('.json') || fileName.endsWith('.jsonc'))) { + return false; + } + const documentNode = parse(document.getText()) as parse.ObjectNode; // we know that its a config file if