-
Notifications
You must be signed in to change notification settings - Fork 323
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
Small boolean widget tweaks #8994
Conversation
return entry.reexportedIn | ||
? unqualifiedImport(entry.reexportedIn) | ||
: entry.memberOf | ||
? unqualifiedImport(entry.memberOf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not sure this particular line is correct. IIRC, memberOf would be the module in which the type is defined, so from Module import Constructor
will probably be invalid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, memberOf is type on which it's defined. The module where the entity is defined is actually definedIn
field.
@@ -136,11 +139,21 @@ watch(selectedIndex, (_index) => { | |||
</script> | |||
|
|||
<script lang="ts"> | |||
function hasBooleanTagValues(parameter: SuggestionEntryArgument): boolean { | |||
if (parameter.tagValues == null) return false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole function could be made simpler by creating some sorts of arrayEquals
utility and using it here.
export const widgetDefinition = defineWidget(WidgetInput.isAstOrPlaceholder, { | ||
priority: 50, | ||
score: (props) => { | ||
if (props.input.dynamicConfig?.kind === 'Single_Choice') return Score.Perfect | ||
if (props.input[ArgumentInfoKey]?.info?.tagValues != null) return Score.Perfect | ||
// Boolean arguments also have tag values, but the checkbox widget should handle them. | ||
if (props.input[ArgumentInfoKey]?.info?.tagValues != null && !hasBooleanTagValues) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the hasBooleanTagValues
function is not actually called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we enable some lint for checking it?
…/boolean-widget-tweaks
Pull Request Description
Fixes #8962
Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
./run ide build
.