-
Notifications
You must be signed in to change notification settings - Fork 928
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
Can't invoke non-build level keys #2707
Comments
Yea, I'm getting this too using 0.13.13-SNAPSHOT:
|
So we should exclude build-level keys when there's a key that's scoped to project level? |
Yeah project level should trump build-level. The original PR was just to add them to completion, but they shouldn't compete at the same priority. |
What would be the correct behaviour then? How about (for https://github.com/sbt/sbt/blob/0.13/main/src/main/scala/sbt/Act.scala#L79-L84):
|
yep, sounds good. |
PR sbt#2469 added build keys to tab completion, with the side effect of considering as available candidate in key selection, thus making sbt think that some inputs were ambiguous (e.g. `baseDirectory`): should it apply to the current project or to the build level key? This commit fixes this issue by improving the key selection: - If there's no candidate, we return the default key - If there's a single possible project level key, and zero or more build level keys, then we select the project level key. - If there are zero project level key, and a single build level key, then we select the build level key - If there are multiple candidates, sbt says that the input is ambiguous. Fixes sbt#2707
Fixes sbt#2460 Fixes sbt#2851 Ref sbt#2707, sbt#2708, sbt#2469 Unlike the previous attempts at fixing the handling of build-level keys, this change does not change the main parsing logic, which uses `getKey` to retrieve the key from the key map. The fact that shell worked pre-0.13.11 means that the parsing was ok. What this changes is just the "example" keys supplied to the parser so the tab completion works.
Fixes sbt#2460 Fixes sbt#2851 Ref sbt#2707, sbt#2708, sbt#2469 Unlike the previous attempts at fixing the handling of build-level keys, this change does not change the main parsing logic, which uses `getKey` to retrieve the key from the key map. The fact that shell worked pre-0.13.11 means that the parsing was ok. What this changes is just the "example" keys supplied to the parser so the tab completion works.
Fixes sbt#2460 Fixes sbt#2851 Ref sbt#2707, sbt#2708, sbt#2469 Unlike the previous attempts at fixing the handling of build-level keys, this change does not change the main parsing logic, which uses `getKey` to retrieve the key from the key map. The fact that shell worked pre-0.13.11 means that the parsing was ok. What this changes is just the "example" keys supplied to the parser so the tab completion works.
steps
problem
sbt suggests a key that doesn't work.
expectation
show *:baseDirectory
should show the base directory.notes
This is broken as of 0.13.12 and works in 0.13.11, so I have a feeling it might be due to #2469. /cc @Duhemm
The text was updated successfully, but these errors were encountered: