regen100 / cmake-language-server

CMake LSP Implementation
MIT License
331 stars 25 forks source link

format #56

Open kdurant opened 2 years ago

kdurant commented 2 years ago

I install cmake-format and config cmake-language-server

  "languageserver": {
    "cmake": {
      "command": "cmake-language-server",
      "filetypes": ["cmake"],
      "rootPatterns": [
        "build/"
      ],
      "initializationOptions": {
        "buildDirectory": "build"
      }
    }
  }

It can't format CMakeLists.txt when I saved it.

jasongshap commented 2 years ago

Saw this too and when I ran formatting_sync directly I got the following: vim.lsp.buf.formatting_sync: timeout

Try running with a longer timeout: :lua vim.lsp.buf.formatting_sync(nil, 5000)