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/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" 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