diff options
Diffstat (limited to 'server-beta/src/provider/completion.lua')
-rw-r--r-- | server-beta/src/provider/completion.lua | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/server-beta/src/provider/completion.lua b/server-beta/src/provider/completion.lua deleted file mode 100644 index d2df44d2..00000000 --- a/server-beta/src/provider/completion.lua +++ /dev/null @@ -1,53 +0,0 @@ -local proto = require 'proto' - -local isEnable = false - -local function allWords() - local str = [[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.:('"[,#*@| ]] - local list = {} - for c in str:gmatch '.' do - list[#list+1] = c - end - return list -end - -local function enable() - if isEnable then - return - end - isEnable = true - log.debug('Enable completion.') - proto.awaitRequest('client/registerCapability', { - registrations = { - { - id = 'completion', - method = 'textDocument/completion', - registerOptions = { - resolveProvider = false, - triggerCharacters = allWords(), - }, - }, - } - }) -end - -local function disable() - if not isEnable then - return - end - isEnable = false - log.debug('Disable completion.') - proto.awaitRequest('client/unregisterCapability', { - unregisterations = { - { - id = 'completion', - method = 'textDocument/completion', - }, - } - }) -end - -return { - enable = enable, - disable = disable, -} |