Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
```

Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export type Configuration = {
dbUser: string;
dbPassword: string;
lintSQLFiles: boolean;
lint: boolean;
};

export function getConfiguration() {
Expand Down
4 changes: 4 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ async function checkRange(
): Promise<vscode.Diagnostic[]> {
const diagnostics: vscode.Diagnostic[] = [];

if (!configuration.get('lint')) {
return diagnostics;
}

const sqlStr = doc.getText(range);

let errors = null;
Expand Down