Reply To: SQL Completion – Thanks Andy

Product Compare Forums Multi-Edit User Created Macros SQL Completion – Thanks Andy Reply To: SQL Completion – Thanks Andy


I had a similar issue with the Schema pane – it takes a long damn time to generate the tree view, because it goes through a 1 MB file, adds all the tablenames under the table node, then puts all the views under the view node, sorts these into alphabetical order, and then adds all the fields to each table, adds all the relationships to each table, adds all the fields to the views, and sorts each of these, on a table by table basis.

I ended up stuffing the schema file timestamp into a data attribute of the root tree node, so I could see if I needed to refresh or not.

A more clever idea would be to use Pad_Str to assemble a rather long, carefully space padded sort key, so I could sort the entire file once after building it, but I didn’t have enough time to figure out how long each section of the key would have to be at the time I was writing it. Maybe for v1.1…

What would be a really handy thing for Completion would be to put it somewhere like Language.s, and then add a C_Completion, SQL_Completion, VBas_Completion, etc, to each language file. That way, each language could keep it’s own hidden list buffer, and deal with it in whatever way makes sense.

For ClearBasic, I was using a CTags tag file as the source for my completion data. I actually updated CTags with enough smarts to grab all the variable definitions, form controls, etc, from all the files in the project and create scoped tags for them. ClearBasic makes this easy, because I had a fairly fixed set of objects. Something like C++/C# would be a lot harder, because it’s trivially easy to invent an entirely new class, or worse yet, an inherited class that has the properties and methods that the tagger finds, plus all of them from the parent class…

I’m not really going anywhere with this; I’m just throwing out some of my thought process as I’ve experimented with different ideas for Completion/Intellisense type of things in MEW…