foreach issue

Might be just my misunderstanding..

writing foreach and then bracket (closing one of course appears automatically) I am unable to use code complete features to access type list.. If I do not type bracket, type list works but obviously (to honour syntax) the expression behind foreach keywords has to be wrapped in brackets afterwards…

VK

5 comments
Comment actions Permalink

Vaclav,

If you mean CtrlAltSpace completion, this is the designed behaviour -
it works only when a prefix is typed. In other case, it's a bug, but I
couldn't reproduce it on my side. Could you give more details about the
context (i.e. source file excrept)

--
Oleg Stepanov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Vaclav Kabat" <no_mail@jetbrains.com> wrote in message
news:24000403.1089972322528.JavaMail.itn@is.intellij.net...

Might be just my misunderstanding..

>

writing foreach and then bracket (closing one of course appears

automatically) I am unable to use code complete features to access type
list.. If I do not type bracket, type list works but obviously (to honour
syntax) the expression behind foreach keywords has to be wrapped in brackets
afterwards?
>

VK

>


0
Comment actions Permalink

sorry for the delay... by prefix, what do u mean? Can I get an example how to type code snipet like this...

foreach (ItemDetails det in res)
{
}

ItemDetails is obviously "imported"...

0
Comment actions Permalink

You can do this in several ways. Note that in any case you'll need to type
the prefix of the type (e.g., 'I') to import the type ('ItemDetails').
However, if you use live templates, the type may be imported for you
automatically.

Using live templates:

1) If nothing is typed
select a live template from a list: Ctrl+J and 'f ' Enter
type in 'res' if it is not selected
Tab
if 'ItemDetails' is not guessed by the live template itself import it:
'I' CtrlAltSpace and select 'ItemDetails'
Tab
type in 'det'
Tab

2) If 'foreach' is typed:
select a live template: Ctrl+J Enter
the rest is the same as in 1)

Typing foreach 'by hand' (importing necessary type)

3) If 'foreach' is typed:
'(' (the closing parenthesis is added, the cursor is put inside
parenthesis automatically )
'I' CtrlAltSpace and select 'ItemDetails'
then type the rest of the line (using CtrlSpace or CtrlShift+Space if
desired)
type the opening '{' (the closing one is added automatically)



--
Andrey Simanovsky
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"



"Vaclav Kabat" <no_mail@jetbrains.com> wrote in message
news:19070007.1090310283317.JavaMail.itn@is.intellij.net...

sorry for the delay... by prefix, what do u mean? Can I get an example how

to type code snipet like this...
>

foreach (ItemDetails det in res)
{
}

>

ItemDetails is obviously "imported"...



0
Comment actions Permalink

I tried that... code completion did not work if I type it fully, type is recognized....

0
Comment actions Permalink

Do you see the completion popup with ItemDetails item in the list if you
press CtrlAltSpace being after 'I' in the following line:
foreach (I)

and if you type
foreach (ItemDetails det in res)
{
}
is ItemDetails highlighted red?

--
Andrey Simanovsky
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"



"Vaclav Kabat" <no_mail@jetbrains.com> wrote in message
news:17256910.1090333659425.JavaMail.itn@is.intellij.net...

I tried that... code completion did not work if I type it fully, type is

recognized....


0

Please sign in to leave a comment.