lahodaj commented on issue #7078:
URL: https://github.com/apache/netbeans/issues/7078#issuecomment-1952692634

   When matching, the variable will be put into both `variables` and 
`variables2Name`, to keep other stuff (like conditions) working. I suspect we 
need to keep this, and this is more a problem on the "rewrite" side than the 
matching side.
   
   A part of what you see is indeed just a UI problem. But not all. This:
   ```
   "name test":
   $mods$ $type $name = new $T();
   =>
   $name
   ;;
   ```
   does not make much sense, as `$name` is an expression, but we need a 
statement, and this will crash.
   
   Correcting this to:
   ```
   "name test":
   $mods$ $type $name = new $T();
   =>
   $name;
   ;;
   ```
   
   leads to an infinite loop, which is pretty bad (but, frankly, does not make 
much sense either).
   
   But in if one does e.g.:
   ```
   "name test":
   $mods$ $type $name = new $T();
   =>
   Object o = $name;
   ;;
   ```
   then it works (and might make sense), its just the text that's wrong.
   
   I need to look that's going on in the full case with `$mods$` - that should 
work, but maybe there's some interaction between multi-statements and modifiers.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to