Giter VIP home page Giter VIP logo

Comments (4)

fmvilas avatar fmvilas commented on August 18, 2024 1

Hi @tswaters. Thanks for opening the issue. Honestly, I don't think the problem is related to the library. You said:

So, my IDE really doesn't like it when I look at these template js files - it whines and complains about syntax errors and it's really hard to see where real problems are.

What you're describing is a problem with your IDE. Please, open an issue in their repo.

Thank you!

from swagger-node-codegen.

tswaters avatar tswaters commented on August 18, 2024

For posterity -- this can be accomplished with npm scripts and a bit of bash --

"pregenerate": "rimraf ./stub",
"generate": "snc --templates ./template --output ./stub path/to/swagger.yml",
"postgenerate": "for file in ./stub/*.hbs; do mv \"$file\" \"./stub/$(basename \"$file\" .hbs).js\"; done"

Not the cleanest, nor cross-platform but it works for my use case.

from swagger-node-codegen.

tswaters avatar tswaters commented on August 18, 2024

Hey {IDE Maintainer}, can you treat js files as handlebar templates ?

I'm fairly sure that this type of things crops up in pretty much any ide with filetype recognition and syntax highlighting. Baring any pre-existing configuration option to interpret certain files as different types (I know intellij can do this, still a pain to configure), I'm fairly certain any issue I add would fall on deaf ears.

The workaround I have works well for me, so I'll continue to use it.

It would be great if there was an option for this. Right now the UX of this tool leaves a bit to be desired.... when you open one of these template js files in an IDE, do you just ignore all the underlines and syntax errors? Drives me bonkers looking at them.

from swagger-node-codegen.

fmvilas avatar fmvilas commented on August 18, 2024

What can I say, man? Just see how it looks like in Atom:

Using JS syntax:
screen shot 2018-10-24 at 21 24 29

Using Handlebars syntax:
screen shot 2018-10-24 at 21 25 07

It's not the problem of a library that your IDE doesn't colour syntax correctly. It's like when you have HTML + CSS + JS in a single file and the file extension is .html. Your IDE still works, right? Go blame them or just use another editor. For sure it's not the problem of this or any other library.

Right now the UX of this tool leaves a bit to be desired...

Obviously. It's free, open source and done on my spare time. There are plenty of paid code generators out there. Feel free.

from swagger-node-codegen.

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.