You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to build a Typescript/Javascript expression editor (e.g., as the input box for a console/REPL, or for use in various places in a dev tool), where...
a number of variables are provided as part of some existing environment, without being explicitly imported from anywhere.
the expression can be of some expected type, e.g. a particular interface, so you should get completions for members of that interface, as well as type-checking.
I know that (1) can be addressed by addExtraLib, but since there is at most one globally shared instance of Monaco's language services among all editors, this means this may interfere with other edtors, such as those full code files that are open for editing. addExtraLib also doesn't help with (2).
I believe building this would be easy with setHiddenAreas, but I haven't been able to get it to work. See this sandbox—if you keep backspacing from the end to the start, and past the start, you get:
errors.ts:22 Uncaught Error: Not supported
Error: Not supported
at e.getModelColumnOfViewPosition (splitLinesCollection.ts:990)
at e.convertViewPositionToModelPosition (splitLinesCollection.ts:733)
at e.convertViewRangeToModelRange (splitLinesCollection.ts:111)
at t.getValueInRange (viewModelImpl.ts:569)
at Object.getValueInRange (textAreaHandler.ts:163)
at Function.e.fromEditorSelection (textAreaState.ts:251)
at Object.getScreenReaderContent (textAreaHandler.ts:232)
at a.writeScreenReaderContent (textAreaInput.ts:484)
at t.onCursorStateChanged (textAreaHandler.ts:404)
at t.handleEvents (viewEventHandler.ts:103)
at e._doConsumeQueue (viewEventDispatcher.ts:88)
at viewEventDispatcher.ts:71
at H (viewImpl.ts:582)
at t._renderOnce (viewImpl.ts:359)
at e._eventHandlerGateKeeper (viewImpl.ts:111)
at e.consumeQueue (viewEventDispatcher.ts:67)
at e.emitMany (viewEventDispatcher.ts:62)
at viewImpl.ts:142
at viewEvents.ts:394
at t._emit (viewEvents.ts:352)
at t._endEmit (viewEvents.ts:344)
at t._emitStateChangedIfNecessary (cursor.ts:400)
at t.trigger (cursor.ts:538)
at t.executeCommands (codeEditorWidget.ts:1005)
at t.e.DeleteLeft.r.registerEditorCommand.t.runCoreEditingCommand (coreCommands.ts:1634)
at t.runEditorCommand (coreCommands.ts:1542)
at editorExtensions.ts:165
at e.invokeFunction (instantiationService.ts:60)
at t.invokeWithinContext (codeEditorWidget.ts:359)
at t.runCommand (editorExtensions.ts:158)
at handler (editorExtensions.ts:90)
at e.invokeFunction (instantiationService.ts:60)
at e.executeCommand (simpleServices.ts:185)
at t._doDispatch (abstractKeybindingService.ts:173)
at t._dispatch (abstractKeybindingService.ts:132)
at HTMLDivElement.<anonymous> (simpleServices.ts:211)
at errors.ts:22
And various other issues, e.g. select-all and delete causes the cursor to disappear from Monaco. And, of course, it's not part of the supported API (or else this issue would be a bug report).
After digging through past issues, I also came across this suggestion #170 (comment), which says to fork monaco-typescript. Is this still the best approach for what I'm seeking? Are there any examples or guidance as to the changes needed?
The text was updated successfully, but these errors were encountered:
zxti
changed the title
Establishing hidden context around edited code
Establishing hidden context around edited (Typescript/Javascript) code
May 10, 2019
monaco-editor version: 0.17.0
Browser: Chrome 74.0.3729.131
OS: MacOS 10.14.4
Steps or JS usage snippet reproducing the issue:
I'm trying to build a Typescript/Javascript expression editor (e.g., as the input box for a console/REPL, or for use in various places in a dev tool), where...
I know that (1) can be addressed by addExtraLib, but since there is at most one globally shared instance of Monaco's language services among all editors, this means this may interfere with other edtors, such as those full code files that are open for editing. addExtraLib also doesn't help with (2).
I believe building this would be easy with setHiddenAreas, but I haven't been able to get it to work. See this sandbox—if you keep backspacing from the end to the start, and past the start, you get:
And various other issues, e.g. select-all and delete causes the cursor to disappear from Monaco. And, of course, it's not part of the supported API (or else this issue would be a bug report).
After digging through past issues, I also came across this suggestion #170 (comment), which says to fork monaco-typescript. Is this still the best approach for what I'm seeking? Are there any examples or guidance as to the changes needed?
The text was updated successfully, but these errors were encountered: