Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Pique.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
A400000000000004 /* FormattingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D300000000000004 /* FormattingTests.swift */; };
A400000000000005 /* HTMLTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D300000000000005 /* HTMLTests.swift */; };
A400000000000006 /* HighlightIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D300000000000006 /* HighlightIntegrationTests.swift */; };
A10000000000000B /* AppearanceSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = D10000000000000A /* AppearanceSettings.swift */; };
A20000000000000B /* AppearanceSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = D10000000000000A /* AppearanceSettings.swift */; };
A10000000000000C /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D10000000000000B /* SettingsView.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -74,6 +77,8 @@
D300000000000004 /* FormattingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormattingTests.swift; sourceTree = "<group>"; };
D300000000000005 /* HTMLTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTMLTests.swift; sourceTree = "<group>"; };
D300000000000006 /* HighlightIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HighlightIntegrationTests.swift; sourceTree = "<group>"; };
D10000000000000A /* AppearanceSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppearanceSettings.swift; sourceTree = "<group>"; };
D10000000000000B /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -117,6 +122,7 @@
children = (
D100000000000001 /* PiqueApp.swift */,
D100000000000002 /* ContentView.swift */,
D10000000000000B /* SettingsView.swift */,
D100000000000003 /* Assets.xcassets */,
D100000000000004 /* Pique.entitlements */,
);
Expand All @@ -138,6 +144,7 @@
children = (
D100000000000008 /* SyntaxHighlighter.swift */,
D100000000000009 /* FileReader.swift */,
D10000000000000A /* AppearanceSettings.swift */,
);
path = Shared;
sourceTree = "<group>";
Expand Down Expand Up @@ -296,8 +303,10 @@
files = (
A100000000000001 /* PiqueApp.swift in Sources */,
A100000000000002 /* ContentView.swift in Sources */,
A10000000000000C /* SettingsView.swift in Sources */,
A100000000000005 /* SyntaxHighlighter.swift in Sources */,
A100000000000007 /* FileReader.swift in Sources */,
A10000000000000B /* AppearanceSettings.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -308,6 +317,7 @@
A200000000000004 /* PreviewProvider.swift in Sources */,
A200000000000006 /* SyntaxHighlighter.swift in Sources */,
A200000000000008 /* FileReader.swift in Sources */,
A20000000000000B /* AppearanceSettings.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
21 changes: 21 additions & 0 deletions PiquePreview/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,24 @@
</array>
</dict>
</dict>
<dict>
<key>UTTypeIdentifier</key>
<string>io.macadmins.pique.ndjson</string>
<key>UTTypeDescription</key>
<string>Newline Delimited JSON</string>
<key>UTTypeConformsTo</key>
<array>
<string>public.plain-text</string>
</array>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>ndjson</string>
<string>jsonl</string>
</array>
</dict>
</dict>
</array>
<key>NSExtension</key>
<dict>
Expand All @@ -106,6 +124,7 @@
<key>QLSupportedContentTypes</key>
<array>
<string>public.json</string>
<string>io.macadmins.pique.ndjson</string>
<string>public.yaml</string>
<string>public.xml</string>
<string>io.toml</string>
Expand All @@ -131,6 +150,8 @@
<key>QLFileExtensions</key>
<array>
<string>json</string>
<string>ndjson</string>
<string>jsonl</string>
<string>yaml</string>
<string>yml</string>
<string>toml</string>
Expand Down
2 changes: 1 addition & 1 deletion PiquePreview/PreviewProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class PreviewProvider: NSViewController, QLPreviewingController {
/// Maps a file extension to a format group name matching AppearanceSettings keys.
private static func formatName(for ext: String) -> String {
switch ext.lowercased() {
case "json": return "JSON"
case "json", "ndjson", "jsonl": return "JSON"
case "yaml", "yml": return "YAML"
case "toml", "lock": return "TOML"
case "xml", "recipe": return "XML"
Expand Down
2 changes: 2 additions & 0 deletions PiqueTests/FileFormatTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ final class FileFormatTests: XCTestCase {

func testJSON() {
XCTAssertEqual(FileFormat(pathExtension: "json"), .json)
XCTAssertEqual(FileFormat(pathExtension: "ndjson"), .json)
XCTAssertEqual(FileFormat(pathExtension: "jsonl"), .json)
}

func testYAML() {
Expand Down
2 changes: 1 addition & 1 deletion Shared/SyntaxHighlighter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ enum FileFormat {

init?(pathExtension: String) {
switch pathExtension.lowercased() {
case "json": self = .json
case "json", "ndjson", "jsonl": self = .json
case "yaml", "yml": self = .yaml
case "toml", "lock": self = .toml
case "xml", "recipe": self = .xml
Expand Down
Loading