Skip to content

Commit 63228ba

Browse files
authored
Fix comments issues (domluna#913)
I don't exactly remember why I commented this out in the first place. I believe it was because I was working on getting these to be treated as regular args wrapped in comments but it there was a issue with regular multiline comments. fix domluna#909
1 parent 4ddb9ee commit 63228ba

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "JuliaFormatter"
22
uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
33
authors = ["Dominique Luna <[email protected]>"]
4-
version = "2.1.0"
4+
version = "2.1.1"
55

66
[deps]
77
CommonMark = "a80b9123-70ca-4bc0-993e-6e3bcb318db6"

src/styles/default/pretty.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,10 @@ function p_comment(
247247
loc = cursor_loc(s)
248248
same_line = on_same_line(s, s.offset, s.offset + span(cst) - 1)
249249
val = getsrcval(s.doc, s.offset:s.offset+span(cst)-1)
250-
# if same_line && startswith(val, "#=") && endswith(val, "=#")
251-
# s.offset += span(cst)
252-
# return FST(HASHEQCOMMENT, loc[2], loc[1], loc[1], val)
253-
# end
250+
if same_line && startswith(val, "#=") && endswith(val, "=#")
251+
s.offset += span(cst)
252+
return FST(HASHEQCOMMENT, loc[2], loc[1], loc[1], val)
253+
end
254254
s.offset += span(cst)
255255
FST(NONE, loc[2], loc[1], loc[1], "")
256256
end

test/issues.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,7 @@
13861386
arraycopy_common(false#=fwd=#, LLVM.Builder(B), orig, origops[1], gutils)
13871387
return nothing
13881388
"""
1389-
@test_broken fmt(s) == s_
1389+
@test fmt(s) == s_
13901390

13911391
s1 = """
13921392
foo(a, b, #=c=#)
@@ -1397,7 +1397,7 @@
13971397
b,#=c=#
13981398
)
13991399
"""
1400-
@test_broken fmt(s1, 4, 1) == s2
1400+
@test fmt(s1, 4, 1) == s2
14011401
end
14021402

14031403
@testset "604" begin

0 commit comments

Comments
 (0)