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

feat(smartAutocomplete): View data update on file change #103

Merged

Conversation

@hiaux0
Copy link
Contributor

hiaux0 commented Aug 12, 2019

After Webview adaption, the Webview did not update on file change.
This PR fixes that.

au-ext-webview-update-on-file-change

@hiaux0 hiaux0 changed the title Fix/aurelia view data update on file change v2 View data update on file change [SmartAutocomplete] Aug 12, 2019
@@ -119,5 +119,6 @@

public update(uri: vscode.Uri) {
this._onDidChange.fire(uri);
return this.provideTextDocumentContent(uri);

This comment has been minimized.

Copy link
@hiaux0

hiaux0 Aug 12, 2019

Author Contributor

Need to return content for webview

provider.update(previewUri);
}
vscode.window.onDidChangeActiveTextEditor((editor: vscode.TextEditor) => {
setTimeout(() => {

This comment has been minimized.

Copy link
@hiaux0

hiaux0 Aug 12, 2019

Author Contributor

setTimeout, because onDidChangeActiveTextEditor is called before panel.onDidDispose

I could not solve it another way atm.

if (e.textEditor === vscode.window.activeTextEditor) {
provider.update(previewUri);
}
vscode.window.onDidChangeActiveTextEditor((editor: vscode.TextEditor) => {

This comment has been minimized.

Copy link
@hiaux0

hiaux0 Aug 12, 2019

Author Contributor

Changed onDidChangeTextEditorSelection to onDidChangeActiveTextEditor.

Looking at this again after a while, seems like the intent behind onDidChangeTextEditorSelection was to update the webview after changes as well.
I might revert this change

@hiaux0 hiaux0 changed the title View data update on file change [SmartAutocomplete] feat(smartAutocomplete): View data update on file change Aug 13, 2019
@eriklieben eriklieben self-requested a review Aug 15, 2019
@eriklieben

This comment has been minimized.

Copy link
Member

eriklieben commented Aug 15, 2019

Perfect! If you merge master into your branch then the build should work again. (I don't think I can do that, but let me know if I can :-))

hiaux0 added 2 commits Jul 21, 2019
With the new WebView Api, seems like we have to manually update the
WebView's html
@hiaux0 hiaux0 force-pushed the hiaux0:fix/aureliaViewData-update-on-file-change-v2 branch from 308b420 to 7b23ba4 Aug 16, 2019
@eriklieben eriklieben merged commit 26dcb05 into aurelia:master Aug 17, 2019
5 checks passed
5 checks passed
WIP Ready for review
Details
build_and_test Workflow: build_and_test
Details
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: test Your tests passed on CircleCI!
Details
license/cla Contributor License Agreement is signed.
Details
@bigopon

This comment has been minimized.

Copy link
Member

bigopon commented Aug 18, 2019

@hiaux0 nice work 👍

@hiaux0 hiaux0 deleted the hiaux0:fix/aureliaViewData-update-on-file-change-v2 branch Oct 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.