Skip to content

Commit d86d946

Browse files
authored
chore: fix formatting in test file (#23)
1 parent e377bc0 commit d86d946

File tree

1 file changed

+59
-85
lines changed

1 file changed

+59
-85
lines changed

Diff for: test/next_ls_test.exs

+59-85
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ defmodule NextLSTest do
5252
params: %{}
5353
})
5454

55-
assert_notification "window/logMessage",
56-
%{"message" => "[NextLS] Runtime ready..."}
55+
assert_notification "window/logMessage", %{"message" => "[NextLS] Runtime ready..."}
5756

5857
assert :ok ==
5958
request(client, %{
@@ -63,7 +62,7 @@ defmodule NextLSTest do
6362
params: nil
6463
})
6564

66-
assert_result(2, nil)
65+
assert_result 2, nil
6766
end
6867

6968
test "returns method not found for unimplemented requests", %{
@@ -90,39 +89,30 @@ defmodule NextLSTest do
9089
}
9190
})
9291

93-
assert_notification(
94-
"window/logMessage",
95-
%{
96-
"message" => "[NextLS] Method Not Found: textDocument/documentSymbol",
97-
"type" => 2
98-
}
99-
)
92+
assert_notification "window/logMessage", %{
93+
"message" => "[NextLS] Method Not Found: textDocument/documentSymbol",
94+
"type" => 2
95+
}
10096

101-
assert_error(
102-
^id,
103-
%{
104-
"code" => -32_601,
105-
"message" => "Method Not Found: textDocument/documentSymbol"
106-
}
107-
)
97+
assert_error ^id, %{
98+
"code" => -32_601,
99+
"message" => "Method Not Found: textDocument/documentSymbol"
100+
}
108101
end
109102

110103
test "can initialize the server" do
111-
assert_result(
112-
1,
113-
%{
114-
"capabilities" => %{
115-
"textDocumentSync" => %{
116-
"openClose" => true,
117-
"save" => %{
118-
"includeText" => true
119-
},
120-
"change" => 1
121-
}
122-
},
123-
"serverInfo" => %{"name" => "NextLS"}
124-
}
125-
)
104+
assert_result 1, %{
105+
"capabilities" => %{
106+
"textDocumentSync" => %{
107+
"openClose" => true,
108+
"save" => %{
109+
"includeText" => true
110+
},
111+
"change" => 1
112+
}
113+
},
114+
"serverInfo" => %{"name" => "NextLS"}
115+
}
126116
end
127117

128118
test "publishes diagnostics once the client has initialized", %{client: client, cwd: cwd} do
@@ -133,37 +123,28 @@ defmodule NextLSTest do
133123
params: %{}
134124
})
135125

136-
assert_notification(
137-
"window/logMessage",
138-
%{
139-
"message" => "[NextLS] LSP Initialized!",
140-
"type" => 4
141-
}
142-
)
126+
assert_notification "window/logMessage", %{
127+
"message" => "[NextLS] LSP Initialized!",
128+
"type" => 4
129+
}
143130

144-
assert_notification("$/progress", %{"value" => %{"kind" => "begin", "title" => "Initializing NextLS runtime..."}})
131+
assert_notification "$/progress", %{"value" => %{"kind" => "begin", "title" => "Initializing NextLS runtime..."}}
145132

146-
assert_notification(
147-
"$/progress",
148-
%{
149-
"value" => %{
150-
"kind" => "end",
151-
"message" => "NextLS runtime has initialized!"
152-
}
133+
assert_notification "$/progress", %{
134+
"value" => %{
135+
"kind" => "end",
136+
"message" => "NextLS runtime has initialized!"
153137
}
154-
)
138+
}
155139

156-
assert_notification("$/progress", %{"value" => %{"kind" => "begin", "title" => "Compiling..."}})
140+
assert_notification "$/progress", %{"value" => %{"kind" => "begin", "title" => "Compiling..."}}
157141

158-
assert_notification(
159-
"$/progress",
160-
%{
161-
"value" => %{
162-
"kind" => "end",
163-
"message" => "Compiled!"
164-
}
142+
assert_notification "$/progress", %{
143+
"value" => %{
144+
"kind" => "end",
145+
"message" => "Compiled!"
165146
}
166-
)
147+
}
167148

168149
for file <- ["bar.ex"] do
169150
uri =
@@ -173,24 +154,21 @@ defmodule NextLSTest do
173154
path: Path.join([cwd, "lib", file])
174155
})
175156

176-
assert_notification(
177-
"textDocument/publishDiagnostics",
178-
%{
179-
"uri" => ^uri,
180-
"diagnostics" => [
181-
%{
182-
"source" => "Elixir",
183-
"severity" => 2,
184-
"message" =>
185-
"variable \"arg1\" is unused (if the variable is not meant to be used, prefix it with an underscore)",
186-
"range" => %{
187-
"start" => %{"line" => 1, "character" => 0},
188-
"end" => %{"line" => 1, "character" => 999}
189-
}
157+
assert_notification "textDocument/publishDiagnostics", %{
158+
"uri" => ^uri,
159+
"diagnostics" => [
160+
%{
161+
"source" => "Elixir",
162+
"severity" => 2,
163+
"message" =>
164+
"variable \"arg1\" is unused (if the variable is not meant to be used, prefix it with an underscore)",
165+
"range" => %{
166+
"start" => %{"line" => 1, "character" => 0},
167+
"end" => %{"line" => 1, "character" => 999}
190168
}
191-
]
192-
}
193-
)
169+
}
170+
]
171+
}
194172
end
195173
end
196174

@@ -240,8 +218,7 @@ defmodule NextLSTest do
240218

241219
assert_result 2, nil
242220

243-
assert_notification "window/logMessage",
244-
%{"message" => "[NextLS] Runtime ready..."}
221+
assert_notification "window/logMessage", %{"message" => "[NextLS] Runtime ready..."}
245222

246223
request client, %{
247224
method: "textDocument/formatting",
@@ -266,14 +243,11 @@ defmodule NextLSTest do
266243
end
267244
"""
268245

269-
assert_result(
270-
3,
271-
[
272-
%{
273-
"newText" => ^new_text,
274-
"range" => %{"start" => %{"character" => 0, "line" => 0}, "end" => %{"character" => 0, "line" => 8}}
275-
}
276-
]
277-
)
246+
assert_result 3, [
247+
%{
248+
"newText" => ^new_text,
249+
"range" => %{"start" => %{"character" => 0, "line" => 0}, "end" => %{"character" => 0, "line" => 8}}
250+
}
251+
]
278252
end
279253
end

0 commit comments

Comments
 (0)