Open Defman21 opened 8 years ago
Thanks for the suggestion. I've wanted this too.
You could do something like
var cmds = require("ko/commands");
var supportedLangauges= [/*array of all languages*/];
for ( let lang of supportedLangauges)
{
cmds.register("set_file_lang-"+lang,
ko.views.manager.do_ViewAs(lang);
}
Anyone know a quick way to get the list of supported languages dynamically?
You could look into the code of file type widget in status bar :)
@Defman21 Yes I certainly could.
Sounds like a new SDK ;)
var langService = Components.classes["@activestate.com/koLanguageRegistryService;1"]. getService(Components.interfaces.koILanguageRegistryService);
var langs = {};
var cmds = require("ko/commands");
langService.getLanguageNames(langs, {});
for (let lang of langs.value) {
cmds.register("set_file_lang-"+lang,
ko.views.manager.do_ViewAs(lang));
}
Something like that. Probably it won't work.
Short Summary
In Sublime Text, you can change file type using their "Commando". I'd want to see similar feature in Komodo as well.