sublimelsp / LSP-typescript

TypeScript, JavaScript support for Sublime LSP plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

automatic save format issue

h-polaris opened this issue · comments

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.

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.

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?

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?

commented

i expect that to be fixed on running "LSP: Format file".