question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issues to set Model Markers

See original GitHub issue

how to access setModelMarkers? The only way I found to access it was to add the reference to the package monaco-editor and to call it the following way:

import * as monacoEditor from "monaco-editor/esm/vs/editor/editor.api";
/// blabla
monacoEditor.editor.setModelMarkers(myEditor.getModel(), "ScriptEditor", []);

the pb is that from the moment I make an actual use of monacoEditor.editor in the code, the editor doesn’t behave correctly anymore: ctrl+arrow doesn’t work, syntaxic coloration doesn’t work, autocomplete doesn’t work…

I believe that the import overrides some calls that are done in your version your are exposing, and ruins the behavior. I assume this because even if I make the following I still have the pb:

if(false){
    // this will never be called, but still, the compiler feels compelled to integrate 
    // the code in the final bundle, and that causes the issue as well
    monacoEditor.editor.setModelMarkers(myEditor.getModel(), "ScriptEditor", []);
}

here the working/failling example: https://codesandbox.io/s/funny-sara-kbws9?fontsize=14&hidenavigation=1&theme=dark

FYI, I would need to access some types that are necessary, like IStandaloneCodeEditor, or MarkerSeverity but it is as well impossible to access it. I think you should expose the full api of monaco, or at least a wrapper for most common features.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
suren-atoyancommented, Dec 24, 2019

After I run it with @monaco-editor/react, the result is Screen Shot 2019-12-24 at 20 00 26

Check it here

1reaction
suren-atoyancommented, Nov 26, 2019

Hello @paillave.

To access setModelMarkers you need to access the monaco instance.

  • to see how you can access to monaco instance read here to say short:
import { monaco } from '@monaco-editor/react';

monaco
  .init()
  .then(monacoInstance => console.log(monacoInstance.editor.setModelMarkers);
  • similar issue
  • about types I agree, I need to expose all possible types; I’ll try to do it in next version

I think it helps. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues to set Model Markers #38 - GitHub
how to access setModelMarkers? The only way I found to access it was to add the reference to the package monaco-editor and to...
Read more >
Problem Markers - TIBCO Product Documentation
Problem markers are a standard Eclipse feature that track issues associated with workspace resources.
Read more >
Marker symbol layers—ArcGIS Pro | Documentation
Marker symbol layers are components of symbols that draw graphics at point geometry, along lines ... Uses a 3D model to define the...
Read more >
[#1853] Using just marker adjustment process, OpenSim does ...
The issue arises when a model has already been scaled and the user is trying to adjust marker positions. An externally determined set...
Read more >
Use Markers to Navigate | User Guide Page
Use the markers in any view of the BIMx Hyper-model to navigate among layouts and the corresponding 3D model view. This is the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found