Code Monkey home page Code Monkey logo

Comments (4)

najadojo avatar najadojo commented on May 29, 2024

I think this going to be a "won't fix". If you want a hover image just release the Ctrl and you'll get the normal image preview. onDefinition doesn't give any context about how its being used so changing behavior isn't possible. Its actually pretty hacky to get what we have working well as the system is built around navigating and presenting text documents.

from gltf-vscode.

lexaknyazev avatar lexaknyazev commented on May 29, 2024

Sorry, I don't quite understand.
It's possible to Ctrl-hover over, e.g., Draco pointers and see some values in tool-tips. Ctrl-click opens a full list of values in a new document. Why can't image URIs behave the same way?

from gltf-vscode.

najadojo avatar najadojo commented on May 29, 2024

VSCode's onDefinition system provides a document URI and a cursor location and it expects a URI and a cursor location back. For JSON definition this works pretty simply; we use the same URI and find the location of the pointed to object. For data buffers we craft a new data URI which includes information on what accessor is under the cursor. The protocol handler for that data URI transforms the accessor into a new text document and VSCode shows this content where appropriate. For images the same type of data URI is constructed but we can't present text; we need to command VSCode to open a tab and show the image in an HTML page. We had in previous revisions of the extension just returned a URI directly to the image (which is what you see when hovering with out Ctrl). VSCode limits the size of images it will open in this way to 1MB and as you can see with the hover doesn't scale the image so you can see the whole thing in the editor window.

I can open an feature request with VSCode to allow definitions to return an HTML document. With this capability we'd be much more able to handle all the cases as expected.

from gltf-vscode.

emackey avatar emackey commented on May 29, 2024

Can't reproduce this anymore. I think it was fixed upstream.

from gltf-vscode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.