File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ def run
56
56
store . delete ( uri )
57
57
in { method : "textDocument/formatting" , id :, params : { textDocument : { uri : } } }
58
58
contents = store [ uri ]
59
- write ( id : id , result : contents ? [ format ( store [ uri ] ) ] : nil )
59
+ write ( id : id , result : contents ? [ format ( store [ uri ] , uri . split ( "." ) . last ) ] : nil )
60
60
in { method : "textDocument/inlayHint" , id :, params : { textDocument : { uri : } } }
61
61
contents = store [ uri ]
62
62
write ( id : id , result : contents ? inlay_hints ( store [ uri ] ) : nil )
@@ -86,7 +86,7 @@ def capabilities
86
86
}
87
87
end
88
88
89
- def format ( source )
89
+ def format ( source , file_extension )
90
90
{
91
91
range : {
92
92
start : {
@@ -98,7 +98,7 @@ def format(source)
98
98
character : 0
99
99
}
100
100
} ,
101
- newText : SyntaxTree . format ( source , print_width )
101
+ newText : file_extension == "haml" ? SyntaxTree :: Haml . format ( source , print_width ) : SyntaxTree . format ( source , print_width )
102
102
}
103
103
end
104
104
@@ -119,3 +119,4 @@ def write(value)
119
119
end
120
120
end
121
121
end
122
+
You can’t perform that action at this time.
0 commit comments