diff --git a/.eslintrc.json b/.eslintrc.json index 53d787d..2092aaa 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -28,13 +28,6 @@ "simple-import-sort/exports": "error", "tsdoc/syntax": "warn", // other - "comma-dangle": ["error", { - "arrays": "always-multiline", - "objects": "always-multiline", - "imports": "always-multiline", - "exports": "always-multiline", - "functions": "always-multiline" - }], "eol-last": "error", "no-unused-vars": "off", "no-trailing-spaces": "error", diff --git a/CHANGELOG.md b/CHANGELOG.md index 8895831..1d7cc29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to the "sqlfluff" extension will be documented in this file. +## [3.1.2] - 2024-07-19 + +- Attempt to fix "File path not found" [Issue](https://github.com/sqlfluff/vscode-sqlfluff/issues/147) +- Datacoves' dbt-core-interface improvements + new response. Thanks to BAntonellini's [Pull Request](https://github.com/sqlfluff/vscode-sqlfluff/pull/144) +- Prevent "Specified path does not exist" error for empty untitled files. Thanks to jackfrey13's [Pull Request](https://github.com/sqlfluff/vscode-sqlfluff/pull/149) + ## [3.1.1] - 2024-07-10 - Show the rule name in the problems tab [Issue](https://github.com/sqlfluff/vscode-sqlfluff/issues/134) diff --git a/package.json b/package.json index e3b7582..e9d8c92 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vscode-sqlfluff", "displayName": "sqlfluff", - "version": "3.1.1", + "version": "3.1.2", "description": "A linter and auto-formatter for SQLfluff, a popular linting tool for SQL and dbt.", "publisher": "dorzey", "icon": "images/icon.png", diff --git a/src/features/providers/formatter/format.ts b/src/features/providers/formatter/format.ts index 8a88daa..bcaaf33 100644 --- a/src/features/providers/formatter/format.ts +++ b/src/features/providers/formatter/format.ts @@ -12,7 +12,7 @@ export class FormattingProvider implements vscode.DocumentFormattingEditProvider async provideDocumentFormattingEdits( document: vscode.TextDocument, options: vscode.FormattingOptions, - token: vscode.CancellationToken, + token: vscode.CancellationToken ): Promise { const filePath = Utilities.normalizePath(document.fileName); const workspaceFolder = vscode.workspace.workspaceFolders @@ -57,7 +57,7 @@ export class FormattingProvider implements vscode.DocumentFormattingEditProvider workingDirectory, CommandType.FIX, Configuration.formatFileArguments(), - commandOptions, + commandOptions ); if (!result.succeeded) { @@ -99,7 +99,7 @@ export class FormattingProvider implements vscode.DocumentFormattingEditProvider workingDirectory, CommandType.FIX, Configuration.formatFileArguments(), - commandOptions, + commandOptions ); if (!result.succeeded) { diff --git a/src/features/providers/linter/lint.ts b/src/features/providers/linter/lint.ts index 5f60ace..194a751 100644 --- a/src/features/providers/linter/lint.ts +++ b/src/features/providers/linter/lint.ts @@ -38,7 +38,7 @@ export default class LintingProvider { delete this.delayers[textDocument.uri.toString()]; }, null, - subscriptions, + subscriptions ); } @@ -89,7 +89,7 @@ export default class LintingProvider { textDocument?: vscode.TextDocument, currentDocument = false, forceLint = false, - workspacePath?: string, + workspacePath?: string ): void { if ( (textDocument && !this.linter.languageId.includes(textDocument.languageId)) || @@ -120,14 +120,14 @@ export default class LintingProvider { public async doLint( document?: vscode.TextDocument, currentDocument?: boolean, - workspacePath?: string, + workspacePath?: string ): Promise { const workspaceFolder = vscode.workspace.workspaceFolders ? vscode.workspace.workspaceFolders[0].uri.fsPath : undefined; const rootPath = workspaceFolder ? Utilities.normalizePath(workspaceFolder) : undefined; const workingDirectory = workspacePath ?? Configuration.workingDirectory(rootPath); - const filePath = document && !document.isUntitled ? Utilities.normalizePath(document.fileName) : workingDirectory; + const filePath = document && document.fileName ? Utilities.normalizePath(document.fileName) : workingDirectory; if (!filePath) { Utilities.outputChannel.appendLine("ERROR: File path not found."); diff --git a/src/features/providers/sqlfluff.ts b/src/features/providers/sqlfluff.ts index 886b5cc..e465883 100644 --- a/src/features/providers/sqlfluff.ts +++ b/src/features/providers/sqlfluff.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-async-promise-executor */ import * as CProcess from "child_process"; import * as path from "path"; import { StringDecoder } from "string_decoder";