anboralabs / sqlfluff-intellij-community

Sqlfluff plugin integration with intellij
GNU General Public License v3.0
0 stars 1 forks source link

Error notifications when opening database #64

Open JoakimNil opened 1 month ago

JoakimNil commented 1 month ago

I'm getting frequent error notifications when having the database viewer open (i.e. viewing a snowflake table using the database plugin). It seems like the database window is treated as a file which sqlfluff is trying and failing to lint.

IDE logs: 2024-07-17 11:48:41,813 [90691595] INFO - #co.anbora.labs.sqlfluff.lint.Linter - sqlfluff linter executing 2024-07-17 11:48:41,813 [90691595] INFO - #co.anbora.labs.sqlfluff.ide.annotator.LinterExternalAnnotator - running sqlfluff Linter external annotator for State(linter=CUSTOM, psiWithDocument=(SqlFile:dummy.sql, DocumentImpl[LightVirtualFile: \dummy.sql]), dialect=snowflake, config=FILE) 2024-07-17 11:48:41,859 [90691641] INFO - #co.anbora.labs.sqlfluff.ide.notifications.LinterNotification - Notification: title: sqlfluff:, content: An error occurred while scanning a file., type: ERROR

dalgarins commented 1 month ago

Could you add some images? About which plugin are you using to view the database, or show me in a gif the whole issue and how to reproduce it.

JoakimNil commented 1 month ago

Sure, here's a screenshot of me viewing a database table: image

It's not an installed plugin, it's just the default bundled plugin "Database Tools and SQL" which is included in all Jetbrains IDEs. I think reproducing the issue should be as simple as using the sqlfluff plugin, connecting the IDE to a database, and opening a table in that database.

It seems like the file is always called "dummy.sql" when viewing a table, so maybe it could be as easy to fix as ignoring files with exactly that name, or at least suppressing notifications for them?