-
-
Notifications
You must be signed in to change notification settings - Fork 175
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
Fix vscode api enum #333
Fix vscode api enum #333
Conversation
@kaisalmen I think this fix is pretty urgent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 import type is a very good idea. Just have a look at my question. Thanks.
@@ -119,6 +119,14 @@ export function createVSCodeApi(servicesProvider: Services.Provider): typeof vsc | |||
} | |||
} | |||
|
|||
enum TextDocumentChangeReason { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question for my understanding: We have to redefine the enum because otherwise vscode api is exposed in the listener?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error was at line reason: isUndoing ? vscode.TextDocumentChangeReason.Undo : isRedoing ? vscode.TextDocumentChangeReason.Redo : undefined
vscode.TextDocumentChangeReason
wasn't defined so it was crashing
I hope I understood your question
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you understood me. Thanks. 👍🙂 Just by looking at the PR without having deep knowledge of the project yet doesn't make the problem directly clear. That's why import type
(did not know it and looked it up) is very helpful here as it immediately makes the issue obvious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 The same way we need to re-implement all vscode.* interfaces, enums in typescript are transpiled into objects, and we need those at runtime
I will merge and release |
you rock! |
Done ✅ |
Great! thank you and my apologies for the bug! btw, any news for the other MR? |
fix for #332