GithubHelp home page GithubHelp logo

Comments (4)

maamo888 avatar maamo888 commented on May 19, 2024

Similar issue.

autozimu/LanguageClient-neovim#15

from asyncomplete.vim.

maamo888 avatar maamo888 commented on May 19, 2024

Additional report.

Duplicate "$" completion for JavaScript file.

Screenshot

type

asyncomplete_js_issue_1_type

selection

Duplicate "$".

asyncomplete_js_issue_2_selection

Preparation

mkdir -p vuesample
cd vuesample
npm install vue
tsc --init

example.js

vim -N -u minimal.vimrc example.js

| is cursor.

import Vue from 'vue';

var data = { a: 1 };
var vm = new Vue({
  el: '#example',
  data: data
});

vm.$e|

Minimal vimrc (minimal.vimrc)

" plugin (use vim-plug) {{{
call plug#begin('~/.vim/plugged')

Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'prabirshrestha/asyncomplete-lsp.vim'

call plug#end()
" }}}

" log
let g:asyncomplete_log_file = expand('/tmp/asyncomplete.log')

"
" [LSP]
" TypeScirpt JavaScript JSX
"
" [install]
" npm i -g typescript-language-server
"
" [command]
" typescript-language-server --stdio
"

if executable('typescript-language-server')
  augroup LspTypeScriptJavaScriptAndJsx
    au!
    au User lsp_setup call lsp#register_server({
      \ 'name': 'typescript-language-server',
      \ 'cmd': { server_info->[&shell, &shellcmdflag, 'typescript-language-server --stdio']},
      \ 'root_uri':{server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'tsconfig.json'))},
      \ 'whitelist': ['typescript', 'javascript', 'javascript.jsx']
      \ })

    " omnifunc
    autocmd FileType typescript,javascript,javascript.jsx setlocal omnifunc=lsp#complete
    " map
    au FileType typescript,javascript,javascript.jsx nnoremap <buffer><silent> gd :<C-u>LspDefinition<CR>
    au FileType typescript,javascript,javascript.jsx nnoremap <buffer><silent> gD :<C-u>LspReferences<CR>
    au FileType typescript,javascript,javascript.jsx nnoremap <buffer><silent> gs :<C-u>LspDocumentSymbol<CR>
    au FileType typescript,javascript,javascript.jsx nnoremap <buffer><silent> gS :<C-u>LspWorkspaceSymbol<CR>
    au FileType typescript,javascript,javascript.jsx nnoremap <buffer><silent> gQ :<C-u>LspDocumentFormat<CR>
    au FileType typescript,javascript,javascript.jsx vnoremap <buffer><silent> gQ :LspDocumentRangeFormat<CR>
    au FileType typescript,javascript,javascript.jsx nnoremap <buffer><silent> K :<C-u>LspHover<CR>
    au FileType typescript,javascript,javascript.jsx nnoremap <buffer><silent> <F1> :<C-u>LspImplementation<CR>
    au FileType typescript,javascript,javascript.jsx nnoremap <buffer><silent> <F2> :<C-u>LspRename<CR>
  augroup end
endif

from asyncomplete.vim.

prabirshrestha avatar prabirshrestha commented on May 19, 2024

Can you give v2 branch a try. It is stil lat an early phase so not all the features have been ported yet.

from asyncomplete.vim.

prabirshrestha avatar prabirshrestha commented on May 19, 2024

v2 is now merged in master. Please update to latest and give it a try again.

from asyncomplete.vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.