-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keep multiline comments in place before commas (#822)
* Keep multiline comments in place when formatting punctuated sequences * Update changelog
- Loading branch information
1 parent
095e2b0
commit edf11fe
Showing
7 changed files
with
107 additions
and
23 deletions.
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
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
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
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
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
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,21 @@ | ||
-- https://github.com/JohnnyMorganz/StyLua/issues/778 | ||
-- comments should stay before punctuation to ensure type assertions work in sumneko-lua | ||
|
||
function fun( | ||
a --[[ a commnet]], | ||
b | ||
) | ||
end | ||
|
||
local tab = { | ||
a = 1 --[[@as integer ]], | ||
b = 1, | ||
} | ||
|
||
call( | ||
long_argument_name --[[@as integer ]], | ||
long_argument_name, | ||
long_argument_name, | ||
long_argument_name, | ||
long_argument_name | ||
) |
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,27 @@ | ||
--- | ||
source: tests/tests.rs | ||
expression: format(&contents) | ||
input_file: tests/inputs/comments-before-punctuation.lua | ||
--- | ||
-- https://github.com/JohnnyMorganz/StyLua/issues/778 | ||
-- comments should stay before punctuation to ensure type assertions work in sumneko-lua | ||
|
||
function fun( | ||
a --[[ a commnet]], | ||
b | ||
) | ||
end | ||
|
||
local tab = { | ||
a = 1 --[[@as integer ]], | ||
b = 1, | ||
} | ||
|
||
call( | ||
long_argument_name --[[@as integer ]], | ||
long_argument_name, | ||
long_argument_name, | ||
long_argument_name, | ||
long_argument_name | ||
) | ||
|