diff --git a/README.md b/README.md index c881ee8..ce31403 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,8 @@ Integration with real database is available and controlled through VSCode option "inlineSQL.dbHost": "localhost", "inlineSQL.dbPort": 5432, "inlineSQL.dbUser": "postgres", - "inlineSQL.dbPassword": "postgres" + "inlineSQL.dbPassword": "postgres", + "inlineSQL.lint": true } ``` diff --git a/package.json b/package.json index 58c08c0..6af7236 100644 --- a/package.json +++ b/package.json @@ -165,6 +165,11 @@ "default": "postgres", "markdownDescription": "Database password." }, + "inlineSQL.lint": { + "type": "boolean", + "default": true, + "markdownDescription": "Disable lint, use only syntax highlighting." + }, "inlineSQL.lintSQLFiles": { "type": "boolean", "default": false, diff --git a/src/configuration.ts b/src/configuration.ts index 0f21b4e..5699037 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -15,6 +15,7 @@ export type Configuration = { dbUser: string; dbPassword: string; lintSQLFiles: boolean; + lint: boolean; }; export function getConfiguration() { diff --git a/src/extension.ts b/src/extension.ts index 69db3e2..789fbbb 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -12,6 +12,10 @@ async function checkRange( ): Promise { const diagnostics: vscode.Diagnostic[] = []; + if (!configuration.get('lint')) { + return diagnostics; + } + const sqlStr = doc.getText(range); let errors = null;