sublimelsp / LSP-svelte

Convenience plugin for Svelte Language Tools
MIT License
16 stars 0 forks source link

How to get format working? #49

Closed felixakiragreen closed 3 years ago

felixakiragreen commented 3 years ago

For some reason I can't get the format to work for my .svelte files.

I checked and format seems to be enabled in settings...

basaran commented 3 years ago

I had the same problem, make sure you have format on save enabled globally within LSP Settings.

Here's my config:

LSP Settings

// Settings in here override those in "LSP/LSP.sublime-settings"
{
    "show_code_actions": "bulb",
    "show_diagnostics_severity_level": 1,
    "diagnostics_delay_ms": 10000,
    "lsp_format_on_save": true,
    "lsp_code_actions_on_save":
    {
        "source.fixAll": true,
        "source.organizeImports": true,
        "lsp_format_on_save": true,
    },

    "show_references_in_quick_panel": true,
    "diagnostics_panel_include_severity_level": 0,
    "show_diagnostics_panel_on_save": false,
    "log_debug": true,
    "clients":
    {
    "LSP-vue":
    {
        "enabled": false,
    },
        "LSP-typescript":
        {
            "enabled": false,
    },
        "LSP-eslint":
        {
        "enabled": false,
    },
        "LSP-lua":
        {
        "enabled": false
    },
    },
}

Then you can keep the defaults for LSP-Svelte Settings.

ghost commented 3 years ago

Sorry for the late response. I just checked the latest version and the formatting functionality works. Can you provide more details about your configuration/settings?

P.S. Note, svelte-lsp requires a project folder to be opened.

basaran commented 3 years ago

no problems :) things are fine