summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/src/utils/editor/source-documents.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /devtools/client/debugger/src/utils/editor/source-documents.js
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/debugger/src/utils/editor/source-documents.js')
-rw-r--r--devtools/client/debugger/src/utils/editor/source-documents.js55
1 files changed, 1 insertions, 54 deletions
diff --git a/devtools/client/debugger/src/utils/editor/source-documents.js b/devtools/client/debugger/src/utils/editor/source-documents.js
index 2ddb0b1965..53ee4f2f35 100644
--- a/devtools/client/debugger/src/utils/editor/source-documents.js
+++ b/devtools/client/debugger/src/utils/editor/source-documents.js
@@ -35,7 +35,7 @@ export function clearDocumentsForSources(sources) {
}
}
-function resetLineNumberFormat(editor) {
+export function resetLineNumberFormat(editor) {
const cm = editor.codeMirror;
cm.setOption("lineNumberFormatter", number => number);
resizeBreakpointGutter(cm);
@@ -54,59 +54,6 @@ function updateLineNumberFormat(editor, sourceId) {
resizeToggleButton(cm);
}
-export function updateDocument(editor, source) {
- if (!source) {
- return;
- }
-
- const sourceId = source.id;
- const doc = getDocument(sourceId) || editor.createDocument();
- editor.replaceDocument(doc);
-
- updateLineNumberFormat(editor, sourceId);
-}
-
-/* used to apply the context menu wrap line option change to all the docs */
-export function updateDocuments(updater) {
- for (const doc of sourceDocs.values()) {
- if (doc.cm == null) {
- continue;
- } else {
- updater(doc);
- }
- }
-}
-
-export function clearEditor(editor) {
- const doc = editor.createDocument("", { name: "text" });
- editor.replaceDocument(doc);
- resetLineNumberFormat(editor);
-}
-
-export function showLoading(editor) {
- // Create the "loading message" document only once
- let doc = getDocument("loading");
- if (!doc) {
- doc = editor.createDocument(L10N.getStr("loadingText"), { name: "text" });
- setDocument("loading", doc);
- }
- // `createDocument` won't be used right away in the editor, we still need to
- // explicitely update it
- editor.replaceDocument(doc);
-}
-
-export function showErrorMessage(editor, msg) {
- let error;
- if (msg.includes("WebAssembly binary source is not available")) {
- error = L10N.getStr("wasmIsNotAvailable");
- } else {
- error = L10N.getFormatStr("errorLoadingText3", msg);
- }
- const doc = editor.createDocument(error, { name: "text" });
- editor.replaceDocument(doc);
- resetLineNumberFormat(editor);
-}
-
const contentTypeModeMap = new Map([
["text/javascript", { name: "javascript" }],
["text/typescript", { name: "javascript", typescript: true }],