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

Fixed statusbar error when focusing to webview #181

Merged
merged 1 commit into from
Oct 5, 2020

Conversation

martonsagi
Copy link
Contributor

Hi Waldo,

I have seen that your extension is subscribed to vscode.workspace.onDidOpenTextDocument event. This subscription causes errors when there is no active TextEditor.

1. A Webview is focused

First case is no big issue as it happens rarely, but still it should be fixed. :)

2. No open document

Second case, however, can easily become a real performance-killer when another extension decides to read up all AL files via VSCode api, thus emitting onDidOpenTextDocument event like 6000 times for a BaseApp.

vscode_waldoext_error

The fix

My proposed solution would be to move your statusbar update code from workspace.onDidOpenTextDocument to window.onDidChangeActiveTextEditor with some additional error checks to avoid unexpected exceptions.

It would be a big help for me, as AL Studio is currently crashing during activation phase when AL XML Documentation is present, indirectly overloading VSCode by an event subscription in your extension. Simple times indeed :)

Thanks,
Marton

@waldo1001
Copy link
Owner

thank you so much! I will merge these in asap!

@martonsagi
Copy link
Contributor Author

Thank you! In the meantime, I have also added a pull request to AL XML Doc in order to get to the bottom of the root cause as well. :)
365businessdev/vscode-alxmldocumentation#34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants