Why doesn't the Replit code formatter work well?

If the code formatter is not working because of some kind of bug or error or invalid code.

Then, It should give hints/poin out the exact problem to the user, what is going wrong and what should be corrected to run the code formatter. Then, it will be easy for a user to find out the issue and solve it. It just rejects/deny from formatting the code. Now, It’s upto user to understand why is it denying from formatting.

It becomes too hard to work like this for a user.

I am tired to formatting code by myself again and again.

Please! Improve the code formatter.

2 Likes

It’s not invalid code! It’s basically that the code is processing the code to make it conform to code Conventions. This means it will not change the code’s function in anyway but will instead just make the code look nicer to read. However, you seem to be wanting/experiencing issues with ghostwriter. Thus, if you want something that actually fixes your code, buy ghostwriter with pro for 20 dollars a month or use chatgpt. This uses AI to fix your code. However, realize that if you already have it, remember that AI will make mistakes and hallucinate and there is nothing we can do

2 Likes

Code formatter is not suppose to do anything other than chance visual appearance of the code. Those tools that identify syntax errors and potential issues in code or bad practises are called linters.

2 Likes

If the code formatter fails to format your code, click on the language server protocol icon (lower-left corner of the pane) to reload it, and try refreshing the page.

As stated by others in the conversation, a formatter is only to change the appearance of your code, not to detect errors.

1 Like