Skip to content

Commit

Permalink
Prepare usd stage directly on code editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
furby-tm committed May 6, 2024
1 parent fe1d40b commit 53b7d46
Show file tree
Hide file tree
Showing 16 changed files with 101 additions and 264 deletions.
12 changes: 12 additions & 0 deletions Kraken.usda
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,15 @@
doc = "Kraken v1.0.9 | 05-05-2024 16:14:40"
)

def Xform "Geometry"
{
float3 xformOp:scale = (5, 5, 5)
double3 xformOp:translate = (0, 5, 0)
uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:scale"]

def Capsule "Sphere"
{
double3 xformOp:translate = (0, 0, -3)
uniform token[] xformOpOrder = ["xformOp:translate"]
}
}
197 changes: 4 additions & 193 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,33 +1,6 @@
{
"originHash" : "579da1f85513431c3cbcae720a302076397b2fc67818151c52f67e282bf3640b",
"originHash" : "e786d580815d634c789f07dfa2930a1d775f5bc9b8a148ca62197594cc383569",
"pins" : [
{
"identity" : "aexml",
"kind" : "remoteSourceControl",
"location" : "https://github.com/tadija/AEXML.git",
"state" : {
"revision" : "38f7d00b23ecd891e1ee656fa6aeebd6ba04ecc3",
"version" : "4.6.1"
}
},
{
"identity" : "graphviz",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SwiftDocOrg/GraphViz.git",
"state" : {
"revision" : "70bebcf4597b9ce33e19816d6bbd4ba9b7bdf038",
"version" : "0.2.0"
}
},
{
"identity" : "jsonutilities",
"kind" : "remoteSourceControl",
"location" : "https://github.com/yonaskolb/JSONUtilities.git",
"state" : {
"revision" : "128d2ffc22467f69569ef8ff971683e2393191a0",
"version" : "4.2.0"
}
},
{
"identity" : "mainoffender",
"kind" : "remoteSourceControl",
Expand Down Expand Up @@ -64,15 +37,6 @@
"version" : "1.26.2"
}
},
{
"identity" : "pathkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/kylef/PathKit.git",
"state" : {
"revision" : "3bfd2737b700b9a36565a8c94f4ad2b050a5e574",
"version" : "1.0.1"
}
},
{
"identity" : "pythonkit",
"kind" : "remoteSourceControl",
Expand Down Expand Up @@ -100,60 +64,6 @@
"version" : "1.8.1"
}
},
{
"identity" : "spectre",
"kind" : "remoteSourceControl",
"location" : "https://github.com/kylef/Spectre.git",
"state" : {
"revision" : "26cc5e9ae0947092c7139ef7ba612e34646086c7",
"version" : "0.10.1"
}
},
{
"identity" : "swift-arg-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/wabiverse/swift-arg-parser",
"state" : {
"revision" : "41fc1c8f8482e321d46164df28c6ef672a42bc85",
"version" : "1.2.4"
}
},
{
"identity" : "swift-argument-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser.git",
"state" : {
"revision" : "46989693916f56d1186bd59ac15124caef896560",
"version" : "1.3.1"
}
},
{
"identity" : "swift-bundler",
"kind" : "remoteSourceControl",
"location" : "https://github.com/furby-tm/swift-bundler",
"state" : {
"revision" : "182d8982c11fdaf139ff1f5a61d8b1950e3699ea",
"version" : "2.0.10"
}
},
{
"identity" : "swift-case-paths",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-case-paths",
"state" : {
"revision" : "8d712376c99fc0267aa0e41fea732babe365270a",
"version" : "1.3.3"
}
},
{
"identity" : "swift-cmark",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-cmark.git",
"state" : {
"revision" : "f218e5d7691f78b55bfa39b367763f4612486c35",
"version" : "0.3.0"
}
},
{
"identity" : "swift-collections",
"kind" : "remoteSourceControl",
Expand All @@ -163,15 +73,6 @@
"version" : "1.1.0"
}
},
{
"identity" : "swift-format",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-format",
"state" : {
"revision" : "83248b4fa37919f78ffbd4650946759bcc54c2b5",
"version" : "509.0.0"
}
},
{
"identity" : "swift-log",
"kind" : "remoteSourceControl",
Expand All @@ -181,33 +82,6 @@
"version" : "1.5.4"
}
},
{
"identity" : "swift-markdown",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-markdown.git",
"state" : {
"revision" : "e4f95e2dc23097a1a9a1dfdfe3fe3ee44de77378",
"version" : "0.3.0"
}
},
{
"identity" : "swift-overture",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-overture",
"state" : {
"revision" : "7977acd7597f413717058acc1e080731249a1d7e",
"version" : "0.5.0"
}
},
{
"identity" : "swift-parsing",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-parsing",
"state" : {
"revision" : "a0e7d73f462c1c38c59dc40a3969ac40cea42950",
"version" : "0.13.0"
}
},
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
Expand All @@ -217,22 +91,13 @@
"version" : "509.1.1"
}
},
{
"identity" : "swiftcli",
"kind" : "remoteSourceControl",
"location" : "https://github.com/jakeheis/SwiftCLI.git",
"state" : {
"revision" : "2e949055d9797c1a6bddcda0e58dada16cc8e970",
"version" : "6.0.3"
}
},
{
"identity" : "swifttreesitter",
"kind" : "remoteSourceControl",
"location" : "https://github.com/wabiverse/SwiftTreeSitter",
"location" : "https://github.com/ChimeHQ/SwiftTreeSitter",
"state" : {
"branch" : "hotfix-read-empty-noalloc",
"revision" : "143e336ce129b202fc8a2b5f87fe22e354f8b5da"
"branch" : "96ad58b",
"revision" : "96ad58b4ac532b9ef9319056d057b3c22682adf4"
}
},
{
Expand All @@ -244,15 +109,6 @@
"version" : "23.11.36"
}
},
{
"identity" : "swiftxcodeproj",
"kind" : "remoteSourceControl",
"location" : "https://github.com/stackotter/SwiftXcodeProj.git",
"state" : {
"revision" : "46e9b907e3ec66010cf2204594549ff1dc195032",
"version" : "8.10.1"
}
},
{
"identity" : "textformation",
"kind" : "remoteSourceControl",
Expand All @@ -271,15 +127,6 @@
"version" : "0.8.0"
}
},
{
"identity" : "tomlkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/furby-tm/TOMLKit",
"state" : {
"revision" : "f2b3e80a19c7fb3d42e3cfda98076cef8f0d1bd7",
"version" : "0.5.6"
}
},
{
"identity" : "tree-sitter",
"kind" : "remoteSourceControl",
Expand All @@ -288,42 +135,6 @@
"revision" : "98be227227af10cc7a269cb3ffb23686c0610b17",
"version" : "0.20.9"
}
},
{
"identity" : "version",
"kind" : "remoteSourceControl",
"location" : "https://github.com/mxcl/Version.git",
"state" : {
"revision" : "1fe824b80d89201652e7eca7c9252269a1d85e25",
"version" : "2.0.1"
}
},
{
"identity" : "xcodegen",
"kind" : "remoteSourceControl",
"location" : "https://github.com/stackotter/XcodeGen",
"state" : {
"revision" : "adbf99beb7afb4844774d14e9275da9a503a427c",
"version" : "2.35.1"
}
},
{
"identity" : "xctest-dynamic-overlay",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
"state" : {
"revision" : "6f30bdba373bbd7fbfe241dddd732651f2fbd1e2",
"version" : "1.1.2"
}
},
{
"identity" : "yams",
"kind" : "remoteSourceControl",
"location" : "https://github.com/jpsim/Yams.git",
"state" : {
"revision" : "9234124cff5e22e178988c18d8b95a8ae8007f76",
"version" : "5.1.2"
}
}
],
"version" : 3
Expand Down
15 changes: 4 additions & 11 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
// swift-tools-version: 5.10
import PackageDescription

// #if os(macOS)
// let crazyToolChainBug: [String: String]? = nil
// #else /* os(macOS) */
// let crazyToolChainBug: [String: String]? = ["SwiftCrossUI": "SwiftUI"]
// #endif /* !os(macOS) */

let package = Package(
name: "Kraken",
platforms: [
Expand Down Expand Up @@ -44,13 +38,12 @@ let package = Package(

// --- 🦄 Package Dependencies. ---
dependencies: [
.package(url: "https://github.com/wabiverse/SwiftUSD", from: "23.11.36"),
.package(url: "https://github.com/wabiverse/SwiftTreeSitter", branch: "hotfix-read-empty-noalloc"),
.package(url: "https://github.com/ChimeHQ/TextFormation", from: "0.8.2"),
// .package(url: "https://github.com/stackotter/swift-cross-ui", revision: "f57f7ab"),
.package(url: "https://github.com/wabiverse/SwiftUSD.git", from: "23.11.36"),
.package(url: "https://github.com/ChimeHQ/SwiftTreeSitter", revision: "96ad58b"),
.package(url: "https://github.com/ChimeHQ/TextFormation.git", from: "0.8.2"),
.package(url: "https://github.com/ChimeHQ/TextStory.git", from: "0.8.0"),
.package(url: "https://github.com/apple/swift-collections", from: "1.1.0"),
.package(url: "https://github.com/furby-tm/swift-bundler", from: "2.0.9"),
// .package(url: "https://github.com/stackotter/swift-cross-ui", revision: "f57f7ab")
],

// --- 🎯 Package Targets. ---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,9 @@ public class TextSelectionManager: NSObject
{
let cursorOrigin = (layoutManager?.rectForOffset(textSelection.range.location) ?? .zero).origin

var doesViewNeedReposition: Bool

// If using the system cursor, macOS will change the origin and height by about 0.5, so we do an
// approximate equals in that case to avoid extra updates.
= if useSystemCursor, #available(macOS 14.0, *)
// If using the system cursor, macOS will change the origin and height by about 0.5,
// so we do an approximate equals in that case to avoid extra updates.
let doesViewNeedReposition: Bool = if useSystemCursor, #available(macOS 14.0, *)
{
!textSelection.boundingRect.origin.approxEqual(cursorOrigin)
|| !textSelection.boundingRect.height.approxEqual(layoutManager?.estimateLineHeight() ?? 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public extension TextViewController
NSEvent.addLocalMonitorForEvents(matching: .keyDown)
{ event in
guard self.view.window?.firstResponder == self.textView else { return event }
let charactersIgnoringModifiers = event.charactersIgnoringModifiers
_ = event.charactersIgnoringModifiers
let commandKey = NSEvent.ModifierFlags.command.rawValue
let modifierFlags = event.modifierFlags.intersection(.deviceIndependentFlagsMask).rawValue
if modifierFlags == commandKey, event.charactersIgnoringModifiers == "/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ extension TextViewController
print("There are no characters/lineInfo \(#function)")
return
}
guard let lineString = textView.textStorage.substring(from: lineInfo.range)
guard let _ = textView.textStorage.substring(from: lineInfo.range)
else
{
print("There are no characters/lineString \(#function)")
Expand Down
12 changes: 6 additions & 6 deletions Sources/Editors/Code/Languages/CodeLanguage+Definitions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ public extension Editor.Code.Language

/// A language structure for `JSDoc`
static let jsdoc: Editor.Code.Language = .init(
id: .jsdoc,
tsName: "jsdoc",
extensions: [],
lineCommentString: "",
rangeCommentStrings: ("/**", "*/")
id: .jsdoc,
tsName: "jsdoc",
extensions: [],
lineCommentString: "",
rangeCommentStrings: ("/**", "*/")
)

/// A language structure for `JSON`
Expand Down Expand Up @@ -124,7 +124,7 @@ public extension Editor.Code.Language
lineCommentString: "//",
rangeCommentStrings: ("/*", "*/"),
documentationCommentStrings: [
.single("///"),
.single("///"),
.pair(("/**", "*/"))
],
highlights: ["injections"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ unsigned tree_sitter_python_external_scanner_serialize(void *payload, char *buff
buffer[size++] = (char)*array_get(&scanner->indents, iter);
}

return size;
return (unsigned int)size;
}

void tree_sitter_python_external_scanner_deserialize(void *payload, const char *buffer, unsigned length) {
Expand All @@ -400,8 +400,8 @@ void tree_sitter_python_external_scanner_deserialize(void *payload, const char *

size_t delimiter_count = (uint8_t)buffer[size++];
if (delimiter_count > 0) {
array_reserve(&scanner->delimiters, delimiter_count);
scanner->delimiters.size = delimiter_count;
array_reserve(&scanner->delimiters, (unsigned int)delimiter_count);
scanner->delimiters.size = (unsigned int)delimiter_count;
memcpy(scanner->delimiters.contents, &buffer[size], delimiter_count);
size += delimiter_count;
}
Expand Down
Loading

0 comments on commit 53b7d46

Please sign in to comment.