diff options
Diffstat (limited to 'devtools/client/debugger/src/components/PrimaryPanes')
3 files changed, 18 insertions, 19 deletions
diff --git a/devtools/client/debugger/src/components/PrimaryPanes/Outline.js b/devtools/client/debugger/src/components/PrimaryPanes/Outline.js index 79ebf7a38e..d52ed8ff40 100644 --- a/devtools/client/debugger/src/components/PrimaryPanes/Outline.js +++ b/devtools/client/debugger/src/components/PrimaryPanes/Outline.js @@ -82,6 +82,7 @@ export class Outline extends Component { selectedLocation: PropTypes.object.isRequired, getFunctionSymbols: PropTypes.func.isRequired, getClassSymbols: PropTypes.func.isRequired, + selectedSourceTextContent: PropTypes.object, canFetchSymbols: PropTypes.bool, }; } @@ -94,7 +95,8 @@ export class Outline extends Component { } componentDidUpdate(prevProps) { - const { cursorPosition, selectedLocation, canFetchSymbols } = this.props; + const { cursorPosition, selectedSourceTextContent, canFetchSymbols } = + this.props; if (cursorPosition && cursorPosition !== prevProps.cursorPosition) { this.setFocus(cursorPosition); } @@ -106,8 +108,11 @@ export class Outline extends Component { this.focusedElRef.scrollIntoView({ block: "center" }); } - // Lets make sure the source text has been loaded and is different - if (canFetchSymbols && prevProps.selectedLocation !== selectedLocation) { + // Lets make sure the source text has been loaded and it is different + if ( + canFetchSymbols && + prevProps.selectedSourceTextContent !== selectedSourceTextContent + ) { this.getClassAndFunctionSymbols(); } } @@ -133,8 +138,8 @@ export class Outline extends Component { } // Find items that enclose the selected location - const enclosedItems = [...classes, ...functions].filter( - ({ name, location }) => containsPosition(location, cursorPosition) + const enclosedItems = [...classes, ...functions].filter(({ location }) => + containsPosition(location, cursorPosition) ); if (!enclosedItems.length) { @@ -360,7 +365,7 @@ export class Outline extends Component { div( null, React.createElement(OutlineFilter, { - filter: filter, + filter, updateFilter: this.updateFilter, }), this.renderFunctions(functions), @@ -373,6 +378,7 @@ export class Outline extends Component { const mapStateToProps = state => { const selectedSourceTextContent = getSelectedSourceTextContent(state); return { + selectedSourceTextContent, selectedLocation: getSelectedLocation(state), canFetchSymbols: selectedSourceTextContent && isFulfilled(selectedSourceTextContent), diff --git a/devtools/client/debugger/src/components/PrimaryPanes/ProjectSearch.js b/devtools/client/debugger/src/components/PrimaryPanes/ProjectSearch.js index 68b08aed2b..b5a99316f8 100644 --- a/devtools/client/debugger/src/components/PrimaryPanes/ProjectSearch.js +++ b/devtools/client/debugger/src/components/PrimaryPanes/ProjectSearch.js @@ -16,7 +16,6 @@ import { getEditor } from "../../utils/editor/index"; import { searchKeys } from "../../constants"; import { getRelativePath } from "../../utils/sources-tree/utils"; -import { getFormattedSourceId } from "../../utils/source"; import { getProjectSearchQuery, getNavigateCounter, @@ -265,7 +264,7 @@ export class ProjectSearch extends Component { }, file.location.source.url ? getRelativePath(file.location.source.url) - : getFormattedSourceId(file.location.source.id) + : file.location.source.shortName ), span( { @@ -353,7 +352,7 @@ export class ProjectSearch extends Component { autoExpandAll: true, autoExpandDepth: 1, autoExpandNodeChildrenLimit: 100, - getParent: item => null, + getParent: () => null, getPath: getFilePath, renderItem: this.renderItem, focused: this.state.focusedItem, diff --git a/devtools/client/debugger/src/components/PrimaryPanes/SourcesTreeItem.js b/devtools/client/debugger/src/components/PrimaryPanes/SourcesTreeItem.js index fd5ceca46d..575d714ba5 100644 --- a/devtools/client/debugger/src/components/PrimaryPanes/SourcesTreeItem.js +++ b/devtools/client/debugger/src/components/PrimaryPanes/SourcesTreeItem.js @@ -19,7 +19,6 @@ import actions from "../../actions/index"; import { sourceTypes } from "../../utils/source"; import { createLocation } from "../../utils/location"; -import { safeDecodeItemName } from "../../utils/sources-tree/utils"; const classnames = require("resource://devtools/client/shared/classnames.js"); @@ -48,7 +47,7 @@ class SourceTreeItem extends Component { } } - onClick = e => { + onClick = () => { const { item, focusItem, selectSourceItem } = this.props; focusItem(item); @@ -147,19 +146,14 @@ class SourceTreeItem extends Component { ); } if (item.type == "group") { - return safeDecodeItemName(item.groupName); + return item.groupName; } if (item.type == "directory") { const parentItem = this.props.getParent(item); - return safeDecodeItemName( - item.path.replace(parentItem.path, "").replace(/^\//, "") - ); + return item.path.replace(parentItem.path, "").replace(/^\//, ""); } if (item.type == "source") { - const { displayURL } = item.source; - const name = - displayURL.filename + (displayURL.search ? displayURL.search : ""); - return safeDecodeItemName(name); + return item.source.longName; } return null; |