[tsserver 2304] [E] Cannot find name 'Deno'.
Smithx10 opened this issue · comments
After installing Deno and configuring CoC neovim is showing errors that "[tsserver 2304] [E] Cannot find name 'Deno'."
Although completions are working.
arch@9d46dd2d-1178-ce83-cbc4-d396e4a24060 ~/g/denolearning Γ¥»Γ¥»Γ¥» deno --version
deno 1.7.5 (release, x86_64-unknown-linux-gnu)
v8 9.0.123
typescript 4.1.4
arch@9d46dd2d-1178-ce83-cbc4-d396e4a24060 ~/g/denolearning Γ¥»Γ¥»Γ¥» cat ~/.config/nvim/coc-settings.json Γ£ÿ 130
{
"deno.enable": true,
"deno.lint": true,
"deno.unstable": true,
"deno.config": "/home/arch/.tsconfig.json"
}
Tested with same version of deno as you, can't reproduce.
@Smithx10 Do you have coc-deno
installed? Or is it coc-denoland
?
In the case of coc-denoland, please report it to the coc-denoland issue.
As an additional note, for coc-denoland, you also need to set "tsserver.enable": false
.
Any Ideas ?
arch@9d46dd2d-1178-ce83-cbc4-d396e4a24060 ~/g/denolearning ❯❯❯ ls -1 ~/.config/coc/extensions/node_modules | sort
coc-actions
coc-cmake
coc-css
coc-cssmodules
coc-deno
coc-git
coc-go
coc-html
coc-java
coc-json
coc-marketplace
coc-metals
coc-powershell
coc-python
coc-rls
coc-rust-analyzer
coc-snippets
coc-solargraph
coc-svg
coc-tsserver
coc-ultisnips
coc-xml
coc-yaml
JavaScriptSnippets
I found this problem too, I fixed disabling of coc-tserver
in current workspace because it was making conflict with it.
coc-tserver
enabled and coc-deno
enabled.
Doesn't find Deno
Doesn't find top level await
coc-tserver
not enabled and coc-deno
enabled.
Finds Deno and suggest change "Denos" for "Deno"
Finds top level await
I'm using coc-tsserver 1.6.8 and coc-deno 3.2.0, can't reproduce this issue, don't need to disable coc-tsserver.
I'm using coc-tsserver 1.6.8 and coc-deno 3.2.0, can't reproduce this issue, don't need to disable coc-tsserver.
Could you show your javascript configuration? I'm guessing that deno-ts
is overriding tsserver
in your environment or my configuration is prioritizing tsserver
over deno-ts
because when I disabled tsserver
, deno-ts
runs fine as you just show here.
@Classy-Bear I am having the same problem - did you find a resolution?
@Classy-Bear I am having the same problem - did you find a resolution?
Not yet, meanwhile I have coc-tserver
disabled because I don't use it anymore. I will investigate why this happens and let you know if I find something useful.
@maheshsundaram what's the version coc-deno you used?
Still can't reproduce this error.
console.log(Deno.args[0]);
.vim/coc-settings.json
{
"deno.enable": true,
"deno.lint": true,
"deno.unstable": true
}
coc-deno 3.3.0 and coc-tsserver 1.7.0.
Is there a minimum reproducible procedure?
This is the procedure I tried, coc-deno
has no problem and is behaving correctly.
- Preparation
mkdir -p /tmp/deno-check
cd /tmp/deno-check
nvim check.ts
The code is this one from the official manual. https://deno.land/manual@v1.9.0/getting_started/first_steps#making-an-http-request
- Run
:CocCommand deno.initializeWorkspace
and checked and<CR>
.
DEMO
@yaegassy I reproduce your demo and I wasn't able fix the problem. Here is my version, and configurations if it helps:
Vim configuration
call plug#begin('~/.vim/plugged')
" ------------ UI ------------
" Gruvbox theme.
Plug 'morhetz/gruvbox'
" Dracula theme.
Plug 'dracula/vim', { 'as': 'dracula' }
" Ariline - bottom bar
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" NERDTree - file navigation
Plug 'preservim/nerdtree'
" GitGutter - Shows git diff
Plug 'airblade/vim-gitgutter'
" --------------------------------
" ------------ File add-ons ------------
" You should be able to see and destroy trailing whitespaces.
" You can clean trailing whitespace with :FixWhitespace.
Plug 'bronson/vim-trailing-whitespace'
" --------------------------------
" ------------ Programming ------------
" Conquer of Completion: Smart completitions
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" Needed for flutter commands...
Plug 'dart-lang/dart-vim-plugin'
Plug 'thosakwe/vim-flutter'
" --------------------------------
call plug#end()
" ------------ NERDTree configuration ------------
" Start NERDTree and put the cursor back in the other window.
autocmd VimEnter * NERDTree | wincmd p
" Exit Vim if NERDTree is the only window left.
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() |
\ quit | endif
" --------------------------------
" ------------ Air-line configuration ------------
let g:airline_powerline_fonts = 1
let g:python3_host_prog = '/usr/local/bin/python3'
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_symbols.dirty=''
function! AirlineInit()
let g:airline_section_a = airline#section#create(['mode', ' ', 'branch'])
let g:airline_section_b = airline#section#create(["🐻 on ", '%f'])
let g:airline_section_c = airline#section#create_right(['%M'])
let g:airline_section_z = airline#section#create_right(['%l:%c/%L - %p%%'])
endfunction
autocmd User AirlineAfterInit call AirlineInit()
" --------------------------------
" Flutter configuration. -- Plug 'thosakwe/vim-flutter'
nnoremap <leader>fa :FlutterRun<cr>
nnoremap <leader>fq :FlutterQuit<cr>
nnoremap <leader>fr :FlutterHotReload<cr>
nnoremap <leader>fR :FlutterHotRestart<cr>
nnoremap <leader>fD :FlutterVisualDebug<cr>
" --------------------------------
"--------------Personal configuration.--------------
set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab "Set number of spaces a tab has.
set number "Show current line number of the file.
set t_Co=256 "It specifically refers to the number of colors the terminal supports.
colorscheme gruvbox "Vim theme -> https://github.com/morhetz/gruvbox
set background=dark "Setting vim theme in dark mode.
set relativenumber "Setting line numbers in a relative way.
set cursorline "Highlight current line.
set encoding=UTF-8
set splitright
set splitbelow
" To see my 80th column
if (exists('+colorcolumn'))
set colorcolumn=80
highlight ColorColumn ctermbg=7
endif
" Copy and paste
:inoremap <C-v> <ESC>"+pa
:vnoremap <C-c> "+y
:vnoremap <C-x> "+d
"--------------Personal configuration.--------------
$ deno version
deno 1.9.0 (release, x86_64-apple-darwin)
v8 9.1.269.5
typescript 4.2.2
If you really tried the same steps as I did (from creating the directory) and the problem persists, I don't know the cause of the problem either.
There seems to be nothing wrong with your various settings.
Try other machine environments using docker, vagrant, virtualbox, etc. and you may find the cause of your problem to be solved.
Yeah I will try that, thanks for your amazing help. Definitely is a problem with my environment, when I run :CocCommand deno.initializeWorkspace
It flashes (The error goes away, it shows some warnings in the code and then the ts-server
errors returns).
Is is possible to use coc-deno with another coc extension to show twind class suggestions that depends on coc-tsserver? I'm trying to port this extension https://github.com/tw-in-js/vscode-twind-intellisense/ that would depends on coc-tsserver like this one https://github.com/fannheyward/coc-styled-components/
@igorbrasileiro I don't think we can use these extensions with coc-deno or Deno LSP, cause typescript-styled-plugin
etc plugins can only work as TypeScript plugins with tsconfig.json.