Intellisense interaction
I noticed a question on the C# faq by David who asks:
---
Is it possible when you type {, (, [, etc. to have the IDE automatically insert the corresponding }, ), ] etc.? Does this exist in VS.NET 2003? Am I just blind?
Would it be possible to have intellisense insert the beginning of the text when list values are the same?
Example:
If you type
System.AppD
and intellisense displays
System.AppDomain
System.AppDomainSetup
System.AppDomainUnloadedException
could the IDE automatically expand it to
System.AddDomain
or possibly if you just hit tab to select AppDomain leave the intellisense selection up if there are others that match?
---
David: there is a new technology called 'snippets' in the editor which allow you to have macro-like expansions that get invoked when you hit tab inside the 2005 IDE. So you could hit 'if' and you would get 'if () { }' with your cursor in between the parenthesis. We supply a default set, but you are free to create your own. Would this help?
Also, Kevin worked on something called 'Shell style completion' which would have this behavior when dealing with completion lists, however, it's not in the community preview we just released. Given the choice of us providing certain completion-styles, versus us opening an API which you could plug into to define your own style, which would you prefer?
Comments
- Anonymous
May 28, 2004
> Given the choice of us providing certain completion-styles, versus us opening an API which you could plug into to define your own style, which would you prefer?
Default completion-styles first and API later (even much later if need be).
I have too much code to write and too many API's to learn as it is.
Please don't make me write code just to write code.
-Don - Anonymous
May 28, 2004
Don: Thanks for the input. The problem we face is that we generally don't have time to do both. We can either provide alternative methods, but then we don't solve all needs. Or, we can provide an API and then let 3rd parties to do it themselves (or we can then do it in our spare time and add it to GotDotNet, or SourceForge). - Anonymous
May 28, 2004
The comment has been removed - Anonymous
May 28, 2004
The comment has been removed - Anonymous
May 28, 2004
I think the snippets would definately help for the first question.
As far as the second goes, I will more than likely always say expand the API. I don't have a problem mucking around with the APIs, especially if it is to build some functionality that not a lot of people are requesting. I would rather you work on something that could benefit everyone vs. something that would benefit a few. - Anonymous
May 28, 2004
David/Brian/Don. Thanks for your feedback. It's invaluable in deciding what choices we'll be making in future versions of the IDE.
I'd like more than 3 data points. But it is useful to know that it's not a clear cut issue on what we should be providing. - Anonymous
May 28, 2004
Brian: I also wanted to mention that we've slightly changed the intellisense model in VS 2005. We now bring up intellisense after you type the first letter in an identifier. This seems similar to the Tomato model. Tell us if you like it! - Anonymous
May 28, 2004
This is probably OT , but in C# at the end of some rather fun methods, I'll have a bunch of closing }}}}}}}}}} for if's, foreach's, try's, et al...
It would be cool if the IDE
- Made a region (without putting the text #region/#endregion) out of the levels like it does at the namespace/class/method level
- or placed a superscript symbol at each matching {}
Of course make it optional - Anonymous
May 29, 2004
Vince: Could you explain a little more? In VS 2k5 we've at least added brace matching, will that do what you want? - Anonymous
May 29, 2004
I'm not so much concerned about the specifics of thepresentation but as long as there is some visual way to easily identify a brace's partner, especially in long code sections that would work great.
Sometimes when I'm tryping a code section I'll type the closing brace right away , and then as time goes on, and I'm deleting and adding lines (plus all those blank lines which seem to build up at the bottom), the braces get a little out of synch and it takes a bit of work to figure out where in the nesting I am. I have no idea how common this is for other people.
When you say "Brace Matching" what do you mean? - Anonymous
May 31, 2004
The comment has been removed - Anonymous
May 31, 2004
Vince: When your cursor is now up against a one of a pair of elements ( { < > } ) we will match the corresponding element. - Anonymous
June 01, 2004
That's in the new version right? Not 2003? - Anonymous
June 01, 2004
Vince: Correct. - Anonymous
June 02, 2004
I think VS could borrow from Word here. Shift-Enter anyone? I don't see it being used in the code editor in a useful way. Here's what I propose:
Suppose you have typed: (@ marks position of the cursor)
if (true@
now if you press shift-enter, the IDE would complete to:
if (true)
{
@
Now you can write a command
Dispose();@
now if you press shift-enter, the IDE would complete to:
if (true)
{
Dispose();
}
@
Other variation of this idea (implement it quick before i patent shift-enter LOL)..
You write
if
and
(
The IDE gives ) automatically:
if (@)
Now you write true
if (true@)
now if you press shift-enter, the IDE would skip over the ) and add space:
if (true) @
but pressing shift-enter here would indicate you want to end writing the if () ()'s :
if (true)
{
@
}
Write the command(s):
if (true)
{
Dispose();@
}
now if you press shift-enter, the IDE would just skip out of the { }:
if (true)
{
Dispose();
}
@
So what good is this ? Well it would be nice for us who are used to out native language keyboards, where getting ( ) or { } requires more than 1 key press, it the shift-enter auto-skip/completion there would be a ton of saving of the { } ) key combos and some saving of using cursor keys to get over the }'s..
So you could end up saving a whole two minutes in a year with this !! - Anonymous
July 22, 2004
You can try FlashIME (http://www.d2ksoft.com) much better than intellinsense, Visual Assist
for example:
you can type "#"+return to input "#include"
or you can type "fncmt" +return to input
"//-------------------
//Description:...
//Function Name: ...
" - Anonymous
July 22, 2004
redguardtoo: In what ways do yo think FlashIME is better.
We support use configurable expansions as well, and I'm not sure why auto completing to #include would be desirable behavior in C# which doesn't have an include statment. - Anonymous
July 22, 2004
"#include" is just an example, it means you can change the definition of a word character.
The keypont is:
You hardcoded the definition of a word. but in FlashIME, I can configure everything.
For example,
"boost" is a word. "boost.filesystem.iterator" is not a word.
But why not? FlashIME gives you a choice to define what is a word.
If you like, you can define everything a word - Anonymous
July 22, 2004
RedGuardToo: I'm not sure what you mean by "we hard coded in what a word was".
What does it mean to "define everything a word"?
Could you show an example of how this is useful, and how 'expansions' don't give you this functionality? THanks! - Anonymous
July 22, 2004
Because my english is poor, I always select the simple words to express my idea. thus maybe looks i am rude? if so, I apologize.
What I mean is that basic idea behind some auto-complete software's core design is wrong. Among those auto-complete softwares, maybe intellicomplete is the best. but it is still un-mature.
Actually, it is Microsoft whom developed Iput Method Editor (IME) technology. but seems Microsoft have not recognized that same technoglogy can be applied on their IDEs.
Now, comes to the meaning of "define everything as a word".
a word is something you want to input by striking the keyboard.
for example, below is some code fragment from my project:
"
class trackIterator : public ExeCtx::trackIterator
{
TrackRegistry::const_iterator _iter;
TrackRegistry::const_iterator _end;
public:
trackIterator(const TrackRegistry::const_iterator begin,
const TrackRegistry::const_iterator end)
: ExeCtx::trackIterator(for_derived()), _iter(begin), _end(end) {}
void next() { if (!atEnd()) ++_iter; }
bool atEnd() const { return _iter == _end; }
const NodeJmp& operator*() const { return (_iter); }
};
"
TrackRegistry is a word, serials of space chars, or "::" is not a word?
If I strike "T" key, you guess I want to input "TrackRegistry"? so Intellisense will give me hint "TrackRegistry" and later input it into the editor, then I type "::", Intellisense list all the method of the namespace TrackRegistry. Then I will strike Return to confirm the guess (for example, const_iterator _iter"). This is called smart guess.
Actually, I just want to input "TrackRegistry::const_iterator _iter". I am a lazy programmer, I just want to type "T" and IntelliSense should give me the hint "TrackRegistry::const_iterator _iter"? This is named wild guess.
if I can have a choice to configure intellisense between smart guess and wild guess?
for the wild guess, a more extreme example is if I type "d" then return, Intellisense should guess I will input the whole webster dictionary into the editor.
more examples:
If I type "/", FlashIME will guess I will input "/usr/local/bin/ddd", if I type "C:", FlashIME will guess I will input "c:Program FilesFlashIMEdevime.db"
If I type "<", FlashIME guess I wll input "<boost/python/filesystem.hpp>"
How FlashIME guess should be configurable.
As to configurable, if I choose other languages like python, perl, ruby, lisp and I still want to use VS2003, as an editor, Intellisense will work? As a customer, I buy the VS2003 or 2005, then someday I will use it to develop application in a totally new language on a new platform (linux , for example? +samba, of course) Could I have a FREE and easy way (Click button once or twice) to make IntelliSense know the keywords of the Linux and the new language?