Thursday, May 28, 2015

How to install the Notepad++ language file for the PowerQuery formula language

The PowerQuery product is explaind here: Introduction to Microsoft Power Query for Excel
As of the moment of this writing, the editor for the “M” language does not offer color syntax or intellisense. One way to aid in writing formulas is provided by Matt Mason who made a Notepad++ language file for M.
You can download the language file from his webpage Notepad++ language file for the Power Query formula language (“M”)
The downloaded file is called “mlang_npp.xml”.
Next we need to install the language file in Notepad++
  • Open Notepad++
  • From the menu bar select Language > Define your language…
  • In the ‘user defined language’ dialog window, click on the ‘Import…’ button
    In the ‘Open file’ dialog window, browse to your download folder, select “mlang_npp.xml” and click ‘Open’.
  • The file should load and you see a success dialog box, click OK.
  • Close the ‘user defined language’ dialog window.
  • Close Notepad++ and reopen.
  • Open the Language menu, at the bottom you will see the “M” language choice, below “Define your language…” (not in the M submenu).
  • With the “M” language selected, the code in your editor has syntax highlighting and syntax folding.
Most likely Microsoft will add syntax highlighting some time in the future. For now the Notepad ++ solution is helpful to build complex “M” statements.

No comments: