Modify Mongoose-IDE in visual studio code

If you are asking a question, please follow this template:

  1. My goal is: [Modify the setting in “Build locally”]
  2. My actions are: [change to : mos build --verbose --local --platform esp8266 --deps-dir deps --binary-libs-dir libs --no-libs-update]
  3. The result I see is: [default build option is : mos build --verbose --local --platform esp8266]
  4. My expectation & question is: [Is there a method to modify ??]

@dilbert168 It is possible to modify arguments of the Build locally command, but you have manually modify the VS Code extension. I recommend to read this article: Writing VS Code extensions.

So, what you have to do:

  1. Uninstall original extension Mongoose OS IDE from your VS Code;
  2. Download the extension source files from repository: https://github.com/cesanta/mongoose-os-ide;
  3. Open source files folder in VS Code;
  4. Modify arguments for Build locally command in extension.js (the block of code you need to modify starts from the line no. 300). You have to modify something like this:
vscode.commands.registerCommand('mos.buildLocally', () => {
    //return runMosCommand(['build', "--local", "--verbose"], cmdOut)
    return runMosCommand(['build', "--local", "--verbose", "--deps-dir deps", "--binary-libs-dir libs", "--no-libs-update"], cmdOut)
      .then(() => vscode.window.showInformationMessage('MGOS: Build succeeded!'))
      .catch(err => {
        cmdOut.show(true)
        vscode.window.showErrorMessage(err)
      });
  });
  1. Test and debug your updated extension (F5);
  2. Generate .vsix package, details here: Packaging VS Code extensions;
  3. Manually install the extension, details here: Manually installing a VS Code extension.