Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beautifier makes JavaScript syntax invalid (QML) #876

Open
spkjp opened this issue Feb 16, 2016 · 3 comments
Open

Beautifier makes JavaScript syntax invalid (QML) #876

spkjp opened this issue Feb 16, 2016 · 3 comments

Comments

@spkjp
Copy link

spkjp commented Feb 16, 2016

Original: Glavin001/atom-beautify#810

The beautifier makes this code invalid:

.pragma library
.import "../Constants.js" as Constants

var MyClass = {

something: function() {
console.log(Constants.Bla);
}
}

The above code is pretty common among QML.
http://doc.qt.io/qt-5/qtqml-javascript-imports.html#importing-a-javascript-resource-from-another-javascript-resource

@bitwiseman
Copy link
Member

But .import isn't javascript syntax, is it?

@spkjp
Copy link
Author

spkjp commented Feb 23, 2016

Yes, that's correct. But I think it should be supported, because there is no alternative besides using QtCreator.

If that's not good enough, how about exposing it via a "QML compatibilty" setting. This way nothing is changed by default and everyone can be happy. :p

@bitwiseman bitwiseman added this to the Future milestone Feb 23, 2016
@bitwiseman bitwiseman changed the title Beautifier makes JavaScript syntax invalid Beautifier makes JavaScript syntax invalid (QML) Feb 23, 2016
@bitwiseman
Copy link
Member

No small undertaking from what I can see. I'll keep it as an enhancement, but I won't have the bandwidth for it anytime soon. You are welcome to provide a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants