scalameta/metabrowse

Expose the semanticdb messages as model markers

jonas opened this issue · 5 comments

jonas commented

Model markers provide a way to annotate the code with compiler warnings. Should probably be optional.

https://microsoft.github.io/monaco-editor/api/modules/monaco.editor.html#setmodelmarkers

editingevolved_errorsinline

The semanticdb includes messages reported by the compiler, see https://github.com/scalameta/scalameta/blob/f7463f78227e092b5dab0a05667733b0a2b23952/scalameta/semantic/shared/src/main/protobuf/semanticdb.proto#L12

We should probably call this method once when we create the model for the first time. In #33, models are created in MetadocTextModelService.

I managed to get this working!

screen shot 2017-07-02 at 20 34 07

The fix is here 90d3914 However, unfortuantely markers are not displayed in read-only mode, see microsoft/monaco-editor#311 I left a comment in that issue, maybe they're open to change the behavior or we can contribute a new option to escape this.

jonas commented

It's a shame it doesn't work in read-only mode.

Metadoc requires the sources to be compiled beforehand so we would only be able to report warnings. I think this is not an important use-case so I'd be happy to close this ticket. wdyt?

jonas commented

Yes we can close it.