monaco-editor
monaco-editor copied to clipboard
feature-request: getValue without comments
Could you add a parameter to the .getValue(); which returns back the editor content without comments?
something like editor.getValue({ trimComments: true });
For example, if I have this content:
/*
old sum function
function sum(_a, _b){
return _a + _b;
}
*/
var a, b;
// add function
function add(_a, _b){
return _b + _a;
}
the editor.getValue({ trimComments: true });
should return back:
var a, b;
function add(_a, _b){
return _b + _a;
}
Same for the other languages (css, html, ...)
My use case: I need to know if the editor contains actual code, not just content.
+1
+1
+1
++1
+1
We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider.
If you wonder what we are up to, please see our roadmap and issue reporting guidelines.
Thanks for your understanding, and happy coding!