@@ -373,21 +373,21 @@ defmodule CodeFragmentTest do
373
373
374
374
test "keyword or binary operator" do
375
375
# Literals
376
- assert CF . cursor_context ( "Foo.Bar " ) == :block_keyword_or_binary_operator
377
- assert CF . cursor_context ( "Foo " ) == :block_keyword_or_binary_operator
378
- assert CF . cursor_context ( ":foo " ) == :block_keyword_or_binary_operator
379
- assert CF . cursor_context ( "123 " ) == :block_keyword_or_binary_operator
380
- assert CF . cursor_context ( "nil " ) == :block_keyword_or_binary_operator
381
- assert CF . cursor_context ( "true " ) == :block_keyword_or_binary_operator
382
- assert CF . cursor_context ( "false " ) == :block_keyword_or_binary_operator
383
- assert CF . cursor_context ( "\" foo\" " ) == :block_keyword_or_binary_operator
384
- assert CF . cursor_context ( "'foo' " ) == :block_keyword_or_binary_operator
376
+ assert CF . cursor_context ( "Foo.Bar " ) == { :block_keyword_or_binary_operator , ~c " " }
377
+ assert CF . cursor_context ( "Foo " ) == { :block_keyword_or_binary_operator , ~c " " }
378
+ assert CF . cursor_context ( ":foo " ) == { :block_keyword_or_binary_operator , ~c " " }
379
+ assert CF . cursor_context ( "123 " ) == { :block_keyword_or_binary_operator , ~c " " }
380
+ assert CF . cursor_context ( "nil " ) == { :block_keyword_or_binary_operator , ~c " " }
381
+ assert CF . cursor_context ( "true " ) == { :block_keyword_or_binary_operator , ~c " " }
382
+ assert CF . cursor_context ( "false " ) == { :block_keyword_or_binary_operator , ~c " " }
383
+ assert CF . cursor_context ( "\" foo\" " ) == { :block_keyword_or_binary_operator , ~c " " }
384
+ assert CF . cursor_context ( "'foo' " ) == { :block_keyword_or_binary_operator , ~c " " }
385
385
386
386
# Containers
387
- assert CF . cursor_context ( "(foo) " ) == :block_keyword_or_binary_operator
388
- assert CF . cursor_context ( "[foo] " ) == :block_keyword_or_binary_operator
389
- assert CF . cursor_context ( "{foo} " ) == :block_keyword_or_binary_operator
390
- assert CF . cursor_context ( "<<foo>> " ) == :block_keyword_or_binary_operator
387
+ assert CF . cursor_context ( "(foo) " ) == { :block_keyword_or_binary_operator , ~c " " }
388
+ assert CF . cursor_context ( "[foo] " ) == { :block_keyword_or_binary_operator , ~c " " }
389
+ assert CF . cursor_context ( "{foo} " ) == { :block_keyword_or_binary_operator , ~c " " }
390
+ assert CF . cursor_context ( "<<foo>> " ) == { :block_keyword_or_binary_operator , ~c " " }
391
391
392
392
# False positives
393
393
assert CF . cursor_context ( "foo ~>> " ) == { :operator_call , ~c" ~>>" }
@@ -396,21 +396,22 @@ defmodule CodeFragmentTest do
396
396
397
397
test "keyword from keyword or binary operator" do
398
398
# Literals
399
- assert CF . cursor_context ( "Foo.Bar d" ) == { :block_keyword , ~c" d" }
400
- assert CF . cursor_context ( "Foo d" ) == { :block_keyword , ~c" d" }
401
- assert CF . cursor_context ( ":foo d" ) == { :block_keyword , ~c" d" }
402
- assert CF . cursor_context ( "123 d" ) == { :block_keyword , ~c" d" }
403
- assert CF . cursor_context ( "nil d" ) == { :block_keyword , ~c" d" }
404
- assert CF . cursor_context ( "true d" ) == { :block_keyword , ~c" d" }
405
- assert CF . cursor_context ( "false d" ) == { :block_keyword , ~c" d" }
406
- assert CF . cursor_context ( "\" foo\" d" ) == { :block_keyword , ~c" d" }
407
- assert CF . cursor_context ( "'foo' d" ) == { :block_keyword , ~c" d" }
399
+ assert CF . cursor_context ( "Foo.Bar do" ) == { :block_keyword_or_binary_operator , ~c" do" }
400
+ assert CF . cursor_context ( "Foo.Bar d" ) == { :block_keyword_or_binary_operator , ~c" d" }
401
+ assert CF . cursor_context ( "Foo d" ) == { :block_keyword_or_binary_operator , ~c" d" }
402
+ assert CF . cursor_context ( ":foo d" ) == { :block_keyword_or_binary_operator , ~c" d" }
403
+ assert CF . cursor_context ( "123 d" ) == { :block_keyword_or_binary_operator , ~c" d" }
404
+ assert CF . cursor_context ( "nil d" ) == { :block_keyword_or_binary_operator , ~c" d" }
405
+ assert CF . cursor_context ( "true d" ) == { :block_keyword_or_binary_operator , ~c" d" }
406
+ assert CF . cursor_context ( "false d" ) == { :block_keyword_or_binary_operator , ~c" d" }
407
+ assert CF . cursor_context ( "\" foo\" d" ) == { :block_keyword_or_binary_operator , ~c" d" }
408
+ assert CF . cursor_context ( "'foo' d" ) == { :block_keyword_or_binary_operator , ~c" d" }
408
409
409
410
# Containers
410
- assert CF . cursor_context ( "(foo) d" ) == { :block_keyword , ~c" d" }
411
- assert CF . cursor_context ( "[foo] d" ) == { :block_keyword , ~c" d" }
412
- assert CF . cursor_context ( "{foo} d" ) == { :block_keyword , ~c" d" }
413
- assert CF . cursor_context ( "<<foo>> d" ) == { :block_keyword , ~c" d" }
411
+ assert CF . cursor_context ( "(foo) d" ) == { :block_keyword_or_binary_operator , ~c" d" }
412
+ assert CF . cursor_context ( "[foo] d" ) == { :block_keyword_or_binary_operator , ~c" d" }
413
+ assert CF . cursor_context ( "{foo} d" ) == { :block_keyword_or_binary_operator , ~c" d" }
414
+ assert CF . cursor_context ( "<<foo>> d" ) == { :block_keyword_or_binary_operator , ~c" d" }
414
415
415
416
# False positives
416
417
assert CF . cursor_context ( "foo ~>> d" ) == { :local_or_var , ~c" d" }
0 commit comments