14
14
width : 100% ;
15
15
}
16
16
</ style >
17
- < style id ="dynamic ">
18
- </ style >
19
- </ head >
20
- < body >
21
17
22
- < div id ="container " onkeydown ="keyDown(event) "> </ div >
23
-
24
- <!--<script src="https://devtoys.local/ts-helpermethods/ts-helpermethods-Windows/asyncCallbackHelpers.js"></script>-->
18
+ < script src ="https://devtoys.local/ts-helpermethods/ts-helpermethods-Windows/asyncCallbackHelpers.js "> </ script >
25
19
< script src ="https://devtoys.local/monaco-editor/min/vs/loader.js "> </ script >
26
- <!--<script src="https://devtoys.local/ts-helpermethods/registerCodeLensProvider.js"></script>
20
+ < script src ="https://devtoys.local/ts-helpermethods/editorContext.js "> </ script >
21
+ < script src ="https://devtoys.local/ts-helpermethods/registerCodeLensProvider.js "> </ script >
27
22
< script src ="https://devtoys.local/ts-helpermethods/registerColorProvider.js "> </ script >
28
23
< script src ="https://devtoys.local/ts-helpermethods/registerCompletionItemProvider.js "> </ script >
29
24
< script src ="https://devtoys.local/ts-helpermethods/otherScriptsToBeOrganized.js "> </ script >
30
- <script src="https://devtoys.local/ts-helpermethods/updateSelectedContent.js"></script>-->
25
+ < script src ="https://devtoys.local/ts-helpermethods/updateSelectedContent.js "> </ script >
26
+ < script src ="https://devtoys.local/ts-helpermethods/monacoInitializer.js "> </ script >
27
+ </ head >
28
+ < body >
29
+
30
+ < div id ="container " onkeydown ="keyDown(event) "> </ div >
31
+
32
+
31
33
32
34
< script >
33
- var editor ;
34
- var model ;
35
- var contexts = { } ;
36
- var decorations = [ ] ;
37
- var modifingSelection = false ; // Supress updates to selection when making edits.
35
+ //createMonacoEditor("https://devtoys.local/", document.getElementById('container'));
36
+ //var editor;
37
+ //var model;
38
+ //var contexts = {};
39
+ //var decorations = [];
40
+ //var modifingSelection = false; // Supress updates to selection when making edits.
38
41
39
- //Debug.log("Starting Monaco Load");
40
- require . config ( { paths : { 'vs' : 'https://devtoys.local/monaco-editor/min/vs' } } ) ;
41
- require ( [ 'vs/editor/editor.main' ] , function ( ) {
42
- // Debug.log("Grabbing Monaco Options");
42
+ //Debug.log("Starting Monaco Load");
43
+ // require.config({ paths: { 'vs': 'https://devtoys.local/monaco-editor/min/vs' } });
44
+ // require(['vs/editor/editor.main'], function () {
45
+ // Debug.log("Grabbing Monaco Options");
43
46
44
- //let opt = getOptions();
45
- //opt["value"] = Parent.getValue("Text");
47
+ // //let opt = getOptions();
48
+ // //opt["value"] = Parent.getValue("Text");
46
49
47
- editor = monaco . editor . create ( document . getElementById ( 'container' ) , null /* opt */ ) ;
48
- model = editor . getModel ( ) ;
50
+ // editor = monaco.editor.create(document.getElementById('container'), null /* opt */);
51
+ // model = editor.getModel();
49
52
50
- //// Listen for Content Changes
51
- //model.onDidChangeContent((event) => {
52
- // Parent.setValue("Text", model.getValue());
53
- // //console.log("buffers: " + JSON.stringify(model._buffer._pieceTree._buffers));
54
- // //console.log("commandMgr: " + JSON.stringify(model._commandManager));
55
- // //console.log("viewState:" + JSON.stringify(editor.saveViewState()));
56
- //});
53
+ // //// Listen for Content Changes
54
+ // //model.onDidChangeContent((event) => {
55
+ // // Parent.setValue("Text", model.getValue());
56
+ // // //console.log("buffers: " + JSON.stringify(model._buffer._pieceTree._buffers));
57
+ // // //console.log("commandMgr: " + JSON.stringify(model._commandManager));
58
+ // // //console.log("viewState:" + JSON.stringify(editor.saveViewState()));
59
+ // // });
57
60
58
- //// Listen for Selection Changes
59
- //editor.onDidChangeCursorSelection((event) => {
60
- // if (!modifingSelection) {
61
- // console.log(event.source);
62
- // Parent.setValue("SelectedText", model.getValueInRange(event.selection));
63
- // Parent.setValue("SelectedRange", JSON.stringify(event.selection), "Selection");
64
- // }
65
- //})
61
+ // //// Listen for Selection Changes
62
+ // //editor.onDidChangeCursorSelection((event) => {
63
+ // // if (!modifingSelection) {
64
+ // // console.log(event.source);
65
+ // // Parent.setValue("SelectedText", model.getValueInRange(event.selection));
66
+ // // Parent.setValue("SelectedRange", JSON.stringify(event.selection), "Selection");
67
+ // // }
68
+ // // })
66
69
67
- //// Set theme
68
- //let theme = Parent.getJsonValue("RequestedTheme");
69
- //theme = {
70
- // "0": "Default",
71
- // "1": "Light",
72
- // "2": "Dark"
73
- //}[theme];
74
- //if (theme == "Default") {
75
- // theme = Theme.currentThemeName.toString();
76
- //}
77
- //changeTheme(theme, Theme.isHighContrast.toString());
70
+ // //// Set theme
71
+ // //let theme = Parent.getJsonValue("RequestedTheme");
72
+ // //theme = {
73
+ // // "0": "Default",
74
+ // // "1": "Light",
75
+ // // "2": "Dark"
76
+ // // }[theme];
77
+ // //if (theme == "Default") {
78
+ // // theme = Theme.currentThemeName.toString();
79
+ // // }
80
+ // //changeTheme(theme, Theme.isHighContrast.toString());
78
81
79
- //// Update Monaco Size when we receive a window resize event
80
- //window.addEventListener("resize", () => {
81
- // editor.layout();
82
- //});
82
+ // //// Update Monaco Size when we receive a window resize event
83
+ // //window.addEventListener("resize", () => {
84
+ // // editor.layout();
85
+ // // });
83
86
84
- // Disable WebView Scrollbar so Monaco Scrollbar can do heavy lifting
85
- document . body . style . overflow = 'hidden' ;
87
+ // // Disable WebView Scrollbar so Monaco Scrollbar can do heavy lifting
88
+ // document.body.style.overflow = 'hidden';
86
89
87
- //// Callback to Parent that we're loaded
88
- // Debug.log("Loaded Monaco");
89
- //Parent.callAction("Loaded");
90
- } ) ;
90
+ // //// Callback to Parent that we're loaded
91
+ // Debug.log("Loaded Monaco");
92
+ // //Parent.callAction("Loaded");
93
+ // });
91
94
</ script >
92
95
</ body >
93
96
</ html >
0 commit comments