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:
parent
1fefa5a595
commit
24d485eb49
37
lua/spacevim/layer/lang/java.lua
Normal file
37
lua/spacevim/layer/lang/java.lua
Normal 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
|
7
test/lua/layer/lang/java.vader
Normal file
7
test/lua/layer/lang/java.vader
Normal 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user