Skip to content

Instantly share code, notes, and snippets.

@meirish meirish/_Instructions.md Secret
Last active May 24, 2019

Embed
What would you like to do?
Unstable language server for neovim

Install https://github.com/neoclide/coc.nvim and be sure to check out the test to check if neovim works with floating windows detailed here: https://github.com/neoclide/coc.nvim/wiki/F.A.Q#how-to-make-preview-window-shown-aside-with-pum

Checkout component-context-info branch from https://github.com/lifeart/ember-language-server and compile it.

Run npm install -g vscode-languageserver

Open nvim and do :CocConfig and copy and paste the file below, changing the module path to where you checked out ember-langauage-server.

// edit this file by doing :CocConfig after coc.nvim is installed
{
"languageserver": {
"ember": {
// local, absolute path to start-server.js from unstable-language-server
"module": "/Users/meirish/code/ember-language-server/lib/start-server.js",
"args": ["--node-ipc"],
"filetypes": [
"hbs",
"html.handlebars",
"handlebars",
"typescript",
"javascript"
],
"rootPatterns": ["ember-cli-build.js"],
"requireRootPattern": true,
"trace.server": "verbose",
// Used for debugging
//"execArgv": ["--nolazy", "--inspect-brk=8045"],
"initializationOptions": {},
"settings": {}
}
}
}
@meirish

This comment has been minimized.

Copy link
Owner Author

commented May 23, 2019

Currently this only works if a file is untyped when I load it, and then I do :set filetype=handlebars. Any attempt at autoloading the filetype ends up in the server not starting when opening a file.

@lifeart

This comment has been minimized.

Copy link

commented May 23, 2019

You need component-context-info branch from lifeart/ember-language-server

@NullVoxPopuli

This comment has been minimized.

Copy link

commented May 23, 2019

I've made some progress:

npm install -g vscode-languageserver

my filetypes:

      "filetypes": [
        "hbs",
        "html.handlebars",
        "handlebars",
        "typescript",
        "javascript"
      ],

right now I'm fighting Ale, so I need to figure out how to disable it for hbs, or maybe entirely for ember projects.
Additionally, {{this. doesn't give me completions other than the default local scope stuff

@meirish

This comment has been minimized.

Copy link
Owner Author

commented May 23, 2019

👍 - awesome thanks - updated the gist based on your feedback

@NullVoxPopuli

This comment has been minimized.

Copy link

commented May 24, 2019

I committed some of my changes NullVoxPopuli/dotfiles@c1ef84e
still needs some work / config. but it's getting there.
I'm hoping we can make a coc-ember package out of all this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.