You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "subhash-arabhi (via GitHub)" <gi...@apache.org> on 2024/09/19 08:12:16 UTC

[PR] Closed editors after successful save to avoid duplication [netbeans]

subhash-arabhi opened a new pull request, #7769:
URL: https://github.com/apache/netbeans/pull/7769

   These changes fix [Issue #279](https://github.com/oracle/javavscode/issues/279)
   The changes made in [PR #7749](https://github.com/apache/netbeans/pull/7749) do not fix this issue, although the issues seem similar
   
   ### Brief
   1. The QuickFix action to enable the preview uses `node.cookie` (`SaveCookie`) to save the changes to pom.xml.
   2. The `EditorCookie` is not closed after a successful save.
   3. In subsequent run operations, the `LifecycleManager` (line 167) in `MavenCommandLineExecutor.java` saves the previous changes again.
   


-- 
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-unsubscribe@netbeans.apache.org

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


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

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


Re: [PR] Closed editors after successful save to avoid duplication [netbeans]

Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on PR #7769:
URL: https://github.com/apache/netbeans/pull/7769#issuecomment-2360707025

   @sdedic sounds fun!  Perhaps something like an on-save task to save the modified regions somewhere like a document property.  Depends whether NB and LSP idea of range matches?!
   
   Still, if it can't be solved generically (which would be ideal) I guess branded close would be OK.  Headless was pointed out to be a problem in another PR recently IIRC.


-- 
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-unsubscribe@netbeans.apache.org

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


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

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


Re: [PR] Closed editors after successful save to avoid duplication [netbeans]

Posted by "sdedic (via GitHub)" <gi...@apache.org>.
sdedic commented on PR #7769:
URL: https://github.com/apache/netbeans/pull/7769#issuecomment-2360512766

   This does not (now) have a workable solution IMHO; the `close` could be done, iff the process is running headless, or can be conditioned by 'branding API' which would default to "do not close" and NBLS distribution would brand it to close.
   
   But the problem is NOT just maven-specific, it's general, for all opened editor types: if the SaveCookie.save() is invoked, it modifies the on-disk file, LSP client might (and vscode does) recognize it as external modification and will inform LSP servers with `didChange` -- which actually causes the Document in NB become modified with duplicate contents.
   
   Most proper solution is to relay the actual write to file to the LSP client (quite hard), or "somehow" detect that the `didChange` actually originates from the save (also quite hard). But we should work on that somehow.


-- 
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-unsubscribe@netbeans.apache.org

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


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

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


Re: [PR] Closed editors after successful save to avoid duplication [netbeans]

Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on PR #7769:
URL: https://github.com/apache/netbeans/pull/7769#issuecomment-2360487178

   Agree with @mbien This also appears to be a VSCode / LSP only issue?  This should not be fixed this way, and if the issue is not in the IDE, should not be fixed there but in the LSP integration.


-- 
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-unsubscribe@netbeans.apache.org

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


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

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