question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exposing the lookup of (x,y) pixel coordinates to corresponding activeTextEditor (line,col)

See original GitHub issue

Problem Description (all platforms, all versions) We are in the process of developing a plugin for our eye tracking infrastructure (iTrace) for vscode. This plugin we call iTrace-vscode will let us track a developer’s eyes 👀 on specific code elements while they are working on a software task. iTrace is a client server architecture where the server sends eye tracking data to the client (in this case is vscode). The client in turn takes the raw gaze which is usually a (x,y) pixel coordinate and maps it to the line and col that pixel falls on. Please see www.i-trace.org for more details. We have plugins currently for Eclipse, Visual Studio, and Atom that are already implemented in this case.

When we tried to do this for vscode. We hit a roadblock. Here is how I can best describe it:

vscode provides us with a vscode.window.activeTextEditor?.visibleRanges[0]; call, which gives us the lines of text that are currently on screen. However, we have no way to then get info from pixel measurements. vscode seems to have no API features that give information about pixel locations or measurements. If you are able to add a function call to vscode.window.activeTextEditor or something in the visibleRanges for us to give (x,y) info and get back the (line,column) data, we would be golden.

Visual Studio exposes this functionality so we do have a plugin for that at https://github.com/iTrace-Dev/iTrace-VisualStudio. However, we have had numerous requests from the software engineering research and industry community to enable eye tracking in vscode because it is considered to be the primary IDE for developers. iTrace-Atom supports this functionality however since it is being sunsetted, vscode becomes our only option moving forward. Since both are based on Electron, is there a reason this API call is unavailable? Can we somehow use a API call to get the line and col info we need. Thanks so much. 🙏 👁️

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:29
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
VSCodeTriageBotcommented, Oct 11, 2022

🙂 This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

0reactions
isidorncommented, Dec 12, 2022

@shbonita thanks for the clarification, but there is no API to achieve this, and neither is there a workaround. I understand you want the API to be read-only, but there are no plans to add this functionality for now.

If I remember correctly, I think you want to do more precise user studies. For those user studies you could create a fork of VS Code which exposes this API for example.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Finding pixel location in raster using coordinates?
I have a big rasters and a list of thousands of coordinates. I need to find the pixel location corresponding to a given...
Read more >
Google Maps: Get click or marker (x,y) pixel coordinates inside ...
Is it possible to get the markers pixel position inside of the marker click function, and suppress the normal infowindow to show the...
Read more >
Image Coordinate Systems - MATLAB & Simulink - MathWorks
This spatial coordinate system corresponds to the image's pixel indices. The intrinsic coordinates (x,y) of the center point of any pixel are identical...
Read more >
Pixels, Coordinates, and Colors
In canvas graphics, integer coordinates corresponding to the lines between pixels, but when a one-pixel line is drawn, it extends one-half pixel on...
Read more >
Finding corresponding xyz point in the point cloud topic to the ...
I want to take the x, y pixel positions and find the corresponding x,y, z in the point cloud. I am writing this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found