You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ale's ale_completion_tsserver_autoimport inserts default when accepting autoimport suggestion for default import for typescript.
Reproducing the bug
Create file abcd.ts with a default export
In file b.ts, type abc, ale will pop up default v Import default 'abcd' from module "abcd.ts
accept the suggestion, you will see the import statement added import abcd from "abcd" but the inserted text is default`. Note: the import takes two times to be inserted in the first example below as well
This happens for both ts and tsx files.
:ALEInfo
Current Filetype: typescript
Available Linters: ['eslint', 'standard', 'tslint', 'tsserver', 'typecheck', 'xo']
Enabled Linters: ['eslint', 'standard', 'tslint', 'tsserver', 'typecheck', 'xo']
Suggested Fixers:
'eslint' - Apply eslint --fix to a file.
'prettier' - Apply prettier to a file.
'remove_trailing_lines' - Remove all blank lines at the end of a file.
'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
'tslint' - Fix typescript files with tslint --fix.
'xo' - Fix JavaScript/TypeScript files using xo --fix.
Linter Variables:
let g:ale_typescript_standard_executable = 'standard'
let g:ale_typescript_standard_options = ''
let g:ale_typescript_standard_use_global = 0
let g:ale_typescript_tslint_config_path = ''
let g:ale_typescript_tslint_executable = 'tslint'
let g:ale_typescript_tslint_ignore_empty_files = 0
let g:ale_typescript_tslint_rules_dir = ''
let g:ale_typescript_tslint_use_global = 0
let g:ale_typescript_tsserver_config_path = ''
let g:ale_typescript_tsserver_executable = 'tsserver'
The text was updated successfully, but these errors were encountered:
Can you please tell me how I accept an autoimport? I type untill the popup has shown and with C-n C-p C-o select the import that I need, but I don't know how to select it. I try a lot of keys and combinations but nothing happend.
You want to select the menu item so it's highlighted, then press C-y.
I use this keybind to make it easy, by pressing Enter.
" Make pressing Enter accept a completion entry.function!SmartEnter()
ifpumvisible()
return"\<C-y>"endifreturn"\<CR>"endfunctioninoremap<silent><CR><C-R>=SmartEnter()<CR>
I should have fixed this now. The format for default import completion data is weird, but you can read localName from displayParts to get the real name.
Information
VIM version
NVIM v0.4.2
Build type: Release
Operating System: Mac 10.14.6
What went wrong
Ale's
ale_completion_tsserver_autoimport
insertsdefault
when accepting autoimport suggestion for default import for typescript.Reproducing the bug
abcd.ts
with a default exportabc
, ale will pop updefault v Import default 'abcd' from module "abcd.ts
import abcd from "abcd" but the inserted text is
default`. Note: the import takes two times to be inserted in the first example below as wellThis happens for both ts and tsx files.
:ALEInfo
The text was updated successfully, but these errors were encountered: