From 29bfdae57d5e2ecafa3c531f298cb6dad0994eb1 Mon Sep 17 00:00:00 2001 From: David <33458145+davidmcpowell@users.noreply.github.com> Date: Wed, 17 Jan 2024 08:47:39 +0000 Subject: [PATCH] Merge pull request #16523 from overleaf/dp-editable-file-extensions-2 Make cfg, ltx, Rnw and inc files editable in the editor GitOrigin-RevId: 1999c29ea451aa3f362ffa09f6f4d5889beaf404 --- services/web/config/settings.defaults.js | 4 ++++ .../web/frontend/js/features/source-editor/languages/index.ts | 2 ++ services/web/frontend/stories/decorators/scope.tsx | 4 ++++ services/web/test/frontend/bootstrap.js | 4 ++++ services/web/test/unit/src/Uploads/FileTypeManagerTests.js | 4 ++++ 5 files changed, 18 insertions(+) diff --git a/services/web/config/settings.defaults.js b/services/web/config/settings.defaults.js index e30bebfd89..ffd23cea7a 100644 --- a/services/web/config/settings.defaults.js +++ b/services/web/config/settings.defaults.js @@ -91,6 +91,10 @@ const defaultTextExtensions = [ 'lhs', 'mk', 'xmpdata', + 'cfg', + 'rnw', + 'ltx', + 'inc', ] const parseTextExtensions = function (extensions) { diff --git a/services/web/frontend/js/features/source-editor/languages/index.ts b/services/web/frontend/js/features/source-editor/languages/index.ts index bee9b757c3..dd37dbc507 100644 --- a/services/web/frontend/js/features/source-editor/languages/index.ts +++ b/services/web/frontend/js/features/source-editor/languages/index.ts @@ -27,6 +27,7 @@ export const languages = [ 'ldf', 'xmpdata', 'Rnw', + 'rnw', 'lyx', 'inc', 'dtx', @@ -44,6 +45,7 @@ export const languages = [ 'pygstyle', 'pygtex', 'ps_tex', + 'ltx', ], load: () => { return import('./latex').then(m => m.latex()) diff --git a/services/web/frontend/stories/decorators/scope.tsx b/services/web/frontend/stories/decorators/scope.tsx index a9439d1b98..33bcadda35 100644 --- a/services/web/frontend/stories/decorators/scope.tsx +++ b/services/web/frontend/stories/decorators/scope.tsx @@ -186,6 +186,10 @@ const initialize = () => { 'lhs', 'mk', 'xmpdata', + 'cfg', + 'rnw', + 'ltx', + 'inc', ], editableFilenames: ['latexmkrc', '.latexmkrc', 'makefile', 'gnumakefile'], validRootDocExtensions: ['tex', 'Rtex', 'ltx', 'Rnw'], diff --git a/services/web/test/frontend/bootstrap.js b/services/web/test/frontend/bootstrap.js index be859893cb..e3998e68d1 100644 --- a/services/web/test/frontend/bootstrap.js +++ b/services/web/test/frontend/bootstrap.js @@ -64,6 +64,10 @@ window.ExposedSettings = { 'lhs', 'mk', 'xmpdata', + 'cfg', + 'rnw', + 'ltx', + 'inc', ], editableFilenames: ['latexmkrc', '.latexmkrc', 'makefile', 'gnumakefile'], } diff --git a/services/web/test/unit/src/Uploads/FileTypeManagerTests.js b/services/web/test/unit/src/Uploads/FileTypeManagerTests.js index fa8a087da1..16c4304060 100644 --- a/services/web/test/unit/src/Uploads/FileTypeManagerTests.js +++ b/services/web/test/unit/src/Uploads/FileTypeManagerTests.js @@ -92,6 +92,10 @@ describe('FileTypeManager', function () { '/file.TEX', '/file.lhs', '/file.xmpdata', + '/file.cfg', + '/file.Rnw', + '/file.ltx', + '/file.inc', '/makefile', '/Makefile', '/GNUMakefile',