-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# ============================================================================== | ||
# Functions without parameters. | ||
# ============================================================================== | ||
Given lua (function without parameters): | ||
function myFunc() | ||
end | ||
|
||
Do (trigger doge): | ||
\<C-d> | ||
|
||
Expect lua (generated comment with nothing but the text 'TODO'): | ||
-- TODO | ||
function myFunc() | ||
end | ||
|
||
# ============================================================================== | ||
# Functions with parameters. | ||
# ============================================================================== | ||
Given lua (function with parameters): | ||
function myFunc(arg1, arg2, arg3, arg4) | ||
end | ||
|
||
Do (trigger doge): | ||
\<C-d> | ||
|
||
Expect lua (generated comment with @param tags): | ||
-- TODO | ||
-- @param arg1 TODO | ||
-- @param arg2 TODO | ||
-- @param arg3 TODO | ||
-- @param arg4 TODO | ||
function myFunc(arg1, arg2, arg3, arg4) | ||
end | ||
|
||
# ============================================================================== | ||
# Functions as a variable value. | ||
# ============================================================================== | ||
Given lua (function as a variable value with parameters): | ||
local myFunc = function(arg1, arg2) | ||
end | ||
|
||
Do (trigger doge): | ||
\<C-d> | ||
|
||
Expect lua (generated comment with @param tags): | ||
-- TODO | ||
-- @param arg1 TODO | ||
-- @param arg2 TODO | ||
local myFunc = function(arg1, arg2) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# ============================================================================== | ||
# Methods declared with a ':'. | ||
# ============================================================================== | ||
Given lua (method declared with a ':' with parameters): | ||
function a.b:c (arg1, arg2) | ||
end | ||
|
||
Do (trigger doge): | ||
\<C-d> | ||
|
||
Expect lua (generated comment with @param tags): | ||
-- TODO | ||
-- @param arg1 TODO | ||
-- @param arg2 TODO | ||
function a.b:c (arg1, arg2) | ||
end | ||
|
||
# ============================================================================== | ||
# Methods declared with a '.'. | ||
# ============================================================================== | ||
Given lua (method declared with a '.' with parameters): | ||
a.b.c = function (self, arg1, arg2) | ||
end | ||
|
||
Do (trigger doge): | ||
\<C-d> | ||
|
||
Expect lua (generated comment with @param tags): | ||
-- TODO | ||
-- @param self TODO | ||
-- @param arg1 TODO | ||
-- @param arg2 TODO | ||
a.b.c = function (self, arg1, arg2) | ||
end | ||
|
||
# ============================================================================== | ||
# Method calls that should not generate anything. | ||
# ============================================================================== | ||
Given lua (method with parameters called with ':' syntax): | ||
myobj:foo(n) | ||
|
||
Do (trigger doge): | ||
\<C-d> | ||
|
||
Expect lua (no changes): | ||
myobj:foo(n) | ||
|
||
# ------------------------------------------------------------------------------ | ||
|
||
Given lua (method with parameters called with '.' syntax): | ||
myobj.foo(myobj, n) | ||
|
||
Do (trigger doge): | ||
\<C-d> | ||
|
||
Expect lua (generated comment with @param tags): | ||
myobj.foo(myobj, n) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters