1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-04-14 15:19:12 +08:00

test(lua): add java lua layer

This commit is contained in:
wsdjeg 2022-06-18 22:57:23 +08:00
parent 1fefa5a595
commit 24d485eb49
2 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,37 @@
--=============================================================================
-- java.lua --- Java layer
-- Copyright (c) 2016-2019 Wang Shidong & Contributors
-- Author: Wang Shidong < wsdjeg@outlook.com >
-- URL: https://spacevim.org
-- License: GPLv3
--=============================================================================
local M = {}
local format_on_save = true
function M.plugins()
end
function M.config()
end
function M.set_variable(var)
format_on_save = var.format_on_save or format_on_save
end
function M.get_variable()
return {
'format_on_save' = format_on_save
}
end
return M

View File

@ -0,0 +1,7 @@
Execute ( SpaceVim lua layer: lang#java ):
if has('nvim-0.5.0') || has('+lua')
lua require('spacevim.layer.lang.java').set_variable({['format_on_save'] = false})
lua format_on_save = require('spacevim.layer.lang.java').get_variable()
AssertEqual cmp.luaeval('format_on_save'), v:false
endif