barklan / inline_sql_syntax

Highlight and lint inline SQL strings.
https://marketplace.visualstudio.com/items?itemName=qufiwefefwoyn.inline-sql-syntax
MIT License
58 stars 25 forks source link

Option to disable sql-lint? #110

Open jcalfee opened 1 year ago

jcalfee commented 1 year ago

Is there anyway to use just the syntax highlighting without sql-lint in VSCodium?

jcalfee commented 1 year ago

I think I found it. inlineSQL.lintSQLFiles .. I have pretty bad luck trying to set VSCode plugin JSON settings in general. I'm not sure how that works. I did find a button under Extension Settings / tooltip "Open Settings (JSON)" and I added "inlineSQL.lintSQLFiles": false, .. (shortcut to ~/.config/VSCodium/User/settings.json)

I get nice SQL highlighting but the entire SQL string is underscored with a red error squiggly: image

This is what I do not need: [sql-lint: hungarian-notation] Hungarian notation present in query

I really see very little documentation about how or if these settings hot-reload or not. This time, I restarted the editor and it did seam to disable sql-lint: so syntax highlighting and that confusing error is gone!

However, I tried to narrow it down but now the sql-lint is back and I can't disable it. I'm wondering if it perhaps took a while to load and I thought it was disabled (you know, really no feedback to go on; i'm running blind).

Prior I tried to disable the hungarian-notation in .sql-lint.json .. so after restarting I don't know if that setting was just picked up (or was it not working all along) so I moved that file to a temp folder and restarted. The hungarian-notation error shows up again..

The entire time, the Extension Settings for User and Workspace have not had either "Enable linting .." checked.

The entire time, I had "inlineSQL.lintSQLFiles": false, in ~/.config/VSCodium/User/settings.json

[project_home]/.sql-lint.json

{
"host": "localhost",
"user": "root",
"password": "password",
"ignore-errors": [
"hungarian-notation"
]
}

Now you see why I just want it off so I can get back to really enjoying your fantastic syntax highlighting! Thank you for this plugin, it will be nice to see VSCode improve how they handle these settings though.. Any tips are appreciated. This is pretty standard for me, I unfortunately have to give up on plugins over config issues.

jcalfee commented 1 year ago

This could be something VSCodium related. I'm trying to get some help here https://github.com/VSCodium/vscodium/issues/1509 so I can install and debug this..

jcalfee commented 1 year ago

I found a work-around. Comment out these two lines:

~/.vscode-oss/extensions/qufiwefefwoyn.inline-sql-syntax-2.10.3-universal/out/extension.js

// errors = await (0, sql_lint_1.default)({ sql: sqlStr });
// log.appendLine(`${errors.length} errors found`);

The sql lint runs unless you have DB integration on:

if (configuration.get('enableDBIntegration')) {
// ...
} else {
errors = await (0, sql_lint_1.default)({ sql: sqlStr });
log.appendLine(`${errors.length} errors found`);
}
mnowaczyk commented 11 months ago

This is a huge pain, I start typing and the entire query flashes red due to trailing whitespace.