How to use "showUnused" editor option?
I tried the following snippet in the playground. but there is no fading for unused variable.
monaco.editor.create(document.getElementById("container"), {
value: "function hello() {\n\tvar d;\n\talert('Hello world!');\n}",
language: "typescript",
showUnused: true
});
any working samples?
This setting turns on the UI side of things. We also would need some language implementation to provide such diagnostics/markers. AFAIK none of the built-in languages provide "unused" diagnostics/markers.
Using the typescript language server with the tsconfig setting noUnusedLocals, we do get red squiggles, so how would one map that to the showUnused feature?
@zewa666 I think some work is needed in monaco-typescript here or here to create the diagnostics not as errors, but as warnings or hints.
@alexandrudima thanks for pointing that out. Is there an existing issue for that which we can track?
@zewa666 I don't think there is any issue to track specifically this. We keep issues for monaco-typescript in this repo with the label monaco-typescript.