summaryrefslogtreecommitdiff
path: root/meta/3rd
diff options
context:
space:
mode:
Diffstat (limited to 'meta/3rd')
-rw-r--r--meta/3rd/Jass/config.lua2
-rw-r--r--meta/3rd/example/config.lua25
-rw-r--r--meta/3rd/example/library/love.lua6
-rw-r--r--meta/3rd/example/plugin.lua16
4 files changed, 48 insertions, 1 deletions
diff --git a/meta/3rd/Jass/config.lua b/meta/3rd/Jass/config.lua
index 22b71f85..741757b1 100644
--- a/meta/3rd/Jass/config.lua
+++ b/meta/3rd/Jass/config.lua
@@ -1,5 +1,5 @@
-- matched words
-match = {'jass.common'}
+words = {'jass.common'}
config = {
{
name = 'Lua.runtime.version'
diff --git a/meta/3rd/example/config.lua b/meta/3rd/example/config.lua
new file mode 100644
index 00000000..618ead1a
--- /dev/null
+++ b/meta/3rd/example/config.lua
@@ -0,0 +1,25 @@
+local keyword = require "core.keyword"
+-- list of matched words
+words = {'thisIsAnExampleWord.ifItExistsInFile.thenTryLoadThisLibrary'}
+-- list or matched file names
+files = {'thisIsAnExampleFile.ifItExistsInWorkSpace.thenTryLoadThisLibrary'}
+-- changed setting
+config = {
+ {
+ name = 'Lua.runtime.version',
+ type = 'set',
+ value = 'LuaJIT',
+ },
+ {
+ name = 'Lua.diagnostics.globals',
+ type = 'add',
+ value = 'global1',
+ }
+}
+for _, name in ipairs {'global2', 'global3', 'global4'} do
+ config[#config+1] = {
+ name = 'Lua.diagnostics.globals',
+ type = 'add',
+ value = name,
+ }
+end
diff --git a/meta/3rd/example/library/love.lua b/meta/3rd/example/library/love.lua
new file mode 100644
index 00000000..b76633a3
--- /dev/null
+++ b/meta/3rd/example/library/love.lua
@@ -0,0 +1,6 @@
+local m = {}
+
+function m.thisIsAnExampleLibrary()
+end
+
+return m
diff --git a/meta/3rd/example/plugin.lua b/meta/3rd/example/plugin.lua
new file mode 100644
index 00000000..e25d487a
--- /dev/null
+++ b/meta/3rd/example/plugin.lua
@@ -0,0 +1,16 @@
+-- if this file exists, then change setting `Lua.runtime.plugin`
+-- see https://github.com/sumneko/lua-language-server/wiki/Plugin
+
+function OnSetText(uri, text)
+ local diffs = {}
+
+ for start, finish in text:gmatch '()pairs()' do
+ diffs[#diffs+1] = {
+ start = start,
+ finish = finish - 1,
+ text = 'safepairs'
+ }
+ end
+
+ return diffs
+end