You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vscode-sqltools uses the generic autocomplete parser from Hue - in plugins/intellisense/language-server.ts: import sqlAutocompleteParser from 'gethue/parsers/genericAutocompleteParser.js';
This falls over on certain valid aspects of IRIS SQL syntax - e.g,. implicit joins (arrow syntax) and operators/functions that are ObjectScript-specific. (This is the actual root cause for what I observed in #32 .) Predictably, in a file using such syntax, autocomplete fails after the unrecognized string.
Fixing this would require an upstream change to allow a driver to provide its own autocomplete parser, then actually implementing such a parser (see: https://docs.gethue.com/developer/development/#sql-parsers). Theoretically existing concepts from the generic autocomplete parser would transfer (although it seems that reliance on the autocomplete parser in vscode-tools might run too deep to be generic; e.g., there's a reference to id.cte and we don't support CTEs in IRIS SQL at this point). From some poking around in the Hue docs I think we'd probably run into issues with arrow syntax specifically - the "table" context is dependent on metadata on the server (what's the type of the column?), not just the SQL syntax.
The text was updated successfully, but these errors were encountered:
Poked around a bit with Hue parsers this morning. Their documentation on how to create a new parser is irrelevant because of a PR a few months ago. I have a POC for adding implicit join support (which probably won't work for autocomplete without doing some very tricky things in our driver), but I'm not sure how it would be best to incorporate that. Probably the parser work should be part of this repo, but the build process would be just a little bit tricky. (Most likely involving cloning the Hue repo and overlaying our parser with it, then building with automation from the Hue repo and committing a build artifact... feels a little bit fragile but I think it's better than forking Hue or dealing with two levels of dependencies for what should be basic changes.)
vscode-sqltools uses the generic autocomplete parser from Hue - in plugins/intellisense/language-server.ts:
import sqlAutocompleteParser from 'gethue/parsers/genericAutocompleteParser.js';
This falls over on certain valid aspects of IRIS SQL syntax - e.g,. implicit joins (arrow syntax) and operators/functions that are ObjectScript-specific. (This is the actual root cause for what I observed in #32 .) Predictably, in a file using such syntax, autocomplete fails after the unrecognized string.
Fixing this would require an upstream change to allow a driver to provide its own autocomplete parser, then actually implementing such a parser (see: https://docs.gethue.com/developer/development/#sql-parsers). Theoretically existing concepts from the generic autocomplete parser would transfer (although it seems that reliance on the autocomplete parser in vscode-tools might run too deep to be generic; e.g., there's a reference to
id.cte
and we don't support CTEs in IRIS SQL at this point). From some poking around in the Hue docs I think we'd probably run into issues with arrow syntax specifically - the "table" context is dependent on metadata on the server (what's the type of the column?), not just the SQL syntax.The text was updated successfully, but these errors were encountered: