Skip to content

Commit e8ff62a

Browse files
committed
Thoroughly test multiline custom completions with Sys.getenv()
1 parent 6ab0bd2 commit e8ff62a

File tree

1 file changed

+16
-0
lines changed
  • crates/ark/src/lsp/completions/sources/unique

1 file changed

+16
-0
lines changed

crates/ark/src/lsp/completions/sources/unique/custom.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,18 +302,34 @@ mod tests {
302302
let (text, point) = point_from_cursor("Sys.getenv(@)");
303303
assert_has_ark_test_envvar_completion(text.as_str(), point);
304304

305+
// Inside the parentheses, multiline
306+
let (text, point) = point_from_cursor("Sys.getenv(\n @\n)");
307+
assert_has_ark_test_envvar_completion(text.as_str(), point);
308+
305309
// Named argument
306310
let (text, point) = point_from_cursor("Sys.getenv(x = @)");
307311
assert_has_ark_test_envvar_completion(text.as_str(), point);
308312

313+
// Named argument, multiline
314+
let (text, point) = point_from_cursor("Sys.getenv(\n x = @\n)");
315+
assert_has_ark_test_envvar_completion(text.as_str(), point);
316+
309317
// Typed some and then requested completions
310318
let (text, point) = point_from_cursor("Sys.getenv(ARK_@)");
311319
assert_has_ark_test_envvar_completion(text.as_str(), point);
312320

321+
// Typed some and then requested completions, multiline
322+
let (text, point) = point_from_cursor("Sys.getenv(\n ARK_@\n)");
323+
assert_has_ark_test_envvar_completion(text.as_str(), point);
324+
313325
// After a named argument
314326
let (text, point) = point_from_cursor("Sys.getenv(unset = '1', @)");
315327
assert_has_ark_test_envvar_completion(text.as_str(), point);
316328

329+
// After a named argument, multiline
330+
let (text, point) = point_from_cursor("Sys.getenv(\n unset = '1',\n @\n)");
331+
assert_has_ark_test_envvar_completion(text.as_str(), point);
332+
317333
// Should not have it here
318334
let (text, point) = point_from_cursor("Sys.getenv('foo', @)");
319335
let document = Document::new(text.as_str(), None);

0 commit comments

Comments
 (0)