mirror of
https://github.com/kevinhwang91/nvim-ufo
synced 2024-09-16 14:14:02 +02:00
fix(promise): handle rejection elegantly
This commit is contained in:
parent
f0ae3c77d9
commit
c01e3d81ef
4 changed files with 4 additions and 4 deletions
|
@ -21,7 +21,7 @@ exports.activate = async context => {
|
|||
if (!languages.hasProvider('foldingRange', textDocument)) {
|
||||
await wait(500)
|
||||
if (!languages.hasProvider('foldingRange', textDocument)) {
|
||||
throw new Error('UfoFallbackException')
|
||||
throw 'UfoFallbackException'
|
||||
}
|
||||
}
|
||||
await doc.synchronize()
|
||||
|
|
|
@ -110,7 +110,7 @@ function Fold.update(bufnr)
|
|||
if not dispose(false) then
|
||||
return
|
||||
end
|
||||
error(err)
|
||||
promise.reject(err)
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ function Provider:requestFoldingRange(providers, bufnr)
|
|||
return {main, nil}
|
||||
end
|
||||
else
|
||||
error(reason)
|
||||
return promise.reject(reason)
|
||||
end
|
||||
end)
|
||||
if log.isEnabled('debug') then
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"main": "coc-extension/index.js",
|
||||
"type": "commonjs",
|
||||
"engines": {
|
||||
"coc": "^0.0.81"
|
||||
"coc": "^0.0.82"
|
||||
},
|
||||
"activationEvents": [
|
||||
"*"
|
||||
|
|
Loading…
Reference in a new issue