CodeMirror plugin for PolyGerrit

Clone this repo:
  1. 740c35a Update codemirror-minified to 5.59.1 by David Ostrovsky · 7 weeks ago master
  2. 7357ab4 Bazel: Format build file with buildifier by David Ostrovsky · 9 months ago v3.3.0 v3.3.0-rc0 v3.3.0-rc1 v3.3.0-rc2 v3.3.0-rc3 v3.3.0-rc4 v3.3.0-rc5 v3.3.0-rc6 v3.3.0-rc7 v3.3.1 v3.3.2
  3. e211fb1 Move codemirror editor plugin to Polymer 3 by Tao Zhou · 10 months ago v3.2.0 v3.2.0-rc3 v3.2.0-rc4 v3.2.1 v3.2.2 v3.2.3 v3.2.5.1 v3.2.6 v3.2.7
  4. dccbda5 Remove support for Polymer 1 by Paladox none · 1 year ago
  5. 59942b1 Merge "Add support for fsharp" by Paladox none · 12 months ago v2.16.17 v2.16.18 v2.16.19 v2.16.20 v2.16.21 v2.16.22 v2.16.23 v2.16.26 v2.16.27 v3.0.10 v3.0.11 v3.0.12 v3.0.13 v3.0.16 v3.0.8 v3.0.9 v3.1.11 v3.1.12 v3.1.4 v3.1.5 v3.1.6 v3.1.7 v3.1.8 v3.2.0-rc0 v3.2.0-rc1 v3.2.0-rc2

CodeMirror Editor

A plugin that uses CodeMirror to provide a rich code editing experience in PolyGerrit.

UI plugin

This plugin is rewritten into Polymer 3 syntax. The gr-editor.js is the main entry for the plugin.

But to support the lazy load on the codemirror with supported languages, we still have the codemirror-element.html as an asset which still built separately as an html.

We may consider drop the selectively language support and in favor of all-in-one bundle in the future or change build rule to support bundle css in js to move off of the html completely.

UI tests

To run UI tests here will need install dependencies from both npm and bower.

npm run wct-test should take care both for you, read more in package.json.

You will need polymer-bridges which is a submodule you can clone from:

As polymer 3 no longer support Polymer.importHref anymore, Gerrit still supports through a custom implementation, the implementation is copied here for testing purpose (test/import-href.js).

Test plugin on Gerrit

  1. Build the bundle locally with: bazel build :codemirror_editor
  2. Serve your generated ‘codemirror_editor.js’ somewhere, you can put it under gerrit/plugins/codemirror-editor/ folder and it will automatically served at http://localhost:8081/plugins_/codemirror-editor/
  3. Use FE dev helper,, inject the local served ‘codemirror_editor.js’ to the page

If your plugin is already enabled, then you can block it and then inject the compiled local verison.

See more about how to use dev helper extension to help you test here: