summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/src/selectors
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/debugger/src/selectors')
-rw-r--r--devtools/client/debugger/src/selectors/breakpointSources.js6
-rw-r--r--devtools/client/debugger/src/selectors/sources.js10
-rw-r--r--devtools/client/debugger/src/selectors/test/__snapshots__/visibleColumnBreakpoints.spec.js.snap16
-rw-r--r--devtools/client/debugger/src/selectors/ui.js4
4 files changed, 32 insertions, 4 deletions
diff --git a/devtools/client/debugger/src/selectors/breakpointSources.js b/devtools/client/debugger/src/selectors/breakpointSources.js
index a0daedae21..4867ade82c 100644
--- a/devtools/client/debugger/src/selectors/breakpointSources.js
+++ b/devtools/client/debugger/src/selectors/breakpointSources.js
@@ -5,7 +5,6 @@
import { createSelector } from "devtools/client/shared/vendor/reselect";
import { getSelectedSource } from "./sources";
import { getBreakpointsList } from "./breakpoints";
-import { getFilename } from "../utils/source";
import { getSelectedLocation } from "../utils/selected-location";
// Returns a list of sources with their related breakpoints:
@@ -37,16 +36,15 @@ export const getBreakpointSources = createSelector(
sources.set(source, {
source,
breakpoints: [breakpoint],
- filename: getFilename(source),
});
} else {
sources.get(source).breakpoints.push(breakpoint);
}
}
- // Returns an array of breakpoints info per source, sorted by source's filename
+ // Returns an array of breakpoints info per source, sorted by source's displayed name
return [...sources.values()].sort((a, b) =>
- a.filename.localeCompare(b.filename)
+ a.source.shortName.localeCompare(b.source.shortName)
);
}
);
diff --git a/devtools/client/debugger/src/selectors/sources.js b/devtools/client/debugger/src/selectors/sources.js
index 938eae9fe2..6a67cf1a32 100644
--- a/devtools/client/debugger/src/selectors/sources.js
+++ b/devtools/client/debugger/src/selectors/sources.js
@@ -163,6 +163,16 @@ export function getSelectedMappedSource(state) {
return mappedSource || null;
}
+/**
+ * Helps knowing if we are still computing the mapped location for the currently selected source.
+ */
+export function isSelectedMappedSourceLoading(state) {
+ const { selectedOriginalLocation } = state.sources;
+ // This `selectedOriginalLocation` attribute is set to UNDEFINED_LOCATION when selecting a new source attribute
+ // and later on, when the source map is processed, it will switch to either a valid location object, or NO_LOCATION if no valid one if found.
+ return selectedOriginalLocation === UNDEFINED_LOCATION;
+}
+
export const getSelectedSource = createSelector(
getSelectedLocation,
selectedLocation => {
diff --git a/devtools/client/debugger/src/selectors/test/__snapshots__/visibleColumnBreakpoints.spec.js.snap b/devtools/client/debugger/src/selectors/test/__snapshots__/visibleColumnBreakpoints.spec.js.snap
index e4b18538cf..04bc12bbec 100644
--- a/devtools/client/debugger/src/selectors/test/__snapshots__/visibleColumnBreakpoints.spec.js.snap
+++ b/devtools/client/debugger/src/selectors/test/__snapshots__/visibleColumnBreakpoints.spec.js.snap
@@ -22,6 +22,8 @@ Array [
"isOriginal": false,
"isPrettyPrinted": false,
"isWasm": false,
+ "longName": "url",
+ "shortName": "url",
"thread": "FakeThread",
"url": "url",
},
@@ -44,6 +46,8 @@ Array [
"isOriginal": false,
"isPrettyPrinted": false,
"isWasm": false,
+ "longName": "url",
+ "shortName": "url",
"thread": "FakeThread",
"url": "url",
},
@@ -83,6 +87,8 @@ Array [
"isOriginal": false,
"isPrettyPrinted": false,
"isWasm": false,
+ "longName": "url",
+ "shortName": "url",
"thread": "FakeThread",
"url": "url",
},
@@ -105,6 +111,8 @@ Array [
"isOriginal": false,
"isPrettyPrinted": false,
"isWasm": false,
+ "longName": "url",
+ "shortName": "url",
"thread": "FakeThread",
"url": "url",
},
@@ -152,6 +160,8 @@ Array [
"isOriginal": false,
"isPrettyPrinted": false,
"isWasm": false,
+ "longName": "url",
+ "shortName": "url",
"thread": "FakeThread",
"url": "url",
},
@@ -174,6 +184,8 @@ Array [
"isOriginal": false,
"isPrettyPrinted": false,
"isWasm": false,
+ "longName": "url",
+ "shortName": "url",
"thread": "FakeThread",
"url": "url",
},
@@ -221,6 +233,8 @@ Array [
"isOriginal": false,
"isPrettyPrinted": false,
"isWasm": false,
+ "longName": "url",
+ "shortName": "url",
"thread": "FakeThread",
"url": "url",
},
@@ -243,6 +257,8 @@ Array [
"isOriginal": false,
"isPrettyPrinted": false,
"isWasm": false,
+ "longName": "url",
+ "shortName": "url",
"thread": "FakeThread",
"url": "url",
},
diff --git a/devtools/client/debugger/src/selectors/ui.js b/devtools/client/debugger/src/selectors/ui.js
index 4780b5e051..0dc97bed1b 100644
--- a/devtools/client/debugger/src/selectors/ui.js
+++ b/devtools/client/debugger/src/selectors/ui.js
@@ -115,3 +115,7 @@ export function getHideIgnoredSources(state) {
export function isSourceMapIgnoreListEnabled(state) {
return state.ui.sourceMapIgnoreListEnabled;
}
+
+export function areSourceMapsEnabled(state) {
+ return state.ui.sourceMapsEnabled;
+}