Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coc-flow in vim #4

Open
ArenGr opened this issue Mar 24, 2020 · 3 comments
Open

coc-flow in vim #4

ArenGr opened this issue Mar 24, 2020 · 3 comments

Comments

@ArenGr
Copy link

ArenGr commented Mar 24, 2020

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

@amiralies
Copy link
Owner

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

@Seybo
Copy link

Seybo commented Jun 6, 2020

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.

@EdmundsEcho
Copy link

EdmundsEcho commented Jul 14, 2020

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants