Skip to content

Commit

Permalink
fix: Make vscode VSBuffer return monaco instances
Browse files Browse the repository at this point in the history
  • Loading branch information
CGNonofr committed Jul 19, 2022
1 parent 5b244ca commit 617c3bc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/polyfill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ function toMonacoVSBuffer (value: unknown) {

for (const key of Object.getOwnPropertyNames(VScodeVSBuffer)) {
if (!Object.hasOwnProperty.call(MonacoVSBuffer, key)) {
MonacoVSBuffer[key] = function (...args: any[]) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return toMonacoVSBuffer((VScodeVSBuffer as any)[key].call(MonacoVSBuffer, ...args.map(toVSCodeVSBuffer)))
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const method = (VScodeVSBuffer as any)[key];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(VScodeVSBuffer as any)[key] = MonacoVSBuffer[key] = function (...args: any[]) {
return toMonacoVSBuffer(method.call(MonacoVSBuffer, ...args.map(toVSCodeVSBuffer)))
}
}
}
Expand Down

0 comments on commit 617c3bc

Please sign in to comment.