Repository navigation
Commit d11be54
committed
fix(cs-lsp): resolve nested types through type qualifiers, bind global-ns types
Follow-up to DeusData#2347 (issue DeusData#2120). Step 8b binds same-name TOP-LEVEL types
by declared namespace, but two shapes still fell through to the short-name
fallback, where the prefix score against a path-derived QN is 0 for every
variant and registration order decided:
1. A qualified `A.B` whose qualifier A is a TYPE, not a namespace:
`new Command.Result(...)` and `new Grain.Handler(dep).Handle(...)`.
cs_visible_namespaces only tried A as a namespace, and nested types
carry no namespace_qn, so the scan never had a candidate. Resolution
now falls back to resolving the qualifier as a type (recursively, one
segment shorter) and binding the nested member through the registry.
2. A top-level type with NO namespace declaration (global namespace),
e.g. a service consumed via [Inject]: cs_top_level_namespace returned
NULL for it, making it invisible to step 8b even though C# sees the
global namespace from everywhere. Top-level C# types now register
namespace_qn "" and cs_visible_namespaces appends the global
namespace last, per C# lookup order.
Test: parallel_csharp_nested_type_and_global_namespace_binding covers a
nested-type constructor call and the member call on its result, a
chained-constructor receiver `new Grain.Handler(dep).Handle()`, and a
same-name type split across the global namespace and an imported
namespace — in the sequential pipeline and in the parallel pipeline with
the production Tier-2 C# registry. Decoy files are registered first, so
the registry-order behavior fails the test without the fix (verified:
nested_code=0/1 chained=0/1 global_ns=0/0 without it).
Proof on the private repository behind DeusData#2120 (2,735 CALLS edges into
same-name class families, adjudicated against source): mis-bound edges
123 -> 109; the 14 fixed are exactly the chained-constructor receivers.
The remaining 109 route through other layers, not type-name resolution:
~90 constructor edges whose cs_ctor row loses the pass_calls carrier
join to the textual suffix fallback, a few `X x = new(...)`
target-typed implicit constructions, and 3 [Inject] field-type
resolutions that run in the registration context without file usings.
Full suite: 8176 passed, 1 failed, 8 skipped; the failure
(tests/test_cli.c:2080) is a CLI/environment test unaffected by this
diff (the cli suite also fails to complete in this environment without
the patch).
Signed-off-by: Ersin Tarhan <[email protected]>1 parent 2986050 commit d11be54
2 files changed
Lines changed: 208 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
386 | 391 | | |
387 | 392 | | |
388 | 393 | | |
| |||
421 | 426 | | |
422 | 427 | | |
423 | 428 | | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
424 | 443 | | |
425 | 444 | | |
426 | 445 | | |
| |||
2304 | 2323 | | |
2305 | 2324 | | |
2306 | 2325 | | |
2307 | | - | |
| 2326 | + | |
| 2327 | + | |
2308 | 2328 | | |
| 2329 | + | |
2309 | 2330 | | |
2310 | 2331 | | |
2311 | 2332 | | |
2312 | 2333 | | |
2313 | 2334 | | |
2314 | 2335 | | |
| 2336 | + | |
| 2337 | + | |
2315 | 2338 | | |
2316 | 2339 | | |
2317 | 2340 | | |
| |||
3749 | 3772 | | |
3750 | 3773 | | |
3751 | 3774 | | |
3752 | | - | |
| 3775 | + | |
3753 | 3776 | | |
3754 | 3777 | | |
3755 | 3778 | | |
3756 | 3779 | | |
3757 | 3780 | | |
3758 | | - | |
| 3781 | + | |
| 3782 | + | |
| 3783 | + | |
| 3784 | + | |
3759 | 3785 | | |
3760 | 3786 | | |
3761 | 3787 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2668 | 2668 | | |
2669 | 2669 | | |
2670 | 2670 | | |
| 2671 | + | |
| 2672 | + | |
| 2673 | + | |
| 2674 | + | |
| 2675 | + | |
| 2676 | + | |
| 2677 | + | |
| 2678 | + | |
| 2679 | + | |
| 2680 | + | |
| 2681 | + | |
| 2682 | + | |
| 2683 | + | |
| 2684 | + | |
| 2685 | + | |
| 2686 | + | |
| 2687 | + | |
| 2688 | + | |
| 2689 | + | |
| 2690 | + | |
| 2691 | + | |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
| 2752 | + | |
| 2753 | + | |
| 2754 | + | |
| 2755 | + | |
| 2756 | + | |
| 2757 | + | |
| 2758 | + | |
| 2759 | + | |
| 2760 | + | |
| 2761 | + | |
| 2762 | + | |
| 2763 | + | |
| 2764 | + | |
| 2765 | + | |
| 2766 | + | |
| 2767 | + | |
| 2768 | + | |
| 2769 | + | |
| 2770 | + | |
| 2771 | + | |
| 2772 | + | |
| 2773 | + | |
| 2774 | + | |
| 2775 | + | |
| 2776 | + | |
| 2777 | + | |
| 2778 | + | |
| 2779 | + | |
| 2780 | + | |
| 2781 | + | |
| 2782 | + | |
| 2783 | + | |
| 2784 | + | |
| 2785 | + | |
| 2786 | + | |
| 2787 | + | |
| 2788 | + | |
| 2789 | + | |
| 2790 | + | |
| 2791 | + | |
| 2792 | + | |
| 2793 | + | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
| 2798 | + | |
| 2799 | + | |
| 2800 | + | |
| 2801 | + | |
| 2802 | + | |
| 2803 | + | |
| 2804 | + | |
| 2805 | + | |
| 2806 | + | |
| 2807 | + | |
| 2808 | + | |
| 2809 | + | |
| 2810 | + | |
| 2811 | + | |
| 2812 | + | |
| 2813 | + | |
| 2814 | + | |
| 2815 | + | |
| 2816 | + | |
| 2817 | + | |
| 2818 | + | |
| 2819 | + | |
| 2820 | + | |
| 2821 | + | |
| 2822 | + | |
| 2823 | + | |
| 2824 | + | |
| 2825 | + | |
| 2826 | + | |
| 2827 | + | |
| 2828 | + | |
| 2829 | + | |
| 2830 | + | |
| 2831 | + | |
| 2832 | + | |
| 2833 | + | |
| 2834 | + | |
| 2835 | + | |
| 2836 | + | |
| 2837 | + | |
| 2838 | + | |
| 2839 | + | |
| 2840 | + | |
| 2841 | + | |
| 2842 | + | |
| 2843 | + | |
| 2844 | + | |
| 2845 | + | |
| 2846 | + | |
| 2847 | + | |
| 2848 | + | |
2671 | 2849 | | |
2672 | 2850 | | |
2673 | 2851 | | |
| |||
4786 | 4964 | | |
4787 | 4965 | | |
4788 | 4966 | | |
| 4967 | + | |
4789 | 4968 | | |
4790 | 4969 | | |
4791 | 4970 | | |
| |||
0 commit comments