简体   繁体   中英

How to make VScode auto fix missing semicolons Apex?

Hey does anyone here know how to make VSCode auto fix missing semicolons instead of just show where it is missing?

I Started setting up Prettier and it will format apex code but not replace double quotes with single quotes nor insert missing semicolons.

Can someone point me in the right direction?

I tried:

Prettier, Uncrustify and none of them worked for me.

if (o.Owner.Username == "maxi.musellus@energy.com"){
System.debug("why am I not bracced by singel quotes yet?")
}

this should be formatted to:

if (o.Owner.Username == 'maxi.musellus@energy.com'){
    System.debug('why am I not bracced by singel quotes yet?');
}

Id be greatful for any hint :)

This isn't formatting, it's syntax.

No Apex formatter will be able to handle these two items because code that requires those replacements is not syntactically valid Apex and cannot be parsed in order to determine how to format it.

Statements must end with a semicolon. Double quotes are not valid string delimiters in Apex - only single quotes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM