diff --git a/CHANGELOG.md b/CHANGELOG.md index 47c63c1..21689ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.6.6 + +- fix: regression in nested swift projects #29 + # 1.6.5 - fix: respect nested swift projects #26 diff --git a/package.json b/package.json index a5848ce..b6548b2 100755 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "type": "git", "url": "https://github.com/vknabel/vscode-swiftformat" }, - "version": "1.6.5", + "version": "1.6.6", "license": "MIT", "author": { "name": "Valentin Knabel", @@ -20,7 +20,7 @@ "theme": "light" }, "engines": { - "vscode": "^1.26.0" + "vscode": "^1.80.0" }, "categories": [ "Formatters", diff --git a/src/Current.ts b/src/Current.ts index cd0794f..2c73810 100644 --- a/src/Current.ts +++ b/src/Current.ts @@ -2,7 +2,7 @@ export interface Current { editor: { openURL(url: string): Thenable; reportIssueForError( - error: Partial + error: Partial, ): Thenable; showErrorMessage( message: string, @@ -38,15 +38,16 @@ export function prodEnvironment(): Current { async openURL(url: string) { await vscode.commands.executeCommand( "vscode.open", - vscode.Uri.parse(url) + vscode.Uri.parse(url), ); }, async reportIssueForError(error) { - const title = `Report ${error.code || ""} ${error.message || - ""}`.replace(/\\n/, " "); + const title = `Report ${error.code || ""} ${ + error.message || "" + }`.replace(/\\n/, " "); const body = "`" + (error.stack || JSON.stringify(error)) + "`"; await Current.editor.openURL( - url`https://github.com/vknabel/vscode-swiftformat/issues/new?title=${title}&body=${body}` + url`https://github.com/vknabel/vscode-swiftformat/issues/new?title=${title}&body=${body}`, ); }, showErrorMessage: (message: string, ...actions: T[]) => @@ -59,7 +60,7 @@ export function prodEnvironment(): Current { ) => vscode.window.showWarningMessage(message, ...actions) as Thenable< T | undefined - > + >, }, config: { isEnabled: () => @@ -76,8 +77,8 @@ export function prodEnvironment(): Current { swiftFormatPath: (document: vscode.TextDocument) => { // Support running from Swift PM projects const possibleLocalPaths = glob.sync( - "**/.build/{release,debug}/swiftlint", - { maxDepth: 5 } + "**/.build/{release,debug}/swiftformat", + { maxDepth: 5 }, ); for (const path of possibleLocalPaths) { // Grab the project root from the local workspace @@ -113,8 +114,8 @@ export function prodEnvironment(): Current { vscode.workspace .getConfiguration() .get("swiftformat.configSearchPaths", [".swiftformat"]) - .map(absolutePath) - } + .map(absolutePath), + }, }; }