diff --git a/services/web/public/src/ide/editor/directives/aceEditor.js b/services/web/public/src/ide/editor/directives/aceEditor.js index 4e6e36f493..844ab4af69 100644 --- a/services/web/public/src/ide/editor/directives/aceEditor.js +++ b/services/web/public/src/ide/editor/directives/aceEditor.js @@ -700,7 +700,7 @@ define([ // see if we can lookup a suitable mode from ace // but fall back to text by default try { - if (/\.(Rtex|bbl)$/i.test(scope.fileName)) { + if (/\.(Rtex|bbl|tikz)$/i.test(scope.fileName)) { // recognise Rtex and bbl as latex mode = 'ace/mode/latex' } else if (/\.(sty|cls|clo)$/.test(scope.fileName)) { diff --git a/services/web/public/src/ide/files/services/files.js b/services/web/public/src/ide/files/services/files.js index 2789037c32..838aaa035e 100644 --- a/services/web/public/src/ide/files/services/files.js +++ b/services/web/public/src/ide/files/services/files.js @@ -1,50 +1,21 @@ -/* eslint-disable - max-len, - no-undef, -*/ -// TODO: This file was created by bulk-decaffeinate. -// Fix any style issues and re-enable lint. -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * DS103: Rewrite code to no longer use __guard__ - * DS207: Consider shorter variations of null checks - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ +/* global _ */ define(['base'], App => App.factory('files', function(ide) { const Files = { getTeXFiles() { - const texFiles = [] - ide.fileTreeManager.forEachEntity(function(entity, folder, path) { + let texFiles = [] + ide.fileTreeManager.forEachEntity(function(entity, _folder, path) { if ( entity.type === 'doc' && - __guardMethod__( - entity != null ? entity.name : undefined, - 'match', - o => o.match(/.*\.(tex|txt|md)/) - ) + /.*\.(tex|md|txt|tikz)/.test(entity.name) ) { const cloned = _.clone(entity) cloned.path = path - return texFiles.push(cloned) + texFiles.push(cloned) } }) return texFiles } } - return Files })) - -function __guardMethod__(obj, methodName, transform) { - if ( - typeof obj !== 'undefined' && - obj !== null && - typeof obj[methodName] === 'function' - ) { - return transform(obj, methodName) - } else { - return undefined - } -}