Let's see... all these years of people asking for syntax highlighting
Fair questions. When exploring answers, it's important to check the assumptions that go into them. For example, if you search the forum for "syntax highlighting" there are eight people who have posted a comment since 9 came out of beta that syntax highlighting for SQL would be good. Half of those posts were a one-time, off the cuff mention. Experience shows that when people post "yes, I'd like that too..." in the forum virtually none of them take a couple of minutes to send in a suggestion. So it would not be surprising if only two people since 9 came out of beta sent in a suggestion for SQL syntax highlighting. It's also important not to underestimate the convenience of what is already there. For example, like this: all the code having to be written in a plain text editor in the program.
But Query Builder is not a plain text editor. On the contrary it is a rich tool for building queries that provides important workflow efficiency that VSCode does not provide. For example, Query Builder provides drag and drop utilization of tables and fields in the project, as well as very convenient point-and-click access to well-organized statements, operators, tuple operators, aggregate functions, functions, types, three different varieties of vector types, collate options, constants, pragmas, preprocessor directives and thread configuration. The tables pane in Query Builder shows tables with their fields and schemas. Don't get that in vscode. The tables pane also has a filter box that allows fast reduction of what might be dozens of tables and thousands of fields to just those of interest. The functions pane likewise has a filter box for very convenient reducing of long lists to items of interest. There are also higher level commands like inserting entire CREATE TABLE definitions of a table and inserting a field list. Sure, you can add a snippet to vscode to create a generic table, but that snippet will not examine a specific, complex table and with a click write the SQL to CREATE such a table. As for functions, yes, of course you can add snippets to vscode to add function shortcuts, like this... "GeomArea":{ "scope": "sql9", "prefix": "GeomArea", "body": "GeomArea(${1:Geom},0)" , "description": "compute Euclidean area of a geom" }, ...but picking the GeomArea function out from a very long list of offered snippets in vscode is not as convenient as picking in the hierarchical/filtered list in the Query Builder. Anybody who has lots of user snippets in vscode knows what I mean. In vscode, for longer function names you must know the name of the function to reduce to a manageable size the snippet list that is presented as you start keyboarding the name of the function, and you often need to keyboard a lot to get to where you can then pick off the snippet list the one you want. With Query Builder you can just browse the hierarchy very rapidly to find functions that you want where you don't remember the exact name. Also, once you've picked a snippet in vscode you may have the function framework, but populating arguments from tables and fields is not a simple matter of pointing and clicking in the table schema like in the Query Builder. That's a real time saver. I'm not in any way arguing against vscode. I like vscode and I use it almost every day, but I use it for C++ or C#, not for SQL. As much as I like what the extension does (it really is a super thing), I'll continue to use the Query Builder, probably going back and forth between the Query Builder and vscode. My primary edit environment will likely continue to be Query Builder because I haven't used vscode for much more than convenient auto-reckoning of nested parentheses. As a speed thing, for me it is much more important to get the point and click addition of fields and functions than it is to see colors to tell me what is SELECT, what is a table, what is a field, and what is a function or a function argument. Sensibly formatting SQL for legibility is something that got wired into my nervous system many, many years ago, so I do that automatically without even thinking about it. So yes, vscode with the extension is, hands down, better than Notepad, but it's not as convenient/efficient for the queries I write as the Query Builder. That's OK, as it takes but a moment to do a Ctrl-A, Ctrl-C to copy what's in the Query Builder and then a Ctrl-A, Ctrl-V to paste into vscode, and, voila! pretty colors and automatic reckoning of all the parentheses. I think what advanced SQL authors really would like is something that combines what Manifold provides in Query Builder together with what Microsoft provides in VSCode. OK, so why didn't Manifold invest into providing syntax highlighting in Query Builder? The answer to that is simple: low demand for that compared to demand for other things, as my comment at the top of this post points out. That shouldn't come as a surprise because whenever there already is an existing solution to some desire the demand for duplicating that wheel within Manifold is, understandably, less than the demand for adding something to Manifold which cannot be obtained off the shelf within an existing solution. The early experience of Manifold was that people who write extensive SQL tend to already have some SQL editor they know and love. So it's understandable that demand from such users for a competing SQL editor within Manifold would be low. Most people who write SQL in Manifold use SQL in relatively simple ways. Most SQL is simple SQL, because you can get a lot done with simple SQL. Such people tend to value the point and click conveniences of Query Builder, and they don't write such extensive SQL where a full featured programming editor created for large projects, like Visual Studio Code, might help. So it's understandable that people writing simple SQL don't lobby for a vscode clone within Manifold. So that leaves the people in the middle, who (like me) write enough SQL code to want conveniences, but not so much that they already are devotees of some existing SQL coding environment. For such people, Manifold had always intended to get around to adding syntax highlighting, even if demand for it was low in the broader community. If I recall correctly, about a year ago there was talk within Manifold to leverage Visual Studio Code, with an extension like Riivo provided. And then Riivo published his extension, which works great and provides syntax highlighting. It also provided a way to see how much interest there was for anything more. Where we are today is that there is a really super extension contributed by Riivo that provides syntax highlighting. It's very well done and works great. For sure, Riivo's extension will be one of my regular tools for when I write more ambitious SQL. As for the future, greater integration with vscode certainly is a possibility, but does it make sense to invest a lot of effort into that when it takes but half a second to go back and forth between code and Query Builder with a Ctrl-A, Ctrl-C/V? I think there are more useful things of wider interest to the community, for example, exposing more programming hooks to utilize and extend the capabilities already within Manifold. The above is just my opinion. As a fanatic vscode user I like the extension and would enjoy seeing greater integration of vscode with 9. But I also respect that other people might prefer some other routes, like greater integration of notepad++ or some other editor that can do syntax highlighting, or might prefer that more important priorities get the resources.
|