-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Resolves #57507 - Allows clicking of Modified In labels in setting editor view #60045
Conversation
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 is great! My comments:
- Only the scope name should be underlined, like "Also modified in:
__User__
" - Instead of putting the display name in the search bar, put the setting key (
files.autoSave
) there. Then only that one setting will be displayed.
🤦♂️ That makes way more sense than just assuming the first item in the array |
645f626
to
1251cfd
Compare
DOM.addStandardDisposableListener(view, DOM.EventType.CLICK, (e: IMouseEvent) => { | ||
this._onDidClickOverrideElement.fire({ | ||
targetKey: element.setting.key, | ||
scope: element.overriddenScopeList[i] |
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.
Won't this always reference the last item in the list, because it will point to i
in the closure scope, which is always incremented to the length of the list?
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.
Huh, that is a fantastic point, let me test it really quick.
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, testing locally seems to indicate that when it creates the listener and anonymous function is retains the state of the scoped variable. When I manually pushed in a second option it properly used the correct index on click.
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.
You're right - seems that this works with let
but does not work with var
. I can't drop the old school habits.
template.otherOverridesElement.textContent = `(${otherOverridesLabel}: ${element.overriddenScopeList.join(', ')})`; | ||
} else { | ||
template.otherOverridesElement.textContent = ''; | ||
DOM.append(template.otherOverridesElement, $('span', null, `${otherOverridesLabel}: `)); |
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 keep the ()
around the text?
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.
Definitely! I'll add it now.
1251cfd
to
30fbbd7
Compare
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.
Looks great, thanks!
Exposed target changing in the action bar, and moved the
Modified In
label to a link. This should properly switch between views and automatically filter the list based on category and label name.