Re: [I] Declarative hint variable seems to capture too much [netbeans]

2024-03-19 Thread via GitHub


mbien closed issue #7078: Declarative hint variable seems to capture too much
URL: https://github.com/apache/netbeans/issues/7078


-- 
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: notifications-unsubscr...@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

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



Re: [I] Declarative hint variable seems to capture too much [netbeans]

2024-02-19 Thread via GitHub


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

   right I think it is two things we see here:
1) the UI code which builds the "rewrite to" string was wrong (it had 
multiple issues). I didn't know that at first and assumed that something was 
wrong in jackopt itself, so I tried to fix a problem which wasn't there and 
looked at the wrong code
2) there is still likely something wrong with `$mods$` since some rules 
don't seem to match when they probably should
   
   regarding 1): taking your example:
   ```java
   "name test":
   $mods$ $type $name = new $T();
   =>
   Object o = $name;
   ;;
   ```
   
   NB 21:
   
![image](https://github.com/apache/netbeans/assets/114367/63f0d195-05a1-4075-a5bb-b2921a97d93a)
   
   https://github.com/apache/netbeans/pull/7075 applied:
   
![image](https://github.com/apache/netbeans/assets/114367/f34e748f-aec8-4f8d-997a-1daa098f9e3b)
   
   


-- 
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: notifications-unsubscr...@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

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



Re: [I] Declarative hint variable seems to capture too much [netbeans]

2024-02-19 Thread via GitHub


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: notifications-unsubscr...@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

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



Re: [I] Declarative hint variable seems to capture too much [netbeans]

2024-02-18 Thread via GitHub


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

   what if the `TreePath` is correct but the `toString()` of its leaf is not?
   
   the tree of `$name` is a `VariableTree`, getName() would return the 
identifier. We could fix this via https://github.com/apache/netbeans/pull/7075 
too. Going to add a commit there.


-- 
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: notifications-unsubscr...@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

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