Merge pull request #4 from CGNonofr/monaco-19

Update to work with latest monaco
pull/5/head
Michael MacFadden 4 years ago committed by GitHub
commit 705b55b117
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2599
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -30,7 +30,7 @@
"access": "public"
},
"dependencies": {
"monaco-editor": "^0.15.6"
"monaco-editor": ">=0.15.6 <=0.20.x"
},
"devDependencies": {
"@babel/cli": "7.2.3",

@ -12,6 +12,21 @@ import {EditorContentManager} from "./EditorContentManager";
import {OnDisposed} from "./OnDisposed";
import {Validation} from "./Validation";
interface Configuration {
readonly lineHeight: number;
}
function getConfiguration(editorInstance: editor.ICodeEditor): Configuration {
// Support for Monaco < 0.19.0
if (typeof (editorInstance as any).getConfiguration === 'function') {
return (editorInstance as any).getConfiguration()
}
return {
lineHeight: editorInstance.getOption(editor.EditorOption.lineHeight)
};
}
/**
* This class implements a Monaco Content Widget to render a remote user's
* cursor, and an optional tooltip.
@ -47,7 +62,7 @@ export class RemoteCursorWidget implements editor.IContentWidget, IDisposable {
this._onDisposed = onDisposed;
// Create the main node for the cursor element.
const {lineHeight} = this._editor.getConfiguration();
const {lineHeight} = getConfiguration(this._editor);
this._domNode = document.createElement("div");
this._domNode.className = "monaco-remote-cursor";
this._domNode.style.background = color;

Loading…
Cancel
Save