-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
refactor: enhance code performance, maintainability and extendibility #847
Conversation
fec8d06
to
d1e29dd
Compare
Hi @ahmed-s-fatahallah thank for this PR. It made me realize the subscriptions for the onDidChangeContent should not be in the react component at all. I opened #849 to correct that. Please fix the linting problems, then we can review the changes. |
You are welcome, I will fix the linting problems as soon as possible. Looking forward for your review |
d1e29dd
to
68f5fe4
Compare
@ahmed-s-fatahallah please rebase your PR. #849 removes the need to deal with subscriptions on the react level, therefore you need to change less code. Sorry for the inconvenience. I will review the changes after the rebase. |
68f5fe4
to
9b3e699
Compare
@kaisalmen Hello Kai, Thanks |
Hi @ahmed-s-fatahallah we already had unit tests that verify onTestChanges and they are still green. Why do you come to that conclusion? I also tested it manually. There is one thing though: If you use the views service (appPlayground and python example (after merge of #842)) the callbacks don't get registered because "vscode" creates the editors depending which resources/uri is opened. |
@kaisalmen Hi there, I apologize, I was using the view service , but I've now switched to the editor service and encountered these console errors: It seems there's a missing service override that I should include. However, I'm having trouble locating this service. Could you please assist me in making the Thank you! |
Hi @ahmed-s-fatahallah I can't tell from the screenshot (there are likely incompatible services loaded). But you can use this example: |
replace the too many
useEffect
anduseCallbacks
with oneuseEffect
to instantiate and update the editor and another effect todispose
the models' Subscriptions when the component unmounts.