Handle pref display without plugins #9403
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What it does
A bug was discovered by a user of the Yo Theia Extension Generator in which the preference widget was not displaying preferences unless an extension with plugin support was included in the dependencies.
The basic problem was that the
PreferenceTreeGenerator
was waiting for an event from thePreferenceSchemaProvider
before initializing its tree.theia/packages/preferences/src/browser/util/preference-tree-generator.ts
Lines 32 to 35 in a8dec8d
That event is only fired when plugins call the
setSchema
method:theia/packages/core/src/browser/preferences/preference-contribution.ts
Lines 308 to 323 in a8dec8d
Internal preference contributions only call
doSetSchema
, which does not fire any events. I believe this behavior is correct: the schema hasn't changed, but only been initialized.theia/packages/core/src/browser/preferences/preference-contribution.ts
Lines 126 to 128 in a8dec8d
This PR modifies the behavior of the
PreferenceTreeGenerator
to generate a tree when thePreferenceSchemaProvider
isready
(after all internal preference contributions have been processed) without waiting for anonSchemaChanged
event.How to test
package.json
to have only these Theia packages as dependencies:Review checklist
Reminder for reviewers
Signed-off-by: Colin Grant [email protected]