diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-08-03 16:24:26 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-10-13 03:17:30 +0300 |
commit | 399056ed783e12337a9c47b06b4aae021198f1cd (patch) | |
tree | 21645fa92b300735c5431608e17f3e34b34ce653 /app/assets/javascripts/merge_conflicts | |
parent | a5ecb5bbdac05c3b1a96ecb918ce6a4ceed37d75 (diff) |
Remove dependencies on Linguist
This saves about 128 MB of baseline RAM usage per Unicorn and
Sidekiq process (!).
Linguist wasn't detecting languages anymore from CE/EE since
9ae8b57467ac8b38f1fa9020a466d94a93cbb9dd. However, Linguist::BlobHelper
was still being depended on by BlobLike and others.
This removes the Linguist gem, given it isn't required anymore.
EscapeUtils were pulled in as dependency, but given Banzai depends on
it, it is now added explicitly.
Previously, Linguist was used to detect the best ACE mode. Instead,
we rely on ACE to guess the best mode based on the file extension.
Diffstat (limited to 'app/assets/javascripts/merge_conflicts')
-rw-r--r-- | app/assets/javascripts/merge_conflicts/components/diff_file_editor.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/assets/javascripts/merge_conflicts/components/diff_file_editor.js b/app/assets/javascripts/merge_conflicts/components/diff_file_editor.js index 425b806e9d6..a62ebe23646 100644 --- a/app/assets/javascripts/merge_conflicts/components/diff_file_editor.js +++ b/app/assets/javascripts/merge_conflicts/components/diff_file_editor.js @@ -5,6 +5,7 @@ import Vue from 'vue'; import axios from '~/lib/utils/axios_utils'; import flash from '~/flash'; import { __ } from '~/locale'; +import getModeByFileExtension from '~/lib/utils/ace_utils'; (global => { global.mergeConflicts = global.mergeConflicts || {}; @@ -72,7 +73,7 @@ import { __ } from '~/locale'; this.fileLoaded = true; this.editor = ace.edit(content); this.editor.$blockScrolling = Infinity; // Turn off annoying warning - this.editor.getSession().setMode(`ace/mode/${data.blob_ace_mode}`); + this.editor.getSession().setMode(getModeByFileExtension(data.new_path)); this.editor.on('change', () => { this.saveDiffResolution(); }); |