automatic save format issue
h-polaris opened this issue · comments
JH commented
lsp-typescript set automatic save to add semicolons, but it does not take effect on the last or only one line of the file.
Rafał Chłodnicki commented
Be more specific. I'm not sure what are you exactly doing on save.
I'm not sure if LSP-typescript has anything to do with fixing semicolons.
JH commented
here are my lsp-typescript settings
{
"settings": {
"javascript.format.semicolons": "insert",
"typescript.format.semicolons": "insert"
}
}
I want to automatically format the code as I save to add a semicolon at the end of each line.
example:
// right
var a = 1;
var b = 2;
but the results are not what I expected.
The result is this:
// wrong
var a = 1;
var b = 2 // The last line does not append a semicolon
or:
var a = 1 // No semicolons are appended when there is only one line
What changes do I need to set?
Rafał Chłodnicki commented
And do you expect that to be fixed on running "LSP: Format file" or did you set up some lsp_code_actions_on_save
for this?
JH commented
i expect that to be fixed on running "LSP: Format file".
Rafał Chłodnicki commented