Open Wilfred opened 7 years ago
I'm not sure how racer
would decide which cfg
item to return, especially in the case of feature flags or other things.
I'm not convinced find-definition shouldn't return "duplicate" definitions, at least by default. They are both real definitions for that identifier.
Perhaps there should be an option for looking into cfg
? Big question then is where cfg
definitions would come from. Compiler knows some of them; others are derived based on flags, Cargo.toml, etc. One option is to not have Racer attempt to figure out such definitions but instead provide such a table up-front.
Reasonable points. Since we're trying to complete rather than find a definition in this example, it's not useful having duplicates offered. We might just filter duplicates before showing the list to the user.
I agree that looking at cfg
would be desirable in an ideal world :)
Hmm, deduping for completions seems reasonable.
PR #778 deliberately doesn't handle this case, since the two occur at different points and therefore may have different doc strings.
Given the code:
Racer gives:
Ideally racer would not offer both of these.