This would be awesome.
https://github.com/Glavin001/atom-beautify/wiki/Requesting-support-for-a-new-language
Do you know where I could find more information about QML?
https://en.wikipedia.org/wiki/QML
Assuming that is the same language it looks similar to JSON, except new line characters or semicolons separate list items instead of commas. Provided the syntax is as clean and minimal as confined to those code samples and there is not grammar dependent variance an existing JSON beautifier could be modified to support this language. This is not on my agenda though.
I would like to request this enhancement as well.
The only beautifier I know of is located in QT Creator at:
Tools->QML/JS->Reformat file
It almost work in fact, I notice that ending each line with ";" give expected result with javascript model.
But ending ; is optional in qml ...
Is there guide lines to implement / contribute a new model into prettydiff ?
@vrince No, I have failed to write contribution documentation. I need to write this and it to the project's documentation page.
I would need to write a new option for the tool so that the application specifically knows the language is QML. This would allow me to write custom extensions without massive regression into everything else.
The key technical qualities to consider
I do have a question though. Look at the first example at https://en.wikipedia.org/wiki/QML#States Do you see that a block is declared to states: with a colon where the other block declarations do not have a colon. What does this mean? I gather from the text that it is a declaration of states which is probably a sort of dynamic or transitive typing compared to the other declarations.
@prettydiff qml allow list of children (massively use in qt3d project for example)
see for exemaple : http://doc.qt.io/qt-5/qt3drenderer-scene3d-animatedentity-qml.html
...
Entity {
id: sphereEntity
components: [ sphereMesh, material, sphereTransform ]
}
Note: qml allow shader / js code as string do you think this could be complex to handle ?
Exemple : http://doc.qt.io/qt-5/qt3drenderer-deferred-renderer-qml-sceneeffect-qml.html
(See vertexShaderCode: ...)
@vrince Those strings would be something else to account for. They are multiline strings. Normally I would identify such as a parse error, because they are a parse error in JavaScript. I could extend the code to support this though.
@vrince Could you move all further discussion to https://github.com/prettydiff/prettydiff/issues/278 so that I can these technical items when I start working on this.
would love to see this
would also like this
QML support is added to the 2.1.0 branch of prettydiff if you guys would like to test it out. Be sure to use the option qml.
Also, if anybody does decide to play with this would you mind providing some code samples for unit tests. I really only looked at the examples on Github, so this could be missing all kinds of support.
Awesome thank you, will check it out!
Il 29 giu 2016 1:23 AM, "Austin Cheney" [email protected] ha
scritto:
QML support is added to the 2.1.0 branch of prettydiff if you guys would
like to test it out.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Glavin001/atom-beautify/issues/541#issuecomment-229213822,
or mute the thread
https://github.com/notifications/unsubscribe/AHyhsdB1at3QJGYgLqNbT4f_ZH-29zzCks5qQa0FgaJpZM4F6Sff
.
Nice ! testing it today :)
After a couple a runs I already can say that :
1) [] are not so well handled. There is a confusion between component list (that can be separate by a new line, an option for that could be nice) and item access like vector[i] where new line does not make sens.
example :
camera.upVector = Qt.vector3d(up[0], up[1], up[2]);`
ends like :
camera.upVector = Qt.vector3d(up[0
], up[1
], up[2
])
2) Component list first line is remove :
components: [
RenderSettings {
ends like :
components: [RenderSettings {
There is also a {} issue, it seems that valid code end behind miss indented (and not indented at all) at some point when you run beautifier more than once on the very file attached to this comment ...
SimpleSceneEntry.txt (.qml renamed to .txt to make github happy)
I am running:
node api/node-local.js source:SimpleSceneEntry.qml mode:beautify readmethod:file output:SimpleSceneEntry.qml qml:true vertical:none wrap:-1 quoteConvert:double
I can not reproduce the latest defects as mentioned in https://github.com/Glavin001/atom-beautify/issues/541#issuecomment-229400911 and the latest version of Pretty Diff recently landed in Atom Beautify.
Most helpful comment
QML support is added to the 2.1.0 branch of prettydiff if you guys would like to test it out. Be sure to use the option
qml.Also, if anybody does decide to play with this would you mind providing some code samples for unit tests. I really only looked at the examples on Github, so this could be missing all kinds of support.