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
[SR-8677] SourceKit: Add module references as indexSource entities #51191
Comments
For module references note that |
Comment by Bruno Rocha (JIRA) @akyrtzi Thanks! I got it to work: {
key.kind: source.lang.swift.ref.module,
key.name: "Swift",
key.line: 7,
key.column: 13
}, Is there anything else I can add to it to make it feel more like an "index"? I thought about providing an USR, but since all USR generation seems to work on top of ValueDecls I wanted to be sure if this is possible in first place. For reference: rockbruno@cde8d3d |
How is this dumped from `swift-ide-test -print-indexed-symbols` ? Checkout test cases in `test/Index` to see how to add a test case for this. I think we also need to define a USR for it. Try opening a PR so we can iterate on it. |
Comment by Bruno Rocha (JIRA) It returns an empty string unfortunately: 1:8 | module/Swift | Swift | | Ref | rel: 0 |
Comment by Bruno Rocha (JIRA) Managed to generate an USR to them. #19243 |
Comment by Bruno Rocha (JIRA) @akyrtzi What do you think? |
Clang has similar need, index module references with an associated USR. That will allow us to index the same module references across Swift and Objective-C, using the same USR. |
Comment by Bruno Rocha (JIRA) Sounds good. |
PR has been merged. |
Additional Detail from JIRA
md5: b9029558b34d4a83016fcd6e2393494f
Issue Description:
Forum pitch: https://forums.swift.org/t/proposal-adding-line-column-to-sourcekits-import-declarations-index/15631
Module references are currently not covered by index requests. We could add them as key.entities entries to allow imports:
and explicit references:
to be recognized and indexed, including line and column positions. Could be useful for syntax highlighting and tools that need to retrieve module information.
The text was updated successfully, but these errors were encountered: