Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Remove Breakpoint Editor management (#4677)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyrosmith authored and jasonLaster committed Nov 14, 2017
1 parent 5008a59 commit f57e6ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
9 changes: 3 additions & 6 deletions src/components/Editor/Breakpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ReactDOM from "react-dom";
import classnames from "classnames";
import Svg from "../shared/Svg";

import { getDocument, showSourceText, toEditorLine } from "../../utils/editor";
import { getDocument, toEditorLine } from "../../utils/editor";

const breakpointSvg = document.createElement("div");
ReactDOM.render(<Svg name="breakpoint" />, breakpointSvg);
Expand All @@ -28,8 +28,7 @@ function makeMarker(isDisabled: boolean) {
type Props = {
breakpoint: Object,
selectedSource: Object,
editor: Object,
sourceMetaData: Object
editor: Object
};

class Breakpoint extends Component<Props> {
Expand All @@ -41,7 +40,7 @@ class Breakpoint extends Component<Props> {
}

addBreakpoint() {
const { breakpoint, editor, selectedSource, sourceMetaData } = this.props;
const { breakpoint, editor, selectedSource } = this.props;

// Hidden Breakpoints are never rendered on the client
if (breakpoint.hidden) {
Expand All @@ -57,8 +56,6 @@ class Breakpoint extends Component<Props> {
const sourceId = selectedSource.get("id");
const line = toEditorLine(sourceId, breakpoint.location.line);

showSourceText(editor, selectedSource.toJS(), sourceMetaData);

editor.codeMirror.setGutterMarker(
line,
"breakpoints",
Expand Down
11 changes: 4 additions & 7 deletions src/components/Editor/Breakpoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React, { Component } from "react";
import Breakpoint from "./Breakpoint";

import actions from "../../actions";
import { getSelectedSource, getSourceMetaData } from "../../selectors";
import { getSelectedSource } from "../../selectors";
import getVisibleBreakpoints from "../../selectors/visibleBreakpoints";
import { makeLocationId } from "../../utils/breakpoint";
import { isLoaded } from "../../utils/source";
Expand All @@ -20,8 +20,7 @@ import type { SourceRecord, BreakpointsMap } from "../../reducers/types";
type Props = {
selectedSource: SourceRecord,
breakpoints: BreakpointsMap,
editor: Object,
sourceMetaData: Object
editor: Object
};

class Breakpoints extends Component<Props> {
Expand All @@ -37,7 +36,7 @@ class Breakpoints extends Component<Props> {
}

render() {
const { breakpoints, selectedSource, editor, sourceMetaData } = this.props;
const { breakpoints, selectedSource, editor } = this.props;

if (!selectedSource || !breakpoints || selectedSource.get("isBlackBoxed")) {
return null;
Expand All @@ -51,7 +50,6 @@ class Breakpoints extends Component<Props> {
key={makeLocationId(bp.location)}
breakpoint={bp}
selectedSource={selectedSource}
sourceMetaData={sourceMetaData}
editor={editor}
/>
);
Expand All @@ -64,8 +62,7 @@ class Breakpoints extends Component<Props> {
export default connect(
state => ({
breakpoints: getVisibleBreakpoints(state),
selectedSource: getSelectedSource(state),
sourceMetaData: getSourceMetaData(state, getSelectedSource(state).id)
selectedSource: getSelectedSource(state)
}),
dispatch => bindActionCreators(actions, dispatch)
)(Breakpoints);

0 comments on commit f57e6ef

Please sign in to comment.