coc-ember


Ⅰ. 插件描述

ember-language-server integration with coc, an intellisense / language server engine for (neo)vim

Ⅱ. 基本信息

创建日期:  2019-07-16
使用用户:  2
Github星:  20
插件作者:  Preston Sego

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'nullvoxpopuli/coc-ember'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'nullvoxpopuli/coc-ember'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'nullvoxpopuli/coc-ember'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/nullvoxpopuli/coc-ember

Ⅳ. 文档说明

# ember language server extension

ember-language-server extension for coc.nvim

Install

Via Plug

Plug 'nullvoxpopuli/coc-ember', {'do': 'yarn install --frozen-lockfile'}

Or via the automatically kept up-to-date config var:

let g:coc_global_extensions = [
  \ 'coc-ember'
\ ]

Starting from Scratch

  1. For the fanciest experience, install the neovim nightly release
  2. Install vim-plug
  3. Setup your (neo|oni)vim's config:

    call plug#begin('~/.local/share/nvim/plugged')
    
      " Highlighting and language support
      Plug 'leafgarland/typescript-vim'
      Plug 'joukevandermaas/vim-ember-hbs'
    
      " CoC / Intellisense
      Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'}
    
    call plug#end()
    
    
    let g:coc_global_extensions = [
      \ 'coc-tsserver',
      \ 'coc-css',
      \ 'coc-json',
      \ 'coc-html',
      \ 'coc-vimlsp',
      \ 'coc-highlight',
      \ 'coc-ember'
    \ ]
  4. Restart your editor, run :PlugInstall
  5. Navigate to an ember project and open (neo|oni)vim.

Done :)

To test this out with neovim:

  1. clone this repo
  2. go to an ember project and run nvim . -u path/to/repo/docs/minimal-config.vim

There are two working neovim single-file configs in this repo

Additionally, @NullVoxPopuli's vim config can be found here

Features

from @lifeart's PR

  • mu, pods, classic layouts support for app models definitions lookup, including js and ts files.
  • mu, pods, classic layouts support for app transforms definitions lookup, including js and ts files.
  • addon components and helpers definitions lookup
  • AngleBracket components autocomplete (including addon-located components) for mu, pods, classic layouts.
  • go-to routes, component properties, actions for mu, pods, classic
  • go-to service declaration definition for classic components
  • go-to ember/addon import support
  • store.peekRecord, findRecord... model names autocomplete for classic
  • belongsTo, hasMany model names autocomplete for classic
  • transitionTo,.. routes autocomplete for classic
  • named: service(name) services autocomplete
  • template linting fix
  • in-repo addons lookup (for classic and mu apps)

Other Features:

  • Component and helper autocompletion for inline and sub expressions
  • Definition providers for (enable features like "Go To Definition" or "Peek Definition"):

    • Components (in Templates)
    • Helpers (in Templates)
    • Models
    • Transforms
  • Route autocompletion in link-to
  • Diagnostics for ember-template-lint (if it is included in a project)

Screenshots

Helper or Component
Helpers
Error

添加新评论