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

(WIP) call sites#3240

Merged
jasonLaster merged 10 commits into
firefox-devtools:masterfrom
jasonLaster:call-sites
Jul 10, 2017
Merged

(WIP) call sites#3240
jasonLaster merged 10 commits into
firefox-devtools:masterfrom
jasonLaster:call-sites

Conversation

@jasonLaster
Copy link
Copy Markdown
Contributor

@jasonLaster jasonLaster commented Jun 28, 2017

Opening an early PR, which we can collaborate on.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jun 29, 2017

Codecov Report

Merging #3240 into master will decrease coverage by 0.84%.
The diff coverage is 10.82%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #3240      +/-   ##
=========================================
- Coverage   49.35%   48.5%   -0.85%     
=========================================
  Files          99     100       +1     
  Lines        4156    4251      +95     
  Branches      856     876      +20     
=========================================
+ Hits         2051    2062      +11     
- Misses       2105    2189      +84
Impacted Files Coverage Δ
src/utils/editor/expression.js 0% <0%> (-4.35%) ⬇️
src/actions/navigation.js 12.5% <0%> (-0.84%) ⬇️
src/utils/parser/index.js 100% <100%> (ø) ⬆️
src/components/Editor/CallSites.js 2.12% <2.12%> (ø)
src/components/Editor/CallSite.js 4.65% <4.65%> (ø)
src/components/Editor/index.js 20.23% <71.42%> (+1.69%) ⬆️
src/utils/parser/getSymbols.js 94.66% <77.77%> (-1.11%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cb7eaf5...12ecc81. Read the comment docs.

Copy link
Copy Markdown
Contributor Author

@jasonLaster jasonLaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some comments, really close

Comment thread src/components/Editor/index.js Outdated
editor: this.editor && this.editor.codeMirror
})
);
);*/
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should remove the column breakpoints code here and the component

}

renderCallSites() {
const editor = this.editor;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets add the column bps feature flag here

Comment thread src/components/Editor/index.js Outdated

this.setState({ showCallSites: false });
}
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets move onKeyUp and onKeyDown to CallSites because we can :)

Comment thread src/components/Editor/index.js Outdated
let { key } = e;

if (key === "Alt") {
e.stopPropagation();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

others might handle this too so perhaps we dont want to stop propogation

Comment thread src/components/Editor/Editor.css Outdated

.call-sites {
outline: 1px solid #aed3ef;
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be in its own call-sites css file

Comment thread src/components/Editor/CallSites.js Outdated
const sourceId = selectedLocation && selectedLocation.sourceId;
const source = selectedSource && selectedSource.toJS();

getCallSiteBreakpoint = location => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be in its own helper

callSite => callSite.location.start.line === callSite.location.end.line
);

editor.codeMirror.operation(() => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure if this helped... lets look at the perf here. Maybe not a blocker, but nice

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i tot it did when we tested it, at the allhands ... i'll try it again

Comment thread src/utils/parser/getSymbols.js Outdated

if (t.isCallExpression(path)) {
const callee = path.node.callee;
const calleeNode = t.isMemberExpression(callee)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should exclude member expressions cause... well you know

Comment thread src/components/Editor/CallSite.js Outdated
this.clearCallSite();
}
}
// console.log(nextProps.showCallSite);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove console.log

Copy link
Copy Markdown
Contributor Author

@jasonLaster jasonLaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! one question about the snapshot though

[(2, 8), (2, 9)] [(2, 0), (2, 9)] c
[(2, 4), (2, 5)] [(2, 0), (2, 5)] b
call expressions
undefined
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like we might be getting the member expressions and not the call expressions with this change?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah .. yep!

key: index,
callSite,
editor,
breakpoint: callSite.breakpoint,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might not need to pull this in on its own since we have it on callSite

@jasonLaster
Copy link
Copy Markdown
Contributor Author

jasonLaster commented Jul 6, 2017

I made some progress on this today, but ultimately could not get it all the way there:

done:

  1. styling in light/dark theme
  2. bottom border uses ::before elements so they don't overlay
  3. callsites are associated with breakpoints
  4. fixed some mochitests

not done:

  1. removing a bp fails sometimes because we can't find the call site for a location...

@bomsy
Copy link
Copy Markdown
Contributor

bomsy commented Jul 10, 2017

looking into the failure on removing breakpoints might have an idea what the issue is ...

@jasonLaster jasonLaster merged commit e3c179a into firefox-devtools:master Jul 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants