syntax-directed intellisense

SyntaxEditor Brainstorming Forum

Posted 16 years ago by Kelly Leahy - Software Architect, Milliman
Avatar
I'm not sure really how to put this, so I'll just say what comes to mind. We would really like to have a good way of building the contents of an intellisense drop down based on the context of the caret. I'm not sure what can be done here, or whether you've thought about this, or found a need for this in your Add-In development, but I'd love to hear if you have any particular ideas about how to make this easy to maintain and have decent performance.

If you don't get what I'm talking about, just ask me to elaborate.

Kelly Leahy Software Architect Milliman, USA

Comments (4)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
For our add-ons we use a combination of token scanning and AST examination to determine contexts. But I agree, I would like to make somewhat of a context building framework, maybe just helper classes that make determining context easier.

Sure please do elaborate on your thoughts with any ideas you have.


Actipro Software Support

Posted 16 years ago by Matt Whitfield
Avatar
I like the way the intellisense window in VS2005 remembers what position it was in when you type in characters - so if i type in object.method then the next time i type in object.m it goes straight to method, rather than say object.maaaaaa (or a sensibly named entry that would be the first entry that began with m).

I'm not sure how that could be achieved though? I thought maybe if you had 'intellisense sets'. So in my app i'm doing intellisense for SQL. So I might have one set called 'tables', one for 'views', one for 'keywords & built in functions'. Then it could remember the last selected entry based on the set.

I'm not sure how that would work if you wanted to show multiple sets at the same time, however. Or how it would work with dynamic sets (for example when the @ key is pressed i dynamically work out what variable declarations are present in the current context).

Just thinking out loud.
Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I agree, that would be a nice feature to add. It seems like you would need to key it on something like your "set" names. Has anyone looked into the detail on how VS seems to store data related to this and pick the items later?


Actipro Software Support

Posted 16 years ago by Matt Whitfield
Avatar
http://msdn.microsoft.com/en-us/library/0aaw2184(VS.71).aspx

That page gives a hint. It would appear that the most frequently used members of each class are remembered. I would imagine that happens at the project level.

So perhaps the idea would be to have a most frequently used table 'per set' using the above analogy. So, your data might be:

ItemName, ItemData, UsageCount

That way, when a set is displayed (which would be decided by the application) the initially selected option would be the item with the highest usage count. Then, when a letter was typed, it would then go to the next option with the highest usage count that matches the letter that was typed.

I guess if multiple sets were included, you would just pick the one with the highest usage count for that set.

So that seems pretty simple?

Not sure whether you'd want to address persistence of the most frequently used counters, though.