You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2023/01/17 18:24:48 UTC

[GitHub] [netbeans] Chris2011 opened a new issue, #5305: Don't format when there are syntax errors

Chris2011 opened a new issue, #5305:
URL: https://github.com/apache/netbeans/issues/5305

   ### Description
   
   Sometimes it happens, when I have a long file, removing lnes and some other stuff and call format the file, it looks weird. This sometimes happens, when you removed an open bracket but not the closed one, or removing a comma but it is needed, etc. Smth like that. That mostly happens in JS, TS, PHP and JSON files.
   
   So here I would suggest to not format the file if we have any syntax issues. VS Code doesn't format if we have problems, WebStorm does and make it as it looks correct.
   
   Take my example snippets and try it by your own.
   
   ````json
   {
     "name": "smth",
     "version": "0.0.0"
     "scripts": {
       "dev": "vite",
       "build": "vite build"
       "serve": "vite preview"
     }
   }
   ````
   
   ````JavaScript
   function tst() {
     le test = 2;
   
     function () {
       () => {
     }
   }
   ````
   
   ```php
   <?php
   class test {
     private tets() {
       echo "";
     }
   }
   ```
   
   ### Use case/motivation
   
   I don't want this whole formatting, when I'm not finish with developing, but most of the time I hit format to see whether everything is fine or not. And when I know, that there is smth to format it should format but with errors it should not format, so this will be an indicator for me to fix them first. Maybe this should be an option like "Format on syntax errors" but I don't see it, that we need this. So whether we should fix the formatting to do it correct or we should prevent formatting on errors.
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   No
   
   ### Code of Conduct
   
   Yes


-- 
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.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


[GitHub] [netbeans] Chris2011 commented on issue #5305: Don't format when there are syntax errors

Posted by GitBox <gi...@apache.org>.
Chris2011 commented on issue #5305:
URL: https://github.com/apache/netbeans/issues/5305#issuecomment-1385855705

   Just copy the examples into each file type and hit format


-- 
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