File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed
Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 11-- main module file
22local module = require (" plugin_name.module" )
33
4- local M = {}
5- M . config = {
6- -- default config
7- opt = " Hello!" ,
4+ --- @class Config
5+ --- @field opt string Your config option
6+ local config = {
7+ opt = " Hello!"
88}
99
10- -- setup is the public method to setup your plugin
10+ --- @class MyModule
11+ local M = {}
12+
13+ --- @type Config
14+ M .config = config
15+
16+ --- @param args Config ?
17+ -- you can define your setup function here. Usually configurations can be merged, accepting outside params and
18+ -- you can also put some validation here for those.
1119M .setup = function (args )
12- -- you can define your setup function here. Usually configurations can be merged, accepting outside params and
13- -- you can also put some validation here for those.
1420 M .config = vim .tbl_deep_extend (" force" , M .config , args or {})
1521end
1622
17- -- "hello" is a public method for the plugin
1823M .hello = function ()
1924 module .my_first_function ()
2025end
Original file line number Diff line number Diff line change 1- -- module represents a lua module for the plugin
1+ --- @class CustomModule
22local M = {}
33
4+ --- @return string
45M .my_first_function = function ()
56 return " hello world!"
67end
You can’t perform that action at this time.
0 commit comments