I am from Symfony 5 and webpack encore, I use ace-builds with the version 1.4.12
Given a webpage with an ace editor bloc (containing some code lines). On pageLoad, I want to automatically upperCase and comment the lines 1 to 2.
I instantiate the ace editor simply like this :
let editor = ace.edit(editorElement); // editorElement is an html element containing some code lines
And this is the code executed after the pageLoad :
require('ace-builds/webpack-resolver'); // my project is managed by symfony 5 and webpack encore
let Range = require('ace-builds').Range;
editor.toggleCommentLines(); // does nothing...why ?
editor.toUpperCase(); // its work !
The result is :
The lines 1 and 2 are in upperCase as expected, but the lines aren't commented and I don't understand why...
I don't won't "just" add a '#' char because the mode of the generated ace editor may change. By example, the mode may be 'ace/mode/sql', and the comment in sql don't use the '#' char
Thanks for any help :)