rubydex 0.2.9 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +110 -6
  3. data/THIRD_PARTY_LICENSES.html +271 -2
  4. data/exe/rdx +2 -73
  5. data/ext/rubydex/config.c +140 -0
  6. data/ext/rubydex/config.h +16 -0
  7. data/ext/rubydex/declaration.c +1 -1
  8. data/ext/rubydex/definition.c +32 -4
  9. data/ext/rubydex/diagnostic.c +75 -1
  10. data/ext/rubydex/diagnostic.h +2 -0
  11. data/ext/rubydex/graph.c +27 -48
  12. data/ext/rubydex/graph.h +6 -0
  13. data/ext/rubydex/query.c +487 -0
  14. data/ext/rubydex/query.h +8 -0
  15. data/ext/rubydex/reference.c +60 -0
  16. data/ext/rubydex/rubydex.c +4 -0
  17. data/ext/rubydex/utils.c +23 -4
  18. data/ext/rubydex/utils.h +5 -0
  19. data/lib/ruby_lsp/rubydex/addon.rb +211 -0
  20. data/lib/rubydex/cli/command/console.rb +55 -0
  21. data/lib/rubydex/cli/command/lint/explain.rb +74 -0
  22. data/lib/rubydex/cli/command/lint.rb +202 -0
  23. data/lib/rubydex/cli/command/mcp.rb +30 -0
  24. data/lib/rubydex/cli/command/query.rb +70 -0
  25. data/lib/rubydex/cli/command/skill.rb +69 -0
  26. data/lib/rubydex/cli/command.rb +168 -0
  27. data/lib/rubydex/cli.rb +93 -0
  28. data/lib/rubydex/config.rb +59 -0
  29. data/lib/rubydex/diagnostic.rb +12 -3
  30. data/lib/rubydex/errors.rb +42 -1
  31. data/lib/rubydex/graph.rb +10 -3
  32. data/lib/rubydex/linter/custom_rule.rb +97 -0
  33. data/lib/rubydex/linter/helpers/path_helpers.rb +78 -0
  34. data/lib/rubydex/linter/helpers/source_access_helpers.rb +31 -0
  35. data/lib/rubydex/linter/rule_loader.rb +36 -0
  36. data/lib/rubydex/linter/rule_test_case.rb +343 -0
  37. data/lib/rubydex/linter/runner.rb +56 -0
  38. data/lib/rubydex/linter.rb +19 -0
  39. data/lib/rubydex/location.rb +3 -0
  40. data/lib/rubydex/mcp_server.rb +1 -2
  41. data/lib/rubydex/related_information.rb +17 -0
  42. data/lib/rubydex/rule.rb +33 -0
  43. data/lib/rubydex/severity.rb +70 -0
  44. data/lib/rubydex/skill.rb +88 -0
  45. data/lib/rubydex/skill_registry.rb +62 -0
  46. data/lib/rubydex/version.rb +1 -1
  47. data/lib/rubydex.rb +6 -0
  48. data/lib/rubydex_linter/rules/rule_structure.rb +125 -0
  49. data/rbi/rubydex.rbi +578 -15
  50. data/rust/Cargo.lock +7 -0
  51. data/rust/rubydex/Cargo.toml +1 -0
  52. data/rust/rubydex/benches/graph_memory.rs +20 -4
  53. data/rust/rubydex/src/compile_assertions.rs +15 -0
  54. data/rust/rubydex/src/config.rs +538 -157
  55. data/rust/rubydex/src/diagnostic.rs +66 -40
  56. data/rust/rubydex/src/errors.rs +0 -1
  57. data/rust/rubydex/src/indexing/local_graph.rs +6 -5
  58. data/rust/rubydex/src/indexing/rbs_indexer.rs +284 -8
  59. data/rust/rubydex/src/indexing/ruby_indexer.rs +59 -70
  60. data/rust/rubydex/src/indexing/ruby_indexer_tests.rs +195 -86
  61. data/rust/rubydex/src/lib.rs +1 -0
  62. data/rust/rubydex/src/listing.rs +26 -1
  63. data/rust/rubydex/src/main.rs +9 -128
  64. data/rust/rubydex/src/model/declaration.rs +301 -229
  65. data/rust/rubydex/src/model/definitions.rs +27 -26
  66. data/rust/rubydex/src/model/document.rs +43 -7
  67. data/rust/rubydex/src/model/graph.rs +67 -68
  68. data/rust/rubydex/src/model/id.rs +55 -0
  69. data/rust/rubydex/src/model/ids.rs +21 -9
  70. data/rust/rubydex/src/model/name.rs +88 -19
  71. data/rust/rubydex/src/model/references.rs +16 -13
  72. data/rust/rubydex/src/operation/ruby_builder.rs +78 -104
  73. data/rust/rubydex/src/path_helpers.rs +77 -0
  74. data/rust/rubydex/src/query/cypher/schema.rs +853 -0
  75. data/rust/rubydex/src/query/cypher/schema_info.rs +161 -0
  76. data/rust/rubydex/src/query/cypher/tests.rs +253 -0
  77. data/rust/rubydex/src/query/cypher.rs +54 -0
  78. data/rust/rubydex/src/query.rs +125 -43
  79. data/rust/rubydex/src/resolution.rs +368 -395
  80. data/rust/rubydex/src/resolution_tests.rs +504 -78
  81. data/rust/rubydex/src/test_utils/context.rs +2 -1
  82. data/rust/rubydex/src/test_utils/graph_test.rs +26 -12
  83. data/rust/rubydex/src/test_utils/local_graph_test.rs +19 -0
  84. data/rust/rubydex/tests/cli.rs +4 -4
  85. data/rust/rubydex-sys/src/config_api.rs +205 -0
  86. data/rust/rubydex-sys/src/cypher_api.rs +791 -0
  87. data/rust/rubydex-sys/src/declaration_api.rs +6 -3
  88. data/rust/rubydex-sys/src/definition_api.rs +27 -7
  89. data/rust/rubydex-sys/src/diagnostic_api.rs +77 -8
  90. data/rust/rubydex-sys/src/graph_api.rs +31 -68
  91. data/rust/rubydex-sys/src/lib.rs +2 -0
  92. data/rust/rubydex-sys/src/name_api.rs +2 -6
  93. data/rust/rubydex-sys/src/reference_api.rs +58 -12
  94. data/rust/rubydex-sys/src/utils.rs +37 -0
  95. data/skills/send-private-method/SKILL.md +133 -0
  96. metadata +37 -2
@@ -15,6 +15,8 @@ use crate::model::keywords::{self, Keyword};
15
15
  use crate::model::name::NameRef;
16
16
  use crate::model::visibility::Visibility;
17
17
 
18
+ pub mod cypher;
19
+
18
20
  /// Controls how declaration names are matched against the search query.
19
21
  #[derive(Default)]
20
22
  pub enum MatchMode {
@@ -1171,7 +1173,13 @@ mod tests {
1171
1173
  );
1172
1174
  context.resolve();
1173
1175
 
1174
- let name_id = Name::new(StringId::from("Child"), ParentScope::None, None).id();
1176
+ let name_id = Name::new(
1177
+ context.graph().names(),
1178
+ StringId::from("Child"),
1179
+ ParentScope::None,
1180
+ None,
1181
+ )
1182
+ .id();
1175
1183
  assert_declaration_completion_eq!(
1176
1184
  context,
1177
1185
  CompletionReceiver::Expression {
@@ -1220,7 +1228,13 @@ mod tests {
1220
1228
  );
1221
1229
  context.resolve();
1222
1230
 
1223
- let name_id = Name::new(StringId::from("Child"), ParentScope::None, None).id();
1231
+ let name_id = Name::new(
1232
+ context.graph().names(),
1233
+ StringId::from("Child"),
1234
+ ParentScope::None,
1235
+ None,
1236
+ )
1237
+ .id();
1224
1238
  assert_declaration_completion_eq!(
1225
1239
  context,
1226
1240
  CompletionReceiver::Expression {
@@ -1269,7 +1283,7 @@ mod tests {
1269
1283
  );
1270
1284
  context.resolve();
1271
1285
 
1272
- let name_id = Name::new(StringId::from("Foo"), ParentScope::None, None).id();
1286
+ let name_id = Name::new(context.graph().names(), StringId::from("Foo"), ParentScope::None, None).id();
1273
1287
  assert_declaration_completion_eq!(
1274
1288
  context,
1275
1289
  CompletionReceiver::Expression {
@@ -1318,8 +1332,14 @@ mod tests {
1318
1332
  );
1319
1333
  context.resolve();
1320
1334
 
1321
- let foo_id = Name::new(StringId::from("Foo"), ParentScope::None, None).id();
1322
- let name_id = Name::new(StringId::from("<Foo>"), ParentScope::Attached(foo_id), Some(foo_id)).id();
1335
+ let foo_id = Name::new(context.graph().names(), StringId::from("Foo"), ParentScope::None, None).id();
1336
+ let name_id = Name::new(
1337
+ context.graph().names(),
1338
+ StringId::from("<Foo>"),
1339
+ ParentScope::Attached(foo_id),
1340
+ Some(foo_id),
1341
+ )
1342
+ .id();
1323
1343
  assert_declaration_completion_eq!(
1324
1344
  context,
1325
1345
  CompletionReceiver::Expression {
@@ -1339,7 +1359,7 @@ mod tests {
1339
1359
  ]
1340
1360
  );
1341
1361
 
1342
- let name_id = Name::new(StringId::from("Bar"), ParentScope::None, None).id();
1362
+ let name_id = Name::new(context.graph().names(), StringId::from("Bar"), ParentScope::None, None).id();
1343
1363
  assert_declaration_completion_eq!(
1344
1364
  context,
1345
1365
  CompletionReceiver::Expression {
@@ -1381,8 +1401,14 @@ mod tests {
1381
1401
  );
1382
1402
  context.resolve();
1383
1403
 
1384
- let foo_id = Name::new(StringId::from("Foo"), ParentScope::None, None).id();
1385
- let name_id = Name::new(StringId::from("<Foo>"), ParentScope::Attached(foo_id), Some(foo_id)).id();
1404
+ let foo_id = Name::new(context.graph().names(), StringId::from("Foo"), ParentScope::None, None).id();
1405
+ let name_id = Name::new(
1406
+ context.graph().names(),
1407
+ StringId::from("<Foo>"),
1408
+ ParentScope::Attached(foo_id),
1409
+ Some(foo_id),
1410
+ )
1411
+ .id();
1386
1412
 
1387
1413
  assert_declaration_completion_eq!(
1388
1414
  context,
@@ -1429,9 +1455,10 @@ mod tests {
1429
1455
  context.resolve();
1430
1456
 
1431
1457
  let name_id = Name::new(
1458
+ context.graph().names(),
1432
1459
  StringId::from("Bar"),
1433
1460
  ParentScope::TopLevel,
1434
- Some(Name::new(StringId::from("Foo"), ParentScope::None, None).id()),
1461
+ Some(Name::new(context.graph().names(), StringId::from("Foo"), ParentScope::None, None).id()),
1435
1462
  )
1436
1463
  .id();
1437
1464
 
@@ -1455,7 +1482,7 @@ mod tests {
1455
1482
  ]
1456
1483
  );
1457
1484
 
1458
- let name_id = Name::new(StringId::from("Bar"), ParentScope::None, None).id();
1485
+ let name_id = Name::new(context.graph().names(), StringId::from("Bar"), ParentScope::None, None).id();
1459
1486
  assert_declaration_completion_eq!(
1460
1487
  context,
1461
1488
  CompletionReceiver::Expression {
@@ -1496,8 +1523,14 @@ mod tests {
1496
1523
  );
1497
1524
  context.resolve();
1498
1525
 
1499
- let foo_id = Name::new(StringId::from("Foo"), ParentScope::None, None).id();
1500
- let name_id = Name::new(StringId::from("Bar"), ParentScope::None, Some(foo_id)).id();
1526
+ let foo_id = Name::new(context.graph().names(), StringId::from("Foo"), ParentScope::None, None).id();
1527
+ let name_id = Name::new(
1528
+ context.graph().names(),
1529
+ StringId::from("Bar"),
1530
+ ParentScope::None,
1531
+ Some(foo_id),
1532
+ )
1533
+ .id();
1501
1534
  // Foo::CONST is reachable from Foo::Bar through lexical scoping, so it must appear as a completion candidate
1502
1535
  // when the user types the unqualified name CONST
1503
1536
  assert_declaration_completion_eq!(
@@ -1542,9 +1575,10 @@ mod tests {
1542
1575
  context.resolve();
1543
1576
 
1544
1577
  let name_id = Name::new(
1578
+ context.graph().names(),
1545
1579
  StringId::from("Bar"),
1546
1580
  ParentScope::None,
1547
- Some(Name::new(StringId::from("Foo"), ParentScope::None, None).id()),
1581
+ Some(Name::new(context.graph().names(), StringId::from("Foo"), ParentScope::None, None).id()),
1548
1582
  )
1549
1583
  .id();
1550
1584
  assert_declaration_completion_eq!(
@@ -2076,7 +2110,7 @@ mod tests {
2076
2110
  );
2077
2111
  context.resolve();
2078
2112
 
2079
- let name_id = Name::new(StringId::from("Foo"), ParentScope::None, None).id();
2113
+ let name_id = Name::new(context.graph().names(), StringId::from("Foo"), ParentScope::None, None).id();
2080
2114
  assert_declaration_completion_eq!(
2081
2115
  context,
2082
2116
  CompletionReceiver::MethodArgument {
@@ -2117,7 +2151,7 @@ mod tests {
2117
2151
  );
2118
2152
  context.resolve();
2119
2153
 
2120
- let name_id = Name::new(StringId::from("Foo"), ParentScope::None, None).id();
2154
+ let name_id = Name::new(context.graph().names(), StringId::from("Foo"), ParentScope::None, None).id();
2121
2155
  assert_declaration_completion_eq!(
2122
2156
  context,
2123
2157
  CompletionReceiver::MethodArgument {
@@ -2154,7 +2188,7 @@ mod tests {
2154
2188
  );
2155
2189
  context.resolve();
2156
2190
 
2157
- let name_id = Name::new(StringId::from("Foo"), ParentScope::None, None).id();
2191
+ let name_id = Name::new(context.graph().names(), StringId::from("Foo"), ParentScope::None, None).id();
2158
2192
  assert_declaration_completion_eq!(
2159
2193
  context,
2160
2194
  CompletionReceiver::MethodArgument {
@@ -2180,7 +2214,7 @@ mod tests {
2180
2214
  );
2181
2215
  context.resolve();
2182
2216
 
2183
- let name_id = Name::new(StringId::from("Foo"), ParentScope::None, None).id();
2217
+ let name_id = Name::new(context.graph().names(), StringId::from("Foo"), ParentScope::None, None).id();
2184
2218
  assert_declaration_completion_eq!(
2185
2219
  context,
2186
2220
  CompletionReceiver::MethodArgument {
@@ -2224,7 +2258,7 @@ mod tests {
2224
2258
  );
2225
2259
  context.resolve();
2226
2260
 
2227
- let name_id = Name::new(StringId::from("Foo"), ParentScope::None, None).id();
2261
+ let name_id = Name::new(context.graph().names(), StringId::from("Foo"), ParentScope::None, None).id();
2228
2262
  assert_declaration_completion_eq!(
2229
2263
  context,
2230
2264
  CompletionReceiver::MethodArgument {
@@ -2252,7 +2286,7 @@ mod tests {
2252
2286
  context.index_uri("file:///foo.rb", "class Foo; end");
2253
2287
  context.resolve();
2254
2288
 
2255
- let name_id = Name::new(StringId::from("Foo"), ParentScope::None, None).id();
2289
+ let name_id = Name::new(context.graph().names(), StringId::from("Foo"), ParentScope::None, None).id();
2256
2290
  assert_completion_eq!(
2257
2291
  context,
2258
2292
  CompletionReceiver::Expression {
@@ -2317,7 +2351,7 @@ mod tests {
2317
2351
  context.index_uri("file:///foo.rb", "class Foo; def bar(name:); end; end");
2318
2352
  context.resolve();
2319
2353
 
2320
- let name_id = Name::new(StringId::from("Foo"), ParentScope::None, None).id();
2354
+ let name_id = Name::new(context.graph().names(), StringId::from("Foo"), ParentScope::None, None).id();
2321
2355
  assert_completion_eq!(
2322
2356
  context,
2323
2357
  CompletionReceiver::MethodArgument {
@@ -2438,7 +2472,13 @@ mod tests {
2438
2472
  );
2439
2473
  context.resolve();
2440
2474
 
2441
- let outer_name_id = Name::new(StringId::from("Outer"), ParentScope::None, None).id();
2475
+ let outer_name_id = Name::new(
2476
+ context.graph().names(),
2477
+ StringId::from("Outer"),
2478
+ ParentScope::None,
2479
+ None,
2480
+ )
2481
+ .id();
2442
2482
  assert_declaration_completion_eq!(
2443
2483
  context,
2444
2484
  CompletionReceiver::Expression {
@@ -2477,7 +2517,13 @@ mod tests {
2477
2517
  );
2478
2518
  context.resolve();
2479
2519
 
2480
- let name_id = Name::new(StringId::from("Outer"), ParentScope::None, None).id();
2520
+ let name_id = Name::new(
2521
+ context.graph().names(),
2522
+ StringId::from("Outer"),
2523
+ ParentScope::None,
2524
+ None,
2525
+ )
2526
+ .id();
2481
2527
  // `self_decl_id` points to the alias `Outer::MyAlias`, which is a `ConstantAlias` rather than a `Namespace`.
2482
2528
  // The completion should still collect members from the aliased namespace (`Outer::Original`) instead of
2483
2529
  // returning an error, so callers do not have to unwrap aliases themselves.
@@ -2523,7 +2569,7 @@ mod tests {
2523
2569
  );
2524
2570
  context.resolve();
2525
2571
 
2526
- let name_id = Name::new(StringId::from("Bar"), ParentScope::None, None).id();
2572
+ let name_id = Name::new(context.graph().names(), StringId::from("Bar"), ParentScope::None, None).id();
2527
2573
  assert_declaration_completion_eq!(
2528
2574
  context,
2529
2575
  CompletionReceiver::Expression {
@@ -2566,7 +2612,7 @@ mod tests {
2566
2612
  );
2567
2613
  context.resolve();
2568
2614
 
2569
- let name_id = Name::new(StringId::from("Bar"), ParentScope::None, None).id();
2615
+ let name_id = Name::new(context.graph().names(), StringId::from("Bar"), ParentScope::None, None).id();
2570
2616
  assert_declaration_completion_eq!(
2571
2617
  context,
2572
2618
  CompletionReceiver::Expression {
@@ -2611,7 +2657,7 @@ mod tests {
2611
2657
  );
2612
2658
  context.resolve();
2613
2659
 
2614
- let name_id = Name::new(StringId::from("Bar"), ParentScope::None, None).id();
2660
+ let name_id = Name::new(context.graph().names(), StringId::from("Bar"), ParentScope::None, None).id();
2615
2661
  assert_declaration_completion_eq!(
2616
2662
  context,
2617
2663
  CompletionReceiver::Expression {
@@ -2648,7 +2694,13 @@ mod tests {
2648
2694
  );
2649
2695
  context.resolve();
2650
2696
 
2651
- let name_id = Name::new(StringId::from("Object"), ParentScope::None, None).id();
2697
+ let name_id = Name::new(
2698
+ context.graph().names(),
2699
+ StringId::from("Object"),
2700
+ ParentScope::None,
2701
+ None,
2702
+ )
2703
+ .id();
2652
2704
  assert_declaration_completion_eq!(
2653
2705
  context,
2654
2706
  CompletionReceiver::Expression {
@@ -2675,7 +2727,7 @@ mod tests {
2675
2727
  );
2676
2728
  context.resolve();
2677
2729
 
2678
- let name_id = Name::new(StringId::from("Mod"), ParentScope::None, None).id();
2730
+ let name_id = Name::new(context.graph().names(), StringId::from("Mod"), ParentScope::None, None).id();
2679
2731
  assert_declaration_completion_eq!(
2680
2732
  context,
2681
2733
  CompletionReceiver::Expression {
@@ -2713,7 +2765,7 @@ mod tests {
2713
2765
  );
2714
2766
  context.resolve();
2715
2767
 
2716
- let name_id = Name::new(StringId::from("Mod"), ParentScope::None, None).id();
2768
+ let name_id = Name::new(context.graph().names(), StringId::from("Mod"), ParentScope::None, None).id();
2717
2769
  assert_declaration_completion_eq!(
2718
2770
  context,
2719
2771
  CompletionReceiver::Expression {
@@ -2748,7 +2800,13 @@ mod tests {
2748
2800
  );
2749
2801
  context.resolve();
2750
2802
 
2751
- let name_id = Name::new(StringId::from("Object"), ParentScope::None, None).id();
2803
+ let name_id = Name::new(
2804
+ context.graph().names(),
2805
+ StringId::from("Object"),
2806
+ ParentScope::None,
2807
+ None,
2808
+ )
2809
+ .id();
2752
2810
  assert_declaration_completion_eq!(
2753
2811
  context,
2754
2812
  CompletionReceiver::Expression {
@@ -2783,7 +2841,7 @@ mod tests {
2783
2841
  );
2784
2842
  context.resolve();
2785
2843
 
2786
- let name_id = Name::new(StringId::from("Bar"), ParentScope::None, None).id();
2844
+ let name_id = Name::new(context.graph().names(), StringId::from("Bar"), ParentScope::None, None).id();
2787
2845
  assert_declaration_completion_eq!(
2788
2846
  context,
2789
2847
  CompletionReceiver::Expression {
@@ -2816,9 +2874,21 @@ mod tests {
2816
2874
  );
2817
2875
  context.resolve();
2818
2876
 
2819
- let bar_id = Name::new(StringId::from("Bar"), ParentScope::None, None).id();
2820
- let foo_ref_id = Name::new(StringId::from("Foo"), ParentScope::None, Some(bar_id)).id();
2821
- let nesting_name_id = Name::new(StringId::from("<Foo>"), ParentScope::Attached(foo_ref_id), Some(bar_id)).id();
2877
+ let bar_id = Name::new(context.graph().names(), StringId::from("Bar"), ParentScope::None, None).id();
2878
+ let foo_ref_id = Name::new(
2879
+ context.graph().names(),
2880
+ StringId::from("Foo"),
2881
+ ParentScope::None,
2882
+ Some(bar_id),
2883
+ )
2884
+ .id();
2885
+ let nesting_name_id = Name::new(
2886
+ context.graph().names(),
2887
+ StringId::from("<Foo>"),
2888
+ ParentScope::Attached(foo_ref_id),
2889
+ Some(bar_id),
2890
+ )
2891
+ .id();
2822
2892
 
2823
2893
  assert_declaration_completion_eq!(
2824
2894
  context,
@@ -2857,7 +2927,7 @@ mod tests {
2857
2927
  );
2858
2928
  context.resolve();
2859
2929
 
2860
- let name_id = Name::new(StringId::from("Mod"), ParentScope::None, None).id();
2930
+ let name_id = Name::new(context.graph().names(), StringId::from("Mod"), ParentScope::None, None).id();
2861
2931
  assert_declaration_completion_eq!(
2862
2932
  context,
2863
2933
  CompletionReceiver::Expression {
@@ -2895,8 +2965,14 @@ mod tests {
2895
2965
  );
2896
2966
  context.resolve();
2897
2967
 
2898
- let foo_ref_id = Name::new(StringId::from("Foo"), ParentScope::None, None).id();
2899
- let nesting_name_id = Name::new(StringId::from("<Foo>"), ParentScope::Attached(foo_ref_id), None).id();
2968
+ let foo_ref_id = Name::new(context.graph().names(), StringId::from("Foo"), ParentScope::None, None).id();
2969
+ let nesting_name_id = Name::new(
2970
+ context.graph().names(),
2971
+ StringId::from("<Foo>"),
2972
+ ParentScope::Attached(foo_ref_id),
2973
+ None,
2974
+ )
2975
+ .id();
2900
2976
 
2901
2977
  assert_declaration_completion_eq!(
2902
2978
  context,
@@ -2921,7 +2997,7 @@ mod tests {
2921
2997
  );
2922
2998
  context.resolve();
2923
2999
 
2924
- let name_id = Name::new(StringId::from("Foo"), ParentScope::None, None).id();
3000
+ let name_id = Name::new(context.graph().names(), StringId::from("Foo"), ParentScope::None, None).id();
2925
3001
  let result = completion_candidates(
2926
3002
  context.graph(),
2927
3003
  CompletionContext::new(CompletionReceiver::Expression {
@@ -2947,7 +3023,7 @@ mod tests {
2947
3023
  );
2948
3024
  context.resolve();
2949
3025
 
2950
- let name_id = Name::new(StringId::from("Foo"), ParentScope::None, None).id();
3026
+ let name_id = Name::new(context.graph().names(), StringId::from("Foo"), ParentScope::None, None).id();
2951
3027
  let result = completion_candidates(
2952
3028
  context.graph(),
2953
3029
  CompletionContext::new(CompletionReceiver::Expression {
@@ -2979,7 +3055,13 @@ mod tests {
2979
3055
  );
2980
3056
  context.resolve();
2981
3057
 
2982
- let name_id = Name::new(StringId::from("Outer"), ParentScope::None, None).id();
3058
+ let name_id = Name::new(
3059
+ context.graph().names(),
3060
+ StringId::from("Outer"),
3061
+ ParentScope::None,
3062
+ None,
3063
+ )
3064
+ .id();
2983
3065
  assert_declaration_completion_eq!(
2984
3066
  context,
2985
3067
  CompletionReceiver::Expression {
@@ -3022,7 +3104,7 @@ mod tests {
3022
3104
  );
3023
3105
  context.resolve();
3024
3106
 
3025
- let name_id = Name::new(StringId::from("Bar"), ParentScope::None, None).id();
3107
+ let name_id = Name::new(context.graph().names(), StringId::from("Bar"), ParentScope::None, None).id();
3026
3108
  assert_declaration_completion_eq!(
3027
3109
  context,
3028
3110
  CompletionReceiver::Expression {
@@ -3095,7 +3177,7 @@ mod tests {
3095
3177
  );
3096
3178
  context.resolve();
3097
3179
 
3098
- let foo_name_id = Name::new(StringId::from("Foo"), ParentScope::None, None).id();
3180
+ let foo_name_id = Name::new(context.graph().names(), StringId::from("Foo"), ParentScope::None, None).id();
3099
3181
  assert_declaration_completion_eq!(
3100
3182
  context,
3101
3183
  CompletionReceiver::Expression {
@@ -3115,7 +3197,7 @@ mod tests {
3115
3197
  ]
3116
3198
  );
3117
3199
 
3118
- let bar_name_id = Name::new(StringId::from("Bar"), ParentScope::None, None).id();
3200
+ let bar_name_id = Name::new(context.graph().names(), StringId::from("Bar"), ParentScope::None, None).id();
3119
3201
  assert_declaration_completion_eq!(
3120
3202
  context,
3121
3203
  CompletionReceiver::Expression {
@@ -3431,7 +3513,7 @@ mod tests {
3431
3513
  );
3432
3514
  context.resolve();
3433
3515
 
3434
- let foo_name_id = Name::new(StringId::from("Foo"), ParentScope::None, None).id();
3516
+ let foo_name_id = Name::new(context.graph().names(), StringId::from("Foo"), ParentScope::None, None).id();
3435
3517
  assert_declaration_completion_eq!(
3436
3518
  context,
3437
3519
  CompletionReceiver::Expression {