Verilog mode was always supported by Codemirror, but support for VHDL
was only added in recent Codemirror version, so that we can only
include it now.
Bug: Issue 3447
Change-Id: I91028acf3f41f51981f710db00bee9a8c9398aee
Codemirror closebrackets.js addons defines an option `autoCloseBrackets`
that will auto-close brackets and quotes when typed. By default, it will
auto-close ()[]{}''"".
Change-Id: I844d49c7d60d8fc78808df566e4c4f9aff1b012e
Codemirror matchbrackets.js addon defines an option `matchBrackets`
which, when set to true, causes matching brackets to be highlighted
whenever the cursor is next to them. Set default to be true.
Change-Id: I8d107a70af484562f5938fe41245f0603b820492
New Codemirror version fixed number of bugs and implemented
improvements to existing modes: [1].
[1] http://codemirror.net/doc/releases.html
Change-Id: I15b3e17b256526cb2c7f088f30b83143df5b4978
This change will let Gerrit do proper syntax highlighting on
puppet files since CodeMirror supports puppet [1].
[1] http://codemirror.net/mode/puppet/index.html
Feature: issue 3293
Change-Id: Ib9bb66ee4cc656a7911672d62a4bde0e458a3f80
CodeMirror is available as a JAR file on Maven Central under the
org.webjars group ID.
Add support in the download wrapper to consume CodeMirror from this
location and extract from the JAR file rather than a ZIP file.
The support to download as a ZIP file from the Gerrit bucket is kept
for backward compatibility in case we want to use our own build of
the library at any point in the future.
Change-Id: Ie21b72b57fe1a90894c4aadd7ef4bdc91d055cd5
Interestingly enough there was already an entry for go in
mime-types.properties.
Change-Id: Ibf4742cbab1e18370a88616fd857eb133405b4f6
Signed-off-by: Dan Albert <danalbert@google.com>
Since [1] Buck implicitly adds :foo and :bar in $(exe :foo) and
$(location :bar) macros to the dependency list of genrule(). The
code base was adjusted to reflect this enhancement in Ie3a9de0b2.
In I996b8d2a1 the unneeded dependencies were partially re-added
in CM integration code.
Re-remove it again.
[1] https://github.com/facebook/buck/issues/128
Change-Id: I8d0aaa5c9f7586f04f169f8362709b1fc7b04dcc
With an updated CodeMirror search results from vim mode are marked in
the vertical scrollbar with gold colored annotations.
Change-Id: Ibac2a32987201f077eecc99ac1ac9407ebe61d89
Most users run with the default theme, which does not require any
additional CSS. The total set of themes costs 7.3 KiB of download
when added into the default CSS file.
Split the themes into their own files and only load the theme when
it is required by the browser.
Change-Id: I48f274347e1ca94895c0756fa17479661c78fd57
The addon list is very repetitive with 'addon/' at the start of each
name. Split these out into their own list of files and append them
after the other JavaScript in the build rule.
As GWT manages the CodeMirror CSS and JS resources with strong names
the internal names "cm4.{js,css}" only exist between the Buck build
system and the GWT compiler. Drop the major version number, as it
provides no value and complicates upgrades.
Change-Id: Ie0def2fee3a2109a2da21af6b3ce7495006c239e
Instead of writing out the mode_map table by hand, compile and include
meta.js from the CodeMirror distribution. This script lists all modes
in simple JavaScript objects.
An advantage of this format is the name property is human readable,
and does not require munging MIME type strings. Adding new modes now
changes only 2 files in the client (Modes and ModeInfo).
Change-Id: Ifa0c7af77681f72b8210fca83a7af6a9ef1c6541
Instead of implementing the scrollbar inside of Gerrit, use the
simplescrollbars addon available with CodeMirror 4.9. The addon has
handlers for scroll wheel support and other basic browser behavior
that was broken or missing in Gerrit's own scrollbar replacement.
Markers in the overview bar can now be simpler widgets that track the
vertical scale ratio of the CM3 instance and position accordingly.
Change-Id: Ib117668ee0f85955d1e47034e32676bc9796d0d2
Allow Buck to run minify for each mode independently of the
main CodeMirror JS. This cuts the build time roughly in half
as the modes minify concurrently with the main lib/cm.js.
Add the LICENSE file header to each mode. The MIT license
that covers the standard modes requires end-user redistribution
to include the notice along with the code.
Simplify the definition of modes by just naming the directory.
CodeMirror has a convention that the JavaScript is inside of
a same named JS file. This cleans up both the cm.defs file
and the Modes.java listing of every mode supported by Gerrit.
Fix dependencies for genrules used during the CodeMirror build.
A genrule must use deps to name each $(location) rule used within
the cmd string.
Change-Id: I996b8d2a1da8fe1b023c71c4a86bdcd4443c8c03
The beforeChange event API has been completely changed from 3.x. It
now receives an object with an array of ranges. The last range is the
"primary" range that most selection methods will default to.
Cursor position CSS was updated in CM 4.x and needs to be adapted to
keep the prior behavior of an underline for current cursor with no
blinking box on selected text.
CM3 related constants in the build system were renamed to CM_ prefix
to avoid needing to rename them again when CodeMirror updates to 5.x.
JavaScript and CSS output were updated to be cm4.{css,js}. Keep the
major version number in the file names clarifying the content being
loaded into the browser.
Change-Id: I49c70f7155f96c63c94521eeb1d676b4429d6962
This version fixes a critical bug [1] that prevents us from simplifying
bucklets intergration. In this version, Buck only allows defining new
rule functions in files included with include_defs, not actually
instantiating rules, so we need to reshuffle some rules.
After this commit [2] "$(macro ...)" syntax is preserved for buck
macros, we need to use a backslash to send commands directly to the
shell: "\$(macro ...)". It turns out this doesn't work yet, shell
backticks seem to work though [3].
[1] https://github.com/facebook/buck/issues/182
[2] d6f3252170
[3] https://github.com/facebook/buck/issues/212
Change-Id: Ie99757bafc626d4ac2c5a75a2983d91b0c4f6d24
Unlike I0b4032d4, this bug is not reproducible by pasting the offending
contents into a plain HTML page; it appears to be an issue with our
diff context folding.
Change-Id: I64cd1793c46a3668ee8c67a37b0e09c7ede34c2c
Extend the build tool chain to minify JavaScript from CodeMirror
distribution.
Currently SIMPLE_OPTIMIZATIONS mode is used, as ADVANCED_OPTIMIZATIONS
doesn't seem to work. But even with simple mode the minification factor
is:
393441:cm3-verbose.js
167971:cm3_minified.js
And even more for language modes:
56029:perl-verbose.js
10122:perl-minified.js
Disadvantage: Longer compilation time. In follow-up changes we may want
to optimize it by disabling JS minification in development build.
Change-Id: I24790e84484add4f02b3821cca4b69e62fde0c22
Replace "mv" with "cp" in //lib/codemirror:jar target. Usage of "mv" is
wrong here, while it makes the rule not repeatable: when the rule is
changed and thus must be reevaluated, it cannot: css and js were moved
and cannot be accessed any more.
Note: That is expected that after applying this change the build of jar
is failing:
$ buck build lib/codemirror:jar
cp: cannot stat <path to /buck-out/gen/lib/codemirror/cm3.css>:
No such file or directory
That's the bug this change is fixing. To recover wipe out the Buck output
directory:
rm -rf buck-out
Change-Id: I1bfc5bb10eaa52332043914641a72510c8e539c5
In new buck version `$SRCDIR` is not necessary any more. Buck now
always runs genrule relative to the $SRCDIR link forest.
Change-Id: Iee88bb575c7baa62bc087527927be5347a7f8f95
84a66d82d36d554c1844acff11d1a62f10c174ed added support for light and
dark themes, but dark themes weren't enabled, as diff styles have
to be adjusted to correspond with dark colors.
101a8c4b65ebee4d54afddad10db05f5b9698ba9 reverted the preparation
for dark themes support.
This change enables support for subset of dark themes and switch
dynamicaly the diff styles to dark colors, when dark theme was
selected.
Change-Id: Ic220baf8f19366c04520b61e893a0d11912805ef
This avoids packing too many CSS rules, which bloats the download
to the browser and may slow down rendering while the browser picks
matching CSS classes.
Change-Id: I8888bc9daa9693ff2598ccfe29d150fa3fac0916
Add support for CM3 themes. CM3 has built in support for themes.
Unfortunately we can not use all of them out of the box, because
we set statically background colors on diff styles. However we
can use light themes. Especially "eclipse" theme looks very sexy
for Java developers that use this IDE and are acquainted with its
look and feel.
Integrate all supported themes in Buck tool chain, so that we are
prepared to extend the support for dark themes. To do that we must
dynamically assign background colors for different diff styles per
theme.
Change-Id: Ic97c237d789dc4daeff6b8bb4f7606da83f5d532
Upstream fixed an issue with line numbers
disappearing after a skip bar.
Change-Id: Ia7765f6956d7fc85d83b94fb6ec14a9d3ea4e42b
(cherry picked from commit 4bbf8b01672a7d1dddb34b3af535d4c4c7805523)
Instead of loading a list of script elements at runtime combine
required script fragments together at build time into one file.
This cleans up the Loader class and allows the browser to perform a
single HTTP GET to download the JavaScript code at runtime.
Include CodeMirror3's license text as part of the CSS and JavaScript
that is downloaded by browsers.
Change-Id: I0cd2b5924da1eda9b9445e6a64752ff59f21b64b
Latest version of buck is faster than the prior version used by
Gerrit. No-op updates when loading a debug version of the UI now take
only 1.804s on my laptop (previously 7s) and a draft UI compile is
only 24.659s (previously 39s).
The slow acceptance tests must now be excluded with `--exclude slow`.
Buck changed the meaning of the -e option to be --emulator, which is
unfortunately useful only for Android application developers.
genrule() now needs to use $(exe) to reference the binary to run,
offers $(location) to make it easier to find files in the build tree.
The empty srcs array is no longer required for genrule(). Buck has
determined it is sufficiently powerful with $(location) and deps that
requiring srcs is unnecessary.
Supporting .src.zip files in the srcs array of java_library() means
Gerrit no longer needs to run a separate genrule() to extract files
produced by ANTLR, or call javac inside of the BuckPrologCompiler
support glue.
Change-Id: Ib03042921a081b867a7aad0423bd45523e42917a