Git Product home page Git Product logo

Comments (2)

iiian avatar iiian commented on July 20, 2024 1

I think it might be possible to create an extension that calls a cli function, but having a proper function that transforms the input into an output (without directly writing to the filesystem) would allow for the vscode.languages.registerDocumentFormattingEditProvider to work its magic using the buffer rather than going through a terminal command.

Have you tried just doing like spawnSync and invoking prisma-case-format with the --dry-run flag? --dry-run should spit out the contents to stdout

Seems like a nifty idea to make prisma-case-format a drop-in replacement for prisma format. Unfortunately, I don't have the time or expertise to build anything like that, however you're totally welcome to make a PR for this and your other suggestion, and I'll get it merged in.

from prisma-case-format.

V-ed avatar V-ed commented on July 20, 2024

Running the cli through a spawn process programmatically is indeed a solution (that I use myself in my projects for other stuff) but is a bit overkill, espeically when you already have all the necessary code to not have to do it through a cli.

I'm not saying get rid of the cli (although I don't think that's what you think I'm saying), but allowing to call the formatter in a programmatic way would be beneficial for performances inside (for exemple) a vscode extension.

I'd be happy to try and make a PR describing what I'm saying, I'll see how much time in have in the coming weeks!

from prisma-case-format.

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.