Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completion list is missing re-exports from dependencies #2142

Open
minestarks opened this issue Jan 31, 2025 · 0 comments
Open

Completion list is missing re-exports from dependencies #2142

minestarks opened this issue Jan 31, 2025 · 0 comments
Labels

Comments

@minestarks
Copy link
Member

In many cases, the completion list is missing reexports from dependencies, which reduces the usability of libraries such as fixed_point.

REPRO

MyProj/src/Main.qs

namespace Test {
    open MyDep;
    
    operation Foo() : Unit {
        ExportedItem;    // Appears, but with auto-import edit ❌
        ReexportAlias;   // Does not appear ❌
        ReexportedItem;  // Appears, but with auto-import ❌
                         // Also, doesn't compile (#1955) ❌
    }
}

namespace Test2 {
    open SomeNS; // Does not appear ❌
}

namespace Test3 {    
    open MyDep.C.ReexportedNS; // `B` does not appear after `.` ❌
}

namespace Test4 {
    open ParentNS; // Does not appear ❌ 
}

MyProj/qsharp.json

{
  "dependencies": {
    "MyDep": {
      "path": "../MyDep"
    }
  }
}

MyDep/src/Main.qs

namespace SomeNS {
    operation ReexportedItem() : Unit {}
    export ReexportedItem;
}

namespace Main {
    operation ExportedItem() : Unit {}
     
    export ExportedItem, SomeNS.ReexportedItem, SomeNS.ReexportedItem as ReexportAlias;
}

namespace C {
    export ParentNS.ReexportedNS;
}

namespace ParentNS.ReexportedNS {
    operation ABOp() : Unit {}
}

MyDep/qsharp.json

{}

Seen in 3b32013

Additional context

Related: #1955

To capture some historical context -- there was an attempt to cover these cases in the original Completions implementation, but it required quite a few changes to the resolver. Currently, neither the HIR nor the resolver contains enough information about the reexports for the Completions module to include the reexports.

At the time I made some changes to the resolver to address some of the cases from above, but hit blockers on others. So that effort's been abandoned for a few months now.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant