How do I find currently loaded mode (syntax) in Ace Editor?

ace-editor

Solution

To retrieve the name of the mode you use:

editor.getSession().getMode().$id

Problem

Well as the title says - how do I find out what the currently loaded mode is in Ace Editor? editor.getSession().getMode() does not really return anything I can use - have looked through the objects returned somewhat - but could not find anything. editor.getTheme() returns a string to me that I can use however - just seems funny if they did not do somewhat the same for mode

Original source