summaryrefslogtreecommitdiff
path: root/script/provider
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-02-02 16:44:28 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-02-02 16:44:28 +0800
commitcd5b93f0308ca9e3f494344a626730efdc10f219 (patch)
tree45eff587f41d4c73a9d28bda8d4fd20a464392a0 /script/provider
parent0948c854de21e720c951c51c37d40b0ef8af980b (diff)
downloadlua-language-server-cd5b93f0308ca9e3f494344a626730efdc10f219.zip
File event is not perfect, do not use it first
Diffstat (limited to 'script/provider')
-rw-r--r--script/provider/capability.lua78
-rw-r--r--script/provider/provider.lua24
2 files changed, 52 insertions, 50 deletions
diff --git a/script/provider/capability.lua b/script/provider/capability.lua
index 6bf93f95..e7219c93 100644
--- a/script/provider/capability.lua
+++ b/script/provider/capability.lua
@@ -14,6 +14,44 @@ local function allWords()
return list
end
+local function testFileEvents(initer)
+ initer.fileOperations = {
+ didCreate = {
+ filters = {
+ {
+ pattern = {
+ glob = '**',
+ --matches = 'file',
+ options = platform.OS == 'Windows',
+ }
+ }
+ }
+ },
+ didDelete = {
+ filters = {
+ {
+ pattern = {
+ glob = '**',
+ --matches = 'file',
+ options = platform.OS == 'Windows',
+ }
+ }
+ }
+ },
+ didRename = {
+ filters = {
+ {
+ pattern = {
+ glob = '**',
+ --matches = 'file',
+ options = platform.OS == 'Windows',
+ }
+ }
+ }
+ },
+ }
+end
+
function m.getIniter()
local initer = {
-- 文本同步方式
@@ -52,48 +90,14 @@ function m.getIniter()
},
},
foldingRangeProvider = true,
- workspace = {
- fileOperations = {
- didCreate = {
- filters = {
- {
- pattern = {
- glob = '**',
- --matches = 'file',
- options = platform.OS == 'Windows',
- }
- }
- }
- },
- didDelete = {
- filters = {
- {
- pattern = {
- glob = '**',
- --matches = 'file',
- options = platform.OS == 'Windows',
- }
- }
- }
- },
- didRename = {
- filters = {
- {
- pattern = {
- glob = '**',
- --matches = 'file',
- options = platform.OS == 'Windows',
- }
- }
- }
- },
- },
- }
+ workspace = {}
--documentOnTypeFormattingProvider = {
-- firstTriggerCharacter = '}',
--},
}
+ --testFileEvents()
+
nonil.enable()
if not client.info.capabilities.textDocument.completion.dynamicRegistration then
initer.completionProvider = {
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index c3826a69..a7a15b84 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -114,20 +114,18 @@ proto.on('initialized', function (params)
local registrations = {}
-- 监视文件变化
- if not client.info.capabilities.workspace.fileOperations then
- registrations[#registrations+1] = {
- id = 'workspace/didChangeWatchedFiles',
- method = 'workspace/didChangeWatchedFiles',
- registerOptions = {
- watchers = {
- {
- globPattern = '**/',
- kind = 1 | 2 | 4,
- }
- },
+ registrations[#registrations+1] = {
+ id = 'workspace/didChangeWatchedFiles',
+ method = 'workspace/didChangeWatchedFiles',
+ registerOptions = {
+ watchers = {
+ {
+ globPattern = '**/',
+ kind = 1 | 2 | 4,
+ }
},
- }
- end
+ },
+ }
-- 监视配置变化
registrations[#registrations+1] = {