Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

Adopt monaco.MarkerTag API #47

Merged
merged 1 commit into from Dec 17, 2019
Merged

Conversation

spahnke
Copy link
Contributor

@spahnke spahnke commented Oct 7, 2019

Use the marker tag monaco.MarkerTag.Unnecessary if the TypeScript service reports code as unused/unreachable when creating diagnostics. This way the corresponding code is rendered with a lower opacity.

Note: Currently this only works if the editor options are updated after editor creation (seems like any option will do); e.g. editor.updateOptions({ formatOnType: true });. Otherwise the opacity change is not applied. (See microsoft/monaco-editor#1619) I would consider this as blocked until the issue gets resolved because the Hint level diagnostic is not shown anymore when using the tag, even if showUnused is disabled completely.

Example code

{
    const foo = 1; // foo should be rendered with lower opacity
}

@alexdima
Copy link
Member

Thank you! ❤️

@alexdima alexdima added this to the December 2019 milestone Dec 17, 2019
@alexdima alexdima merged commit 92c4b95 into microsoft:master Dec 17, 2019
@spahnke spahnke deleted the mark-unnecessary branch December 19, 2019 19:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants