Skip to content

Commit 0cccb92

Browse files
committed
Azkaban .flow support, Kotlin bugfix, better support for dynamic UTI, fixed folder settings.
1 parent 272acc1 commit 0cccb92

14 files changed

+253
-41
lines changed

Application/CustomTypeViewController.swift

+22-3
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@ class UTIStatus {
3535
var supported: UTISupported = .unknown
3636
let standard: Bool
3737
var recognized: String?
38+
var isMain: Bool
3839

3940
init(UTI: UTI, standard: Bool) {
4041
self.UTI = UTI
4142
self.standard = standard
4243
self.recognized = nil
44+
self.isMain = false
4345
}
4446
}
4547

@@ -126,7 +128,13 @@ class CustomTypeViewController: NSViewController, DropSensorDelegate, NSTableVie
126128
self.supportedLegend.isHidden = true
127129
if (self.UTIs.count > 0) {
128130
for (i, uti) in self.UTIs.enumerated() {
129-
let syntax = HighlightWrapper.shared.areSomeSyntaxSupported(extensions: uti.UTI.extensions)
131+
var syntax: String?
132+
if let u = SCSHWrapper.shared.settings?.searchStandaloneUTI(for: uti.UTI), let s = SCSHWrapper.shared.settings?.utiSettings[u] {
133+
syntax = s.syntax.isEmpty ? s.specialSyntax : s.syntax
134+
}
135+
if syntax == nil {
136+
syntax = HighlightWrapper.shared.areSomeSyntaxSupported(extensions: uti.UTI.extensions)
137+
}
130138

131139
if let _ = handledUTIs.first(where: { $0.UTI == uti.UTI.UTI }) {
132140
uti.supported = .yes
@@ -213,6 +221,17 @@ class CustomTypeViewController: NSViewController, DropSensorDelegate, NSTableVie
213221
}
214222
}
215223
}
224+
225+
if let u = SCSHWrapper.shared.settings?.searchUTI(for: url), UTIs.first(where: { $0.UTI.UTI == u }) == nil {
226+
UTIs.append(UTIStatus(UTI: UTI(u), standard: true))
227+
}
228+
229+
if let uti = SCSHWrapper.shared.settings?.searchUTI(for: url) {
230+
for u in UTIs {
231+
u.isMain = u.UTI.UTI == uti
232+
}
233+
}
234+
216235
self.UTIs = UTIs
217236
mode = .info
218237
firstDrop = false
@@ -252,7 +271,7 @@ class CustomTypeViewController: NSViewController, DropSensorDelegate, NSTableVie
252271

253272
let labelFont = NSFont.labelFont(ofSize: NSFont.systemFontSize)
254273
let font: NSFont
255-
if uti.standard {
274+
if uti.standard || uti.isMain {
256275
font = NSFont.boldSystemFont(ofSize: NSFont.systemFontSize)
257276
} else {
258277
font = labelFont
@@ -261,7 +280,7 @@ class CustomTypeViewController: NSViewController, DropSensorDelegate, NSTableVie
261280
let view = tableView.makeView(withIdentifier: tableColumn.identifier, owner: self) as! NSTableCellView
262281

263282
if tableColumn.identifier == NSUserInterfaceItemIdentifier("description") {
264-
view.textField?.stringValue = uti.UTI.description //NSAttributedString(string: uti.UTI.description, attributes: [NSAttributedString.Key.font: font])
283+
view.textField?.stringValue = uti.UTI.description + (uti.isMain ? " [main]" : "")
265284
view.textField?.font = font
266285
} else if tableColumn.identifier == NSUserInterfaceItemIdentifier("UTI") {
267286
view.textField?.stringValue = uti.UTI.UTI // NSAttributedString(string: uti.UTI.UTI, attributes: [NSAttributedString.Key.font: font])

Application/Info.plist

+19
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@
177177
<key>UTTypeConformsTo</key>
178178
<array>
179179
<string>dyn.ah62d4rv4ge80w5pq</string>
180+
<string>public.xml</string>
180181
</array>
181182
<key>UTTypeDescription</key>
182183
<string>JetBrain Project File</string>
@@ -349,6 +350,24 @@
349350
</array>
350351
</dict>
351352
</dict>
353+
<dict>
354+
<key>UTTypeConformsTo</key>
355+
<array>
356+
<string>public.item</string>
357+
<string>dyn.ah62d4rv4ge80q5dts6</string>
358+
</array>
359+
<key>UTTypeDescription</key>
360+
<string>Azkaban flow file</string>
361+
<key>UTTypeIdentifier</key>
362+
<string>io.azkaban.flow</string>
363+
<key>UTTypeTagSpecification</key>
364+
<dict>
365+
<key>public.filename-extension</key>
366+
<array>
367+
<string>flow</string>
368+
</array>
369+
</dict>
370+
</dict>
352371
<dict>
353372
<key>UTTypeConformsTo</key>
354373
<array>

Application/Storyboard.storyboard

+10-10
Original file line numberDiff line numberDiff line change
@@ -1726,18 +1726,18 @@ Gw
17261726
<autoresizingMask key="autoresizingMask"/>
17271727
<subviews>
17281728
<tabView type="noTabsNoBorder" initialItem="XZD-Za-R2F" translatesAutoresizingMaskIntoConstraints="NO" id="yf8-26-da4">
1729-
<rect key="frame" x="20" y="42" width="190" height="108"/>
1729+
<rect key="frame" x="20" y="42" width="150" height="108"/>
17301730
<font key="font" metaFont="system"/>
17311731
<tabViewItems>
17321732
<tabViewItem label="Info" identifier="1" id="BDw-pS-ctH">
17331733
<view key="view" id="1Qe-rv-bvb">
1734-
<rect key="frame" x="0.0" y="0.0" width="190" height="108"/>
1734+
<rect key="frame" x="0.0" y="0.0" width="150" height="108"/>
17351735
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
17361736
<subviews>
17371737
<scrollView verticalHuggingPriority="249" autohidesScrollers="YES" horizontalLineScroll="24" horizontalPageScroll="10" verticalLineScroll="24" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="g6Z-24-Lb1">
1738-
<rect key="frame" x="0.0" y="8" width="190" height="100"/>
1738+
<rect key="frame" x="0.0" y="8" width="150" height="100"/>
17391739
<clipView key="contentView" id="iZK-GA-Mdy">
1740-
<rect key="frame" x="1" y="1" width="188" height="98"/>
1740+
<rect key="frame" x="1" y="1" width="148" height="98"/>
17411741
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
17421742
<subviews>
17431743
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="firstColumnOnly" alternatingRowBackgroundColors="YES" columnReordering="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="24" rowSizeStyle="systemDefault" headerView="8yk-fc-LyJ" viewBased="YES" floatsGroupRows="NO" id="QJA-Al-xiu">
@@ -1931,8 +1931,8 @@ Gw
19311931
<constraints>
19321932
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="100" id="Q50-aN-Fqg"/>
19331933
</constraints>
1934-
<scroller key="horizontalScroller" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="cxD-Ri-4PX">
1935-
<rect key="frame" x="1" y="83" width="188" height="16"/>
1934+
<scroller key="horizontalScroller" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="0.96907216494845361" horizontal="YES" id="cxD-Ri-4PX">
1935+
<rect key="frame" x="1" y="83" width="148" height="16"/>
19361936
<autoresizingMask key="autoresizingMask"/>
19371937
</scroller>
19381938
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="YWW-1r-RSi">
@@ -1945,7 +1945,7 @@ Gw
19451945
</tableHeaderView>
19461946
</scrollView>
19471947
<stackView distribution="fill" orientation="vertical" alignment="leading" spacing="2" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" horizontalHuggingPriority="248" verticalCompressionResistancePriority="751" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="LN0-No-4rj">
1948-
<rect key="frame" x="0.0" y="0.0" width="190" height="0.0"/>
1948+
<rect key="frame" x="0.0" y="0.0" width="150" height="0.0"/>
19491949
<subviews>
19501950
<customView hidden="YES" horizontalHuggingPriority="249" translatesAutoresizingMaskIntoConstraints="NO" id="NTW-ED-Wlb">
19511951
<rect key="frame" x="0.0" y="-24" width="441" height="24"/>
@@ -2113,7 +2113,7 @@ Gw
21132113
</connections>
21142114
</button>
21152115
<button hidden="YES" horizontalHuggingPriority="750" verticalHuggingPriority="750" horizontalCompressionResistancePriority="751" translatesAutoresizingMaskIntoConstraints="NO" id="M2G-e2-cz7">
2116-
<rect key="frame" x="109" y="11" width="47" height="19"/>
2116+
<rect key="frame" x="69" y="11" width="47" height="19"/>
21172117
<buttonCell key="cell" type="roundRect" title="Reset" bezelStyle="roundedRect" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="zNC-OM-zKs">
21182118
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
21192119
<font key="font" metaFont="cellTitle"/>
@@ -2126,7 +2126,7 @@ Gw
21262126
</connections>
21272127
</button>
21282128
<button horizontalHuggingPriority="750" verticalHuggingPriority="750" horizontalCompressionResistancePriority="751" translatesAutoresizingMaskIntoConstraints="NO" id="3sr-Ox-rDc">
2129-
<rect key="frame" x="164" y="11" width="46" height="19"/>
2129+
<rect key="frame" x="124" y="11" width="46" height="19"/>
21302130
<buttonCell key="cell" type="roundRect" title="Close" bezelStyle="roundedRect" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="PjX-zl-aBO">
21312131
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
21322132
<font key="font" metaFont="cellTitle"/>
@@ -2139,7 +2139,7 @@ Gw
21392139
</connections>
21402140
</button>
21412141
<customView translatesAutoresizingMaskIntoConstraints="NO" id="8JB-ZI-4t4" customClass="DropSensor" customModule="Syntax_Highlight" customModuleProvider="target">
2142-
<rect key="frame" x="0.0" y="0.0" width="230" height="162"/>
2142+
<rect key="frame" x="0.0" y="0.0" width="190" height="162"/>
21432143
</customView>
21442144
</subviews>
21452145
<constraints>

Application/UTIsListView.swift

+10-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,16 @@ class UTIsListView: NSView, SettingsSplitViewElement {
123123
contentView.autoresizingMask = [.width, .height]
124124

125125
// Populate UTIs list.
126-
allFileTypes = (NSApplication.shared.delegate as? AppDelegate)?.handledUTIs ?? []
126+
allFileTypes = ((NSApplication.shared.delegate as? AppDelegate)?.handledUTIs ?? []).filter({ uti in
127+
guard uti.isDynamic, let settings = SCSHWrapper.shared.settings else {
128+
return true
129+
}
130+
if let _ = settings.searchStandaloneUTI(for: uti) {
131+
return false
132+
} else {
133+
return true
134+
}
135+
})
127136

128137
showCustomizedMenuItem.state = filterOnlyChanged ? .on : .off
129138
showInacessibileMenuItem.state = filterInacessibile ? .on : .off

Application/resources/defaults/dyn.ah62d4rv4ge81a6xtsbw1e7dmqz3u.plist

-8
This file was deleted.

Application/resources/defaults/dyn.ah62d4rv4ge80w5pq.plist renamed to Application/resources/defaults/io.azkaban.flow.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
<plist version="1.0">
44
<dict>
55
<key>syntax</key>
6-
<string>xml</string>
6+
<string>yaml</string>
77
</dict>
88
</plist>

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
Changelog
22
=======
33

4+
### 2.0.9
5+
New features:
6+
- Support for Azkaban `.flow` files rendered as _`YAML`_.
7+
- Better support for dynamic UTI.
8+
Bugfix:
9+
- Fix Kotlin support.
10+
- Fix generation of settings folder.
11+
12+
413
### 2.0.8
514
New features:
615
- Experimental support for Racket files (`.rkt`) rendered as _`Lisp`_.

QLExtension/Info.plist

+3
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
<string>com.unknown.lhs</string>
7777
<string>com.symfony.twig</string>
7878
<string>edu.uo.texshop.tex</string>
79+
<string>io.azkaban.flow</string>
7980
<string>org.applescript.source</string>
8081
<string>org.arduino.ino-source</string>
8182
<string>org.arduino.source</string>
@@ -186,6 +187,7 @@
186187
<string>tk.tcl.tcl</string>
187188
<string>tk.tcl.tcl-source</string>
188189
<string>dyn.ah62d4rv4ge8007a</string>
190+
<string>dyn.ah62d4rv4ge8007dx</string>
189191
<string>dyn.ah62d4rv4ge80c75p</string>
190192
<string>dyn.ah62d4rv4ge80g62</string>
191193
<string>dyn.ah62d4rv4ge80s52</string>
@@ -206,6 +208,7 @@
206208
<string>dyn.ah62d4rv4ge80g5dnqq</string>
207209
<string>dyn.ah62d4rv4ge81u2prru</string>
208210
<string>dyn.ah62d4rv4ge81a6xtsbw1e7dmqz3u</string>
211+
<string>dyn.ah62d4rv4ge80q5dts6</string>
209212
</array>
210213
<key>QLSupportsSearchableItems</key>
211214
<false/>

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ On _**MacOS 11 Big Sur**, the system allows you to manage these previously unaut
6565
- Adobe JSX script files (`.jsx`)
6666
- AppleScript (`.scpt`, `.applescript`, `.ascr`) _automatically decompiled with `osadecompile`_
6767
- Assembler source files (`.s79`)
68+
- Azkaban flow files (`.flow`) as _`YAML`_
6869
- ATL files (`.atl`)
6970
- Bash Script files (`.bash`)
7071
- C Shell script files (`.csh`)

0 commit comments

Comments
 (0)