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

[preferences] use text models to update content #7110

Merged
merged 3 commits into from
Feb 12, 2020

Conversation

akosyakov
Copy link
Member

@akosyakov akosyakov commented Feb 9, 2020

What it does

How to test

  • over 800 vscode compatibility preference tests are migrated to be integration tests
  • (theming) test that changing themes does not lead to the conflict dialog anymore
  • (vscode) use gitlens welcome screen to change different configuration and check that it does not lead to the conflict dialog anymore
  • test 2 above steps with dirty editor on and off
  • modify preferences and test that only saved preferences are applied
  • check that formatting is respected when preference values are changed
  • check that files with jsonc language are properly colored on first load and on reload with preserved editor

Review checklist

Reminder for reviewers

@akosyakov akosyakov self-assigned this Feb 9, 2020
@akosyakov akosyakov added monaco issues related to monaco preferences issues related to preferences vscode issues related to VSCode compatibility labels Feb 9, 2020
@akosyakov akosyakov force-pushed the akosyakov/update-of-preferences-6845 branch from debe513 to 1b80e5f Compare February 10, 2020 12:06
@akosyakov
Copy link
Member Author

@vince-fugnitto Could you check please whether you can reproduce the file conflict dialog while switching themes?

@vince-fugnitto
Copy link
Member

@vince-fugnitto Could you check please whether you can reproduce the file conflict dialog while switching themes?

Sure, I'll verify if we still get the dialog when switching themes 👍

@vince-fugnitto
Copy link
Member

@vince-fugnitto Could you check please whether you can reproduce the file conflict dialog while switching themes?

Sure, I'll verify if we still get the dialog when switching themes

I was unable to reproduce the problem 👍 It looks good to me in that regard :)

@akosyakov akosyakov force-pushed the akosyakov/update-of-preferences-6845 branch 3 times, most recently from b5a5893 to 337f1a2 Compare February 10, 2020 17:08
@akosyakov akosyakov changed the title WIP [preferences] use text models to update content [preferences] use text models to update content Feb 10, 2020
@akosyakov
Copy link
Member Author

Still struggling to get fs events right, but the rest should be ready for the review.

@akosyakov
Copy link
Member Author

Oh, now jsonc files don't have coloring, because language is contributed by @theia/preferences extension and it is not tracked, so grammars get ignored. It is the similar cause as for #7112 (comment)

@akosyakov
Copy link
Member Author

@vince-fugnitto Could someone try it? I need it to continue working on git and gitlens extensions support in #6921

@spoenemann
Copy link
Contributor

(vscode) use gitlens welcome screen to change different configuration and check that it does not lead to the conflict dialog anymore

How to test that?

Everything else works as described for me 👍

Copy link
Contributor

@AlexTugarev AlexTugarev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to test the changes now.

  • json coloring
  • ipynb loading
  • preferences in general
  • monaco workspace edits

@akosyakov
Copy link
Member Author

@spoenemann that's a bit involving :) You need:

  • to uninstall @theia/git extension and rebuild the browser example app
  • install built-in git extension by uploading vsix file (https://github.com/theia-ide/vscode-builtin-extensions/releases/download/v1.39.1-prel/git-1.39.1-prel.vsix) into plugins folder
  • install gitlens vscode extension the same way
  • then you start Theia in Gitpod pass --hostname 0.0.0.0 to let webviews work
  • you should see welcome gitlens webview if not use command Gitlens: Welcome
  • then try to change configurations in this webview, you should not get any conflict dialogs and then see that preferences are actually applied in the preferences view

@AlexTugarev
Copy link
Contributor

@akosyakov when saving changes in preference editor I see:

bundle.js:134921 root ERROR onWillSave listeners should provide edits, not directly alter the document.

@akosyakov
Copy link
Member Author

bundle.js:134921 root ERROR onWillSave listeners should provide edits, not directly alter the document.

@AlexTugarev it is expected, it does not break save control flow, we just notify that there some save participants which don't provide edits, but mutate documents, the same on master

@AlexTugarev
Copy link
Contributor

2020-02-12 10 19 19

The alert is shown twice.

@akosyakov
Copy link
Member Author

akosyakov commented Feb 12, 2020

The alert is shown twice.

@AlexTugarev It is another issue with the preference widget. I did not intend to fix it. I guess it is because workspace and use preference files are changed.

Copy link
Contributor

@AlexTugarev AlexTugarev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked that preferences are working fine, and save actions in editors are ok. It's good to see the color-theme-changes are reflected nicely 👍
Well done!

@akosyakov
Copy link
Member Author

@spoenemann @AlexTugarev thanks for testing and thorough review, i will apply discussed changes and merge if the build is green

Copy link
Contributor

@RomanNikitenko RomanNikitenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked that my use case was fixed, also I tried to modify the user preferences - I don't see any errors

@akosyakov akosyakov force-pushed the akosyakov/update-of-preferences-6845 branch from 17792f8 to 2b039bf Compare February 12, 2020 10:42
@vince-fugnitto
Copy link
Member

2020-02-12 10 19 19

The alert is shown twice.

@AlexTugarev the issue is a pre-existing problem with the preferences: #2780

@akosyakov akosyakov force-pushed the akosyakov/update-of-preferences-6845 branch from 73bebf2 to a8da83d Compare February 12, 2020 13:30
It resolve following issues:
- dirty editors are respected
- edits are applied in thread safe fashion

Signed-off-by: Anton Kosyakov <[email protected]>
Before we will activate grammars for all languages which is bogus since grammar is not necessary registered yet. Now we will trigger grammar activation only if it was registered.

Signed-off-by: Anton Kosyakov <[email protected]>
@akosyakov akosyakov force-pushed the akosyakov/update-of-preferences-6845 branch from a8da83d to 00535be Compare February 12, 2020 13:50
} catch {
return undefined;
let preferences;
if (model.valid) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexTugarev since we don't reset model to empty value when resource is gone, i have to add such guard here that preferences don't get created from invalid model

@akosyakov
Copy link
Member Author

ok, it looks good now, merging, if we have some tests instabilities because of fs event reporting, i will look into it as my top priority

@akosyakov akosyakov merged commit e1ec660 into master Feb 12, 2020
@akosyakov akosyakov deleted the akosyakov/update-of-preferences-6845 branch February 12, 2020 14:23
@akosyakov
Copy link
Member Author

so first build on master hit it 😬 looking into the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
monaco issues related to monaco preferences issues related to preferences vscode issues related to VSCode compatibility
Projects
None yet
5 participants