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