lsp icon indicating copy to clipboard operation
lsp copied to clipboard

Ignore formatting errors for long loading language server

Open yoomaxxx opened this issue 1 year ago • 3 comments

How can I ignore this errors? Screenshot from 2024-03-14 12-51-46

My svelteserver config:

if executable('svelteserver')
    lsp#lsp#AddServer([{
        name: 'svelteserver',
        filetype: ['svelte'],
        path: 'svelteserver',
        args: ['--stdio'],
        syncInit: v:true
    }])
endif

My efm-langserver config:

if executable('efm-langserver')
    lsp#lsp#AddServer([{
        name: 'efm',
        filetype: [
            'javascript',
            'javascriptreact',
            'typescript',
            'typescriptreact',
            'fish',
            'gitcommit',
            'lua',
            'python',
            'vue',
            'sh',
            'svelte',
            'markdown',
            'rst',
            'yaml'
        ],
        path: 'efm-langserver',
        args: [],
        initializationOptions: {
            'documentFormatting': v:true
        },
        features: {
            'documentFormatting': v:true
        },
        syncInit: v:true
    }])
endif

LspAttached config:

def OnLspBufferAttached()
    augroup lsp_format
      autocmd! BufWritePre *.py,*.sh,*.svelte,*.toml,*.vue,*.rb,*.html,*.json,*.yaml,*.lua,*.css,*.js,*.jsx,*.ts,*.tsx,*.rs,*.go,*.dart,*.md,*.c,*.cpp :LspFormat
    augroup END
enddef

augroup lsp_attach
    au!
    au User LspAttached call s:OnLspBufferAttached()
augroup END

yoomaxxx avatar Mar 14 '24 11:03 yoomaxxx

When do you see this error message? Do you see this message after loading a new file or do you see this message every time after saving a file?

yegappan avatar Mar 15 '24 15:03 yegappan

When do you see this error message? Do you see this message after loading a new file or do you see this message every time after saving a file?

Every time after saving a file for about 30 seconds until prettier configured with efm formats my file

yoomaxxx avatar Mar 15 '24 16:03 yoomaxxx

Hi, I've been having a similar issue when running efm-langserver that was trying to run mypy on save when it wasn't on my path. But it happened only when I've was trying to save a file with no modifications.

saccarosium avatar Apr 03 '24 16:04 saccarosium