Add importMap option to deno Initialization Options (#3827)

* feat(deno): move init options to handlers

* feat(deno): add deno lsp support for js files

* feat(deno): use default map option

* feat(docs): add deno import map option

* feat(deno): add tests for importMap option

* fix(deno): use full path in importMap

* feat(deno): remove deno as linter for js, separate PR

* fix(deno): test for executable

* fix(deno-test): include filename to simplify function
This commit is contained in:
Arnold Chand
2021-07-25 00:39:56 -04:00
committed by GitHub
parent 7d8fb2ba17
commit 8c591996a8
8 changed files with 73 additions and 18 deletions

View File

@@ -1,4 +1,5 @@
Before:
let g:ale_deno_importMap = 'import_map.json'
let g:ale_deno_unstable = 0
let g:ale_deno_executable = 'deno'
let g:ale_deno_lsp_project_root = ''
@@ -13,7 +14,8 @@ Execute(Should set deno lsp for TypeScript projects using stable Deno API):
AssertLSPOptions {
\ 'enable': v:true,
\ 'lint': v:true,
\ 'unstable': v:false
\ 'unstable': v:false,
\ 'importMap': ''
\}
Execute(Should set deno lsp using unstable Deno API if enabled by user):
@@ -22,7 +24,41 @@ Execute(Should set deno lsp using unstable Deno API if enabled by user):
AssertLSPOptions {
\ 'enable': v:true,
\ 'lint': v:true,
\ 'unstable': v:true
\ 'unstable': v:true,
\ 'importMap': ''
\}
Execute(Should set the default importMap filepath):
call ale#test#SetFilename('../test-files/typescript/test.ts')
AssertLSPOptions {
\ 'enable': v:true,
\ 'lint': v:true,
\ 'unstable': v:false,
\ 'importMap': ale#path#Simplify(g:dir . '/../test-files/typescript/import_map.json')
\}
Execute(Should set the importMap filepath from user defined importMap):
let g:ale_deno_importMap = 'custom_import_map.json'
call ale#test#SetFilename('../test-files/typescript/test.ts')
AssertLSPOptions {
\ 'enable': v:true,
\ 'lint': v:true,
\ 'unstable': v:false,
\ 'importMap': ale#path#Simplify(g:dir . '/../test-files/typescript/custom_import_map.json')
\}
Execute(Should set the importMap filepath from user defined importMap with unstable API):
let g:ale_deno_importMap = 'custom_import_map.json'
let g:ale_deno_unstable = 1
call ale#test#SetFilename('../test-files/typescript/test.ts')
AssertLSPOptions {
\ 'enable': v:true,
\ 'lint': v:true,
\ 'unstable': v:true,
\ 'importMap': ale#path#Simplify(g:dir . '/../test-files/typescript/custom_import_map.json')
\}
Execute(Should find project root containing tsconfig.json):