3 ms·
Out of interest, and I've done no research into this yet, how is your SQL editor/code complete working? Does it use SQLite's engine itself to get the AST or som
by nbevans 12y ago
Out of interest, and I've done no research into this yet, how is your SQL editor/code complete working? Does it use SQLite's engine itself to get the AST or some such?
- anakic 12y agoThe SQL editor is a really cool open source library called AvalonEdit. It has it's own lexer (for syntax highlighting) and you just describe the terminals via regex and tell it what formatting to apply to each terminal. As for code completion, it's quite rudimentary currently, it doesn't know anything about SQL, it just offers all schemas/tables/columns and filters them as you type. The SQLite dialect of SQL is really well documented and I'm currently working on implementing an LL(*) parser for it's grammar, so I can improve autocomplete and the editor with support for: - keywords - aliases (while handing alias scopes) - sub-query columns - only applicable columns in the select list, only tables in the from list, etc... - error squigglies Also, the parser would make it easy to implement auto-formatting. It's quite a fun feature to implement, but alas it's currently low priority so I don't expect to have it working in the next month or two. Antonio