feat(desktop): desktop parser and queries (#7282)

This commit is contained in:
Omar Valdez
2024-10-26 01:06:22 -07:00
committed by GitHub
parent 1d7c55f0bd
commit 0a9108a7e4
5 changed files with 114 additions and 0 deletions

View File

@@ -107,6 +107,9 @@
"dart": {
"revision": "9ac03bb2154316624fb4c41fe0f372a5f1597b43"
},
"desktop": {
"revision": "0d8b8cf7c9311fe3f1730df8e193d836f6dd9d1b"
},
"devicetree": {
"revision": "16c9cb959675bc9bc4f4e5bebe473d511a12a06d"
},

View File

@@ -365,6 +365,14 @@ list.dart = {
maintainers = { "@akinsho" },
}
list.desktop = {
install_info = {
url = "https://github.com/ValdezFOmar/tree-sitter-desktop",
files = { "src/parser.c" },
},
maintainers = { "@ValdezFOmar" },
}
list.devicetree = {
install_info = {
url = "https://github.com/joelspadin/tree-sitter-devicetree",

View File

@@ -0,0 +1 @@
(group) @fold

View File

@@ -0,0 +1,94 @@
(comment) @comment @spell
(group_name) @markup.heading
(entry
key: (identifier) @property)
(localized_key
name: (identifier) @property)
[
(language)
(country)
(encoding)
(modifier)
] @string.special
(string) @string
(escape_sequence) @string.escape
(field_code) @character.special
[
(true)
(false)
] @boolean
"=" @operator
[
";"
"_"
"."
"@"
] @punctuation.delimiter
[
"["
"]"
] @punctuation.bracket
; Especial entries
((entry
key: (identifier) @_key
value: (string) @type)
(#eq? @_key "Type")
(#any-of? @type "Application" "Link" "Directory"))
((entry
key: (identifier) @_key
value: (string) @number)
(#eq? @_key "Version"))
((entry
key: (identifier) @_key
value: (string) @string.special.path)
(#any-of? @_key "TryExec" "Path"))
((entry
key: (identifier) @_key
value: (string) @string.special.url)
(#eq? @_key "URL"))
; https://specifications.freedesktop.org/menu-spec/latest/category-registry.html
((entry
key: (identifier) @_key
value: (list
(string) @constant.builtin))
(#eq? @_key "Categories")
(#any-of? @constant.builtin
; Main categories
"AudioVideo" "Audio" "Video" "Development" "Education" "Game" "Graphics" "Network" "Office"
"Science" "Settings" "System" "Utility"
; Additional Categories
"Building" "Debugger" "IDE" "GUIDesigner" "Profiling" "RevisionControl" "Translation" "Calendar"
"ContactManagement" "Database" "Dictionary" "Chart" "Email" "Finance" "FlowChart" "PDA"
"ProjectManagement" "Presentation" "Spreadsheet" "WordProcessor" "2DGraphics" "VectorGraphics"
"RasterGraphics" "3DGraphics" "Scanning" "OCR" "Photography" "Publishing" "Viewer" "TextTools"
"DesktopSettings" "HardwareSettings" "Printing" "PackageManager" "Dialup" "InstantMessaging"
"Chat" "IRCClient" "Feed" "FileTransfer" "HamRadio" "News" "P2P" "RemoteAccess" "Telephony"
"TelephonyTools" "VideoConference" "WebBrowser" "WebDevelopment" "Midi" "Mixer" "Sequencer"
"Tuner" "TV" "AudioVideoEditing" "Player" "Recorder" "DiscBurning" "ActionGame" "AdventureGame"
"ArcadeGame" "BoardGame" "BlocksGame" "CardGame" "KidsGame" "LogicGame" "RolePlaying" "Shooter"
"Simulation" "SportsGame" "StrategyGame" "Art" "Construction" "Music" "Languages"
"ArtificialIntelligence" "Astronomy" "Biology" "Chemistry" "ComputerScience" "DataVisualization"
"Economy" "Electricity" "Geography" "Geology" "Geoscience" "History" "Humanities"
"ImageProcessing" "Literature" "Maps" "Math" "NumericalAnalysis" "MedicalSoftware" "Physics"
"Robotics" "Spirituality" "Sports" "ParallelComputing" "Amusement" "Archiving" "Compression"
"Electronics" "Emulator" "Engineering" "FileTools" "FileManager" "TerminalEmulator" "Filesystem"
"Monitor" "Security" "Accessibility" "Calculator" "Clock" "TextEditor" "Documentation" "Adult"
"Core" "KDE" "COSMIC" "GNOME" "XFCE" "DDE" "GTK" "Qt" "Motif" "Java" "ConsoleOnly"
; Reserved
"Screensaver" "TrayIcon" "Applet" "Shell"))

View File

@@ -0,0 +1,8 @@
((comment) @injection.content
(#set! injection.language "comment"))
((entry
key: (identifier) @_exec
value: (string) @injection.content)
(#eq? @_exec "Exec")
(#set! injection.language "bash"))