I am trying to write a plugin/extension for Brackets that will handle PowerShell. Well after looking into it, I found that CodeMirror also doesn\'t have a PowerShell mode, so I
General answer - there actually are some fairly detailed resources for this:
Specific answer - I can spot a few issues in your sample code that will definitely cause problems:
require("powershell")
without the .js -- this is the format JS module loaders expectdefine(...)
wrapper as your main.js. And it should use brackets.getModule()
to get a reference to CodeMirror, same as main.js. (Using JSLint, which is built into Brackets, is helpful for warning you when you reference globals that you have forgotten to explicitly load as module dependencies).startStat
-> startState
CodeMirror.defineMode()
before calling LanguageManager.defineLanguage()
- see "Custom CodeMirror modes" docs linked above. You could either do this in your powershell.js module, or early in main.js.