Skip to content
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

Language filter initial draft #145080

Merged
merged 9 commits into from
Mar 18, 2022
Merged

Language filter initial draft #145080

merged 9 commits into from
Mar 18, 2022

Conversation

rzhao271
Copy link
Contributor

@rzhao271 rzhao271 commented Mar 14, 2022

Ref #131707

Summary

This PR adds an initial draft of the language filter:

  • @lang: is suggested in the search widget
  • @lang:langId shows all language-overridable settings, but the values shown correspond to either the default setting value, or the language-specific setting value. TODO: determine whether we are showing/can show the language-specific overridden default value whenever it shows up.
  • When a language filter has multiple languages set, we only read the first one for now to determine which language to filter by
  • When a setting is modified while a language filter is set, the setting is modified as a language-specific setting value for the given language
  • When a setting is modified while a language filter is set (even when outside of the workspace scope), the setting remains in the Settings editor JSON file until the user explicitly resets it. This change makes it easier to debug the feature, but I'm not sure how necessary it is.

Demo

Language filter demo screencap

@rzhao271 rzhao271 self-assigned this Mar 14, 2022
@rzhao271 rzhao271 added this to the March 2022 milestone Mar 14, 2022
@roblourens
Copy link
Member

It would be helpful if I could get suggestions for language IDs after typing @lang:. I can't necessarily remember whether what the ID of a langage is, and I get this in settings.json.

Also, if I use a language ID that doesn't exist, I still get results, and can't tell that anything is wrong.

@roblourens
Copy link
Member

I have one setting in a [html] block. When I enter @lang:html @modified, I see 27 modified settings. I actually don't know what all of these are?

We add a link for language filters in complex renderers,
so that for settings such as [css], users can click on the
setting link to be redirected to the language filter view.

In the language filter view, we show all language overridable
settings. In turn, the language filter acts more like a scope
filter rather than a modified/configured settings filter.

When a user edits a setting in that view, the edit applies to the
given scope (tab) that the user is in, as well as the language
they are currently filtering by.
With this change, we explicitly make it so that only the first
language filter given is used.
@rzhao271 rzhao271 force-pushed the rzhao271/lang-filter-showall branch from f1f84b8 to 7d6f6f7 Compare March 17, 2022 18:53
@rzhao271
Copy link
Contributor Author

rzhao271 commented Mar 17, 2022

There were a few bugs with deciding what to render when that I fixed above.
I plan on waiting for the CI build, and then building an Insiders that you can test with, first @roblourens.

@rzhao271
Copy link
Contributor Author

Fixed another bug with the @modified tag.
I also added a constant to make it so that it's easier to enable or disable this feature, in case testing doesn't go well.

@rzhao271 rzhao271 merged commit c0e1e59 into main Mar 18, 2022
@rzhao271 rzhao271 deleted the rzhao271/lang-filter-showall branch March 18, 2022 20:56
@github-actions github-actions bot locked and limited conversation to collaborators May 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants