coc-flow icon indicating copy to clipboard operation
coc-flow copied to clipboard

coc-flow in vim

Open ArenGr opened this issue 4 years ago • 3 comments

[coc.nvim]Server languageserver.flow failed to start: Command "flow" of language server.flow is not executable: Error: not found: flow

ArenGr avatar Mar 24 '20 11:03 ArenGr

Do you have flow-bin installed locally on your projecy as development dependency?

amiralies avatar Mar 28 '20 08:03 amiralies

i have the same issue. Maybe it's related to flow being installed in the project's client subfolder. Is it? How should i fix it if so? Here is my local coc config:

{
  "tsserver.enableJavascript": false,
  "languageserver": {
    "flow": {
      "command": "flow",
      "args": ["lsp"],
      "filetypes": ["javascript", "javascriptreact"],
      "initializationOptions": {},
      "requireRootPattern": true,
      "settings": {},
      "rootPatterns": [".flowconfig"]
    }
  }
}

i also tried to use these config params (that's where my flow binary is located)

  "flow.useNPMPackagedFlow": true,
  "flow.pathToFlow": "$workspaceFolder/client/node_modules/flow-bin/flow-linux64-v0.78.0/",

but fruitless, same error:

[coc.nvim] Server flow failed to start: Launching server "flow" using command $workspaceFolder/client/node_modules/flow-bin/flow-linux64-v0.78.0/ failed.

Seybo avatar Jun 06 '20 08:06 Seybo

@Seybo we seem to have similar issues. I was getting the "failed to start flow" errors.

I uninstalled coc-flow extension to instead just add the service using language-server. This is a simple matter of adding the "flow" entry in my "languageserver" prop entry (the language server comes "for-free" when you install coc.nvim).

I now have flow linting up and running while also using tsserver:

  "javascript.validate.enable": false,  // use tsserver, but not for validation
  "flow.enable": true,     // DELETE
  "flow.pathToFlow": "/Volumes/.../<project_root>/node_modules/.bin/flow",  // DELETE

// in my language-server prop include the following entry:

    "flow": {
      "command": "/Volumes/.../<project_root>/node_modules/.bin/flow",  // KEY
      "args": ["lsp"],
      "filetypes": ["javascript", "javascriptreact", "javascript.jsx"],
      "initializationOptions": {},
      "requireRootPattern": true,
      "rootPatterns": [".flowconfig"],
      "settings": {}
    },

This is a hack for sure, but as a temp fix it worked for me.

Confirmation of the operating service:

The CocInfo does not report a "flow" channel despite my seeing the [Flow ..] linting messages AND seeing languageserver.flow [running] in the CocList services report.

... what would make it less of a hack, is to know how to include a ref to my project folder.

I hope this helps.

- E

EdmundsEcho avatar Jul 14 '20 18:07 EdmundsEcho