mirror of https://github.com/Wilfred/difftastic/
Add support for QML
QML is a UI language, and its syntax is basically JSON-like structure + JavaScript. The tree-sitter parser is named after the upstream grammar file qmljs.g, but the canonical language name is QML. So I choose Qml as the Language enum. https://doc.qt.io/qt-6/qmlapplications.htmlpull/361/head
parent
79d594fc56
commit
84f0b25fb6
@ -0,0 +1,29 @@
|
|||||||
|
// Taken from https://doc.qt.io/qt-6/qmlapplications.html
|
||||||
|
import QtQuick 2.15
|
||||||
|
import QtQuick.Controls 2.15
|
||||||
|
|
||||||
|
ApplicationWindow {
|
||||||
|
width: 400
|
||||||
|
height: 400
|
||||||
|
visible: true
|
||||||
|
|
||||||
|
Button {
|
||||||
|
id: button
|
||||||
|
hoverEnabled: true
|
||||||
|
text: "A Special Button"
|
||||||
|
background: Rectangle {
|
||||||
|
implicitWidth: 100
|
||||||
|
implicitHeight: 40
|
||||||
|
color: {
|
||||||
|
if (button.down || button.hovered) {
|
||||||
|
"#d6d6d6"
|
||||||
|
} else {
|
||||||
|
"#f6f6f6"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
border.color: "#26282a"
|
||||||
|
border.width: button.down ? 2 : 1
|
||||||
|
radius: 4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
// Taken from https://doc.qt.io/qt-6/qmlapplications.html
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
|
||||||
|
ApplicationWindow {
|
||||||
|
width: 400
|
||||||
|
height: 400
|
||||||
|
visible: true
|
||||||
|
|
||||||
|
Button {
|
||||||
|
id: button
|
||||||
|
text: "A Special Button"
|
||||||
|
background: Rectangle {
|
||||||
|
implicitWidth: 100
|
||||||
|
implicitHeight: 40
|
||||||
|
color: button.down ? "#d6d6d6" : "#f6f6f6"
|
||||||
|
border.color: "#26282a"
|
||||||
|
border.width: 1
|
||||||
|
radius: 4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
../tree-sitter-qmljs/queries/highlights.scm
|
||||||
@ -0,0 +1 @@
|
|||||||
|
tree-sitter-qmljs/src
|
||||||
Loading…
Reference in New Issue