Comments (4)
(this is only the case if the calls are not selected (not blue))
from theseus.
I thought I'd fixed this really early on! Let me check it out and see what's regressed. Thanks for the report.
from theseus.
You're using Brackets 0.41, right?
from theseus.
I think I can reproduce the problem.
-
Put this in
foobar.js
:setTimeout(foobar, 3000); // ... lots of blank lines ... function foobar() {}
-
Open
foobar.js
in Brackets with Theseus. -
Run
node-theseus foobar.js
. -
Right away, scroll to the bottom in Brackets to see "0 calls" next to
foobar()
. Then immediately scroll up to the top. -
Wait 3 seconds.
-
Scroll down to the definition of
foobar()
.
Expected: it says "1 call" next to foobar()
.
Actual: it says "0 calls" next to foobar()
.
If you skip step 4, it says "1 call" as expected.
Diagnosis
CodeMirror removes those call count pills from the DOM for efficiency as you scroll around. When Theseus does a batch update of all the hit counts, it minimizes DOM access by only updating counts for the functions that have been called since the last update. But it also checks for pills that have been added back by CodeMirror to give them their most up-to-date value, even if the corresponding functions weren't called in the current batch.
It has to do that because it used to be that, when CodeMirror re-added a pill, it inserted the HTML that was originally used to create it, so any changes (such as updating the number and changing the style) were reversed. Theseus took advantage of that by adding an "uninitialized" class to that initial HTML, so it could find re-added pills by looking for nodes with the "uninitialized" class.
My theory is that the latest CodeMirror actually adds the original DOM node back (with all subsequent changes) instead of creating a new node with the original HTML. That explains why it works if you don't scroll far enough for the pill to be on the screen and have its "uninitialized" flag cleared, but doesn't work if you do scroll down.
If the theory is correct, then instead of looking up DOM nodes by ID to update them (which I only did because CodeMirror would destroy and recreate the nodes whenever it felt like it), Theseus can retain a pointer to the DOM nodes for the pills and update them directly, always.
Time to experiment!
from theseus.
Related Issues (20)
- 0 calls highlight is not visible with "Brackets Dark" theme HOT 1
- PreferencesManager.convertPreferences() is deprecated HOT 1
- Support for Web Workers HOT 1
- Will this work with Meteor.js HOT 5
- Websocket connection failed HOT 9
- Exception in 'editorChange' listener on
- node-theseus and grunt HOT 2
- Theseus's developer is AFK until August 14 :) HOT 1
- Can I use theseus + brackets without Live Preview?
- Adding Function Runtime
- Calls Label Disappearing
- es6 arrow operator not working HOT 4
- Clicking on calls doesnt open log tab
- Empty log when using Theseus HOT 6
- Launching live preview fails in brackets 1.7 with theseus 0.4.19
- Theseus dead? HOT 1
- Installation fails from Brackets IDE HOT 3
- Live preview highlight not working.
- Cannot install on Windows 10 HOT 5
- Th
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from theseus.