PSI: little improvement

Hello All,
Just to let you know, we've modified PSI write interface a little:
as you know when you replaced one expression to another parenthesis were
added automatically when needed. However they were not removed when not
needed,
so the clients had to deal with this themselves. This is no longer the
case:)
Also the fix is fully backward compatible, i.e. if you remove parenthesis by
hand, your code still works.

Friendly,
Eugene.


5 comments
Comment actions Permalink

Cool, I hope this fixes SmartIntroduce's parentheses problem :)

Eugene Vigdorchik (JetBrains) wrote:

Hello All,
Just to let you know, we've modified PSI write interface a little:
as you know when you replaced one expression to another parenthesis were
added automatically when needed. However they were not removed when not
needed,
so the clients had to deal with this themselves. This is no longer the
case:)
Also the fix is fully backward compatible, i.e. if you remove parenthesis by
hand, your code still works.

Friendly,
Eugene.

0
Comment actions Permalink

Keith Lea wrote:

Cool, I hope this fixes SmartIntroduce's parentheses problem :)


Umm, what problem do you exactly mean?

Unfortunately, since the plugin doesn't do any PSI-write operations,
it won't be fixed by this change :)

Sascha

0
Comment actions Permalink

IG/IPP have been doing this by hand since the beginning, as the parentheses-insertion you describe wasn't documented...

--Dave Griffith

0
Comment actions Permalink

I constantly extract expressions which end up like this when I use
SmartIntroduce:

String s = ((String) obj);

I think it's because the original expression was ((String) obj).something();

Sascha Weinreuter wrote:

Keith Lea wrote:

>> Cool, I hope this fixes SmartIntroduce's parentheses problem :)


Umm, what problem do you exactly mean?

Unfortunately, since the plugin doesn't do any PSI-write operations,
it won't be fixed by this change :)

Sascha

0
Comment actions Permalink

Ugh,
sorry for false alarm. we cannot remove parentheses automatically:(
Eugene.

"Eugene Vigdorchik (JetBrains)" <ven@intellij.com> wrote in message
news:d74o8b$ubf$1@is.intellij.net...

Hello All,
Just to let you know, we've modified PSI write interface a little:
as you know when you replaced one expression to another parenthesis were
added automatically when needed. However they were not removed when not
needed,
so the clients had to deal with this themselves. This is no longer the
case:)
Also the fix is fully backward compatible, i.e. if you remove parenthesis

by

hand, your code still works.

>

Friendly,
Eugene.

>
>


0

Please sign in to leave a comment.