Skip to content

Commit b04e1d7

Browse files
committed
Add configuration to disable linting
This will allow to use syntax highlighting, without linting.
1 parent 22148f4 commit b04e1d7

4 files changed

Lines changed: 12 additions & 1 deletion

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ Integration with real database is available and controlled through VSCode option
111111
"inlineSQL.dbHost": "localhost",
112112
"inlineSQL.dbPort": 5432,
113113
"inlineSQL.dbUser": "postgres",
114-
"inlineSQL.dbPassword": "postgres"
114+
"inlineSQL.dbPassword": "postgres",
115+
"inlineSQL.lint": true
115116
}
116117
```
117118

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@
165165
"default": "postgres",
166166
"markdownDescription": "Database password."
167167
},
168+
"inlineSQL.lint": {
169+
"type": "boolean",
170+
"default": true,
171+
"markdownDescription": "Disable lint, use only syntax highlighting."
172+
},
168173
"inlineSQL.lintSQLFiles": {
169174
"type": "boolean",
170175
"default": false,

src/configuration.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export type Configuration = {
1515
dbUser: string;
1616
dbPassword: string;
1717
lintSQLFiles: boolean;
18+
lint: boolean;
1819
};
1920

2021
export function getConfiguration() {

src/extension.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ async function checkRange(
1212
): Promise<vscode.Diagnostic[]> {
1313
const diagnostics: vscode.Diagnostic[] = [];
1414

15+
if (!configuration.get('lint')) {
16+
return diagnostics;
17+
}
18+
1519
const sqlStr = doc.getText(range);
1620

1721
let errors = null;

0 commit comments

Comments
 (0)