Skip to content

Commit

Permalink
Rust support #20
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Jul 11, 2024
1 parent 44eecf1 commit 6593137
Show file tree
Hide file tree
Showing 13 changed files with 288 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@
[submodule "submodules/chime-ruby"]
path = submodules/chime-ruby
url = [email protected]:ChimeHQ/chime-ruby.git
[submodule "submodules/chime-rust"]
path = submodules/chime-rust
url = [email protected]:ChimeHQ/chime-rust.git
1 change: 1 addition & 0 deletions Configurations/NonSwiftWorkaround.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ OTHER_SWIFT_FLAGS = $(inherited) -Xcc -fmodule-map-file=$(GENERATED_MODULEMAP_DI
OTHER_SWIFT_FLAGS = $(inherited) -Xcc -fmodule-map-file=$(GENERATED_MODULEMAP_DIR)/TreeSitterOCaml.modulemap
OTHER_SWIFT_FLAGS = $(inherited) -Xcc -fmodule-map-file=$(GENERATED_MODULEMAP_DIR)/TreeSitterPython.modulemap
OTHER_SWIFT_FLAGS = $(inherited) -Xcc -fmodule-map-file=$(GENERATED_MODULEMAP_DIR)/TreeSitterRuby.modulemap
OTHER_SWIFT_FLAGS = $(inherited) -Xcc -fmodule-map-file=$(GENERATED_MODULEMAP_DIR)/TreeSitterRust.modulemap
OTHER_SWIFT_FLAGS = $(inherited) -Xcc -fmodule-map-file=$(GENERATED_MODULEMAP_DIR)/TreeSitterSwift.modulemap
2 changes: 2 additions & 0 deletions Dependencies/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ let package = Package(
.package(url: "https://github.com/tree-sitter/tree-sitter-ocaml", branch: "master"),
.package(url: "https://github.com/tree-sitter/tree-sitter-python", branch: "master"),
.package(url: "https://github.com/tree-sitter/tree-sitter-ruby", branch: "master"),
.package(url: "https://github.com/tree-sitter/tree-sitter-rust", branch: "master"),
.package(url: "https://github.com/alex-pinkus/tree-sitter-swift", branch: "with-generated-files"),
],
targets: [
Expand All @@ -38,6 +39,7 @@ let package = Package(
.product(name: "TreeSitterOCaml", package: "tree-sitter-ocaml"),
.product(name: "TreeSitterPython", package: "tree-sitter-python"),
.product(name: "TreeSitterRuby", package: "tree-sitter-ruby"),
.product(name: "TreeSitterRust", package: "tree-sitter-rust"),
.product(name: "TreeSitterSwift", package: "tree-sitter-swift"),
]
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
@_exported import TreeSitterOCaml
@_exported import TreeSitterPython
@_exported import TreeSitterRuby
@_exported import TreeSitterRust
@_exported import TreeSitterSwift
114 changes: 114 additions & 0 deletions Edit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@
C973E0112B62BE0C000998F7 /* Highlighter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C973DFF62B62808D000998F7 /* Highlighter.swift */; };
C973E0132B62BE9F000998F7 /* TextViewSystemNeonInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = C99D76112B5EFA050028E3B0 /* TextViewSystemNeonInterface.swift */; };
C973E01F2B62C007000998F7 /* TokenServiceWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = C973E01E2B62C007000998F7 /* TokenServiceWrapper.swift */; };
C97640EE2C40372C002C94BF /* RustExtension.appex in Copy Extensions */ = {isa = PBXBuildFile; fileRef = C97640E62C40372C002C94BF /* RustExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
C97640F42C403777002C94BF /* RustExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = C97640F32C403777002C94BF /* RustExtension.swift */; };
C97640F52C40377D002C94BF /* RustExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = C97640F32C403777002C94BF /* RustExtension.swift */; };
C97640F82C403791002C94BF /* ChimeKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C9FE52F42A7539B100CACA1A /* ChimeKit.framework */; };
C979187B2A9CC1110046EAF1 /* SearchItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = C97918752A9CBEF20046EAF1 /* SearchItem.swift */; };
C979187C2A9CC1190046EAF1 /* RoundedCorners.swift in Sources */ = {isa = PBXBuildFile; fileRef = C97918792A9CBF8C0046EAF1 /* RoundedCorners.swift */; };
C979187D2A9CC1200046EAF1 /* ItemBackground.swift in Sources */ = {isa = PBXBuildFile; fileRef = C97918772A9CBF330046EAF1 /* ItemBackground.swift */; };
Expand Down Expand Up @@ -453,6 +457,20 @@
remoteGlobalIDString = C9B8AA492B37055800C79606;
remoteInfo = SyntaxService;
};
C97640EC2C40372C002C94BF /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = C9FE52912A7525D000CACA1A /* Project object */;
proxyType = 1;
remoteGlobalIDString = C97640E52C40372C002C94BF;
remoteInfo = Rust;
};
C97640F62C40378C002C94BF /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = C9FE52912A7525D000CACA1A /* Project object */;
proxyType = 1;
remoteGlobalIDString = C9FE52F32A7539B100CACA1A;
remoteInfo = ChimeKit;
};
C97918712A9CBD6B0046EAF1 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = C9FE52912A7525D000CACA1A /* Project object */;
Expand Down Expand Up @@ -938,6 +956,7 @@
dstPath = "$(EXTENSIONS_FOLDER_PATH)";
dstSubfolderSpec = 16;
files = (
C97640EE2C40372C002C94BF /* RustExtension.appex in Copy Extensions */,
C93F72582BF26E9C0021ACF3 /* EditIntents.appex in Copy Extensions */,
C9E878092A9F53530018340C /* UIPlaceholderExtension.appex in Copy Extensions */,
C9818ACA2C3F2C2F0032899D /* GoExtension.appex in Copy Extensions */,
Expand Down Expand Up @@ -1037,6 +1056,9 @@
C973DFF62B62808D000998F7 /* Highlighter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Highlighter.swift; sourceTree = "<group>"; };
C973E0002B62BDB3000998F7 /* libHighlighting.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libHighlighting.a; sourceTree = BUILT_PRODUCTS_DIR; };
C973E01E2B62C007000998F7 /* TokenServiceWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TokenServiceWrapper.swift; sourceTree = "<group>"; };
C97640E62C40372C002C94BF /* RustExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.extensionkit-extension"; includeInIndex = 0; path = RustExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
C97640F22C403744002C94BF /* RustStandaloneExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RustStandaloneExtension.swift; sourceTree = "<group>"; };
C97640F32C403777002C94BF /* RustExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RustExtension.swift; path = "submodules/chime-rust/Sources/ChimeRust/RustExtension.swift"; sourceTree = SOURCE_ROOT; };
C97918732A9CBEBA0046EAF1 /* StatusBarContent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusBarContent.swift; sourceTree = "<group>"; };
C97918752A9CBEF20046EAF1 /* SearchItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchItem.swift; sourceTree = "<group>"; };
C97918772A9CBF330046EAF1 /* ItemBackground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ItemBackground.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1292,6 +1314,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
C97640E32C40372C002C94BF /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
C97640F82C403791002C94BF /* ChimeKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
C979189C2A9D1D6D0046EAF1 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -1594,6 +1624,15 @@
path = Highlighting;
sourceTree = "<group>";
};
C97640E72C40372C002C94BF /* Rust */ = {
isa = PBXGroup;
children = (
C97640F32C403777002C94BF /* RustExtension.swift */,
C97640F22C403744002C94BF /* RustStandaloneExtension.swift */,
);
path = Rust;
sourceTree = "<group>";
};
C979188F2A9CCC5E0046EAF1 /* Animations */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1794,6 +1833,7 @@
C9818AC32C3F2C2F0032899D /* Go */,
C9BDB54C2B00FD89009225FB /* Info.plist */,
C92631A62C40002F00C0AE07 /* Python */,
C97640E72C40372C002C94BF /* Rust */,
C9BDB5492B00FD89009225FB /* Swift */,
C9E878022A9F53530018340C /* UIPlaceholder */,
C942E6772B67B78F00792DD4 /* UserScriptExtension */,
Expand Down Expand Up @@ -1873,6 +1913,7 @@
C9818AAA2C3EF5ED0032899D /* ElixirExtension.appex */,
C9818AC22C3F2C2F0032899D /* GoExtension.appex */,
C92631A52C40002F00C0AE07 /* PythonExtension.appex */,
C97640E62C40372C002C94BF /* RustExtension.appex */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -2452,6 +2493,24 @@
productReference = C973E0002B62BDB3000998F7 /* libHighlighting.a */;
productType = "com.apple.product-type.library.static";
};
C97640E52C40372C002C94BF /* Rust */ = {
isa = PBXNativeTarget;
buildConfigurationList = C97640F12C40372C002C94BF /* Build configuration list for PBXNativeTarget "Rust" */;
buildPhases = (
C97640E22C40372C002C94BF /* Sources */,
C97640E32C40372C002C94BF /* Frameworks */,
C97640E42C40372C002C94BF /* Resources */,
);
buildRules = (
);
dependencies = (
C97640F72C40378C002C94BF /* PBXTargetDependency */,
);
name = Rust;
productName = Rust;
productReference = C97640E62C40372C002C94BF /* RustExtension.appex */;
productType = "com.apple.product-type.extensionkit-extension";
};
C979189D2A9D1D6D0046EAF1 /* OpenQuickly */ = {
isa = PBXNativeTarget;
buildConfigurationList = C97918A42A9D1D6D0046EAF1 /* Build configuration list for PBXNativeTarget "OpenQuickly" */;
Expand Down Expand Up @@ -2729,6 +2788,7 @@
C9818AB12C3EF5ED0032899D /* PBXTargetDependency */,
C9818AC92C3F2C2F0032899D /* PBXTargetDependency */,
C92631AC2C40002F00C0AE07 /* PBXTargetDependency */,
C97640ED2C40372C002C94BF /* PBXTargetDependency */,
);
name = Edit;
packageProductDependencies = (
Expand Down Expand Up @@ -3064,6 +3124,10 @@
C973DFFF2B62BDB3000998F7 = {
CreatedOnToolsVersion = 15.2;
};
C97640E52C40372C002C94BF = {
CreatedOnToolsVersion = 15.4;
LastSwiftMigration = 1540;
};
C979189D2A9D1D6D0046EAF1 = {
CreatedOnToolsVersion = 15.0;
};
Expand Down Expand Up @@ -3223,6 +3287,7 @@
C9818AA92C3EF5ED0032899D /* Elixir */,
C9818AC12C3F2C2F0032899D /* Go */,
C92631A42C40002F00C0AE07 /* Python */,
C97640E52C40372C002C94BF /* Rust */,
);
};
/* End PBXProject section */
Expand Down Expand Up @@ -3264,6 +3329,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
C97640E42C40372C002C94BF /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
C9818AA82C3EF5ED0032899D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -3424,6 +3496,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
C97640E22C40372C002C94BF /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
C97640F42C403777002C94BF /* RustExtension.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
C979189B2A9D1D6D0046EAF1 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -3735,6 +3815,7 @@
C9818AB92C3EF6E80032899D /* ElixirExtension.swift in Sources */,
C97918F82A9E5E520046EAF1 /* ExtensionRouter.swift in Sources */,
C97918FA2A9E5EAF0046EAF1 /* CompositeDocumentService.swift in Sources */,
C97640F52C40377D002C94BF /* RustExtension.swift in Sources */,
C942E6AE2B69889F00792DD4 /* UserScriptExtension.swift in Sources */,
C9FE54072A7A617000CACA1A /* ExtensionDocumentState.swift in Sources */,
C941F0AD2B6E65110003B640 /* Process+Pipes.swift in Sources */,
Expand Down Expand Up @@ -3958,6 +4039,16 @@
target = C9B8AA492B37055800C79606 /* SyntaxService */;
targetProxy = C973E01C2B62BF4C000998F7 /* PBXContainerItemProxy */;
};
C97640ED2C40372C002C94BF /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = C97640E52C40372C002C94BF /* Rust */;
targetProxy = C97640EC2C40372C002C94BF /* PBXContainerItemProxy */;
};
C97640F72C40378C002C94BF /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = C9FE52F32A7539B100CACA1A /* ChimeKit */;
targetProxy = C97640F62C40378C002C94BF /* PBXContainerItemProxy */;
};
C97918722A9CBD6B0046EAF1 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = C9FE539A2A76709D00CACA1A /* Status */;
Expand Down Expand Up @@ -4517,6 +4608,20 @@
};
name = Release;
};
C97640EF2C40372C002C94BF /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = C9E878112A9F53BB0018340C /* Extension.xcconfig */;
buildSettings = {
};
name = Debug;
};
C97640F02C40372C002C94BF /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = C9E878112A9F53BB0018340C /* Extension.xcconfig */;
buildSettings = {
};
name = Release;
};
C97918A52A9D1D6D0046EAF1 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = C9FE531A2A759BC400CACA1A /* Module.xcconfig */;
Expand Down Expand Up @@ -4961,6 +5066,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C97640F12C40372C002C94BF /* Build configuration list for PBXNativeTarget "Rust" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C97640EF2C40372C002C94BF /* Debug */,
C97640F02C40372C002C94BF /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C97918A42A9D1D6D0046EAF1 /* Build configuration list for PBXNativeTarget "OpenQuickly" */ = {
isa = XCConfigurationList;
buildConfigurations = (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "547710c82c4ec23bd5902c9d500be3a3fc3c0a4a4837d5f28eda84b99ec91cc1",
"originHash" : "7ec6ccb9bc276a295422e18b1a495ba45c60ca70b5912320b7f399276466ef72",
"pins" : [
{
"identity" : "asyncxpcconnection",
Expand Down Expand Up @@ -330,6 +330,15 @@
"revision" : "0ffe457fb6aabf064f173fd30ea356845cef2513"
}
},
{
"identity" : "tree-sitter-rust",
"kind" : "remoteSourceControl",
"location" : "https://github.com/tree-sitter/tree-sitter-rust",
"state" : {
"branch" : "master",
"revision" : "9c84af007b0f144954adb26b3f336495cbb320a7"
}
},
{
"identity" : "tree-sitter-swift",
"kind" : "remoteSourceControl",
Expand Down
97 changes: 97 additions & 0 deletions Edit.xcodeproj/xcshareddata/xcschemes/Rust.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1540"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "NO"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C97640E52C40372C002C94BF"
BuildableName = "Rust.appex"
BlueprintName = "Rust"
ReferencedContainer = "container:Edit.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C9FE52982A7525D000CACA1A"
BuildableName = "Chime.app"
BlueprintName = "Edit"
ReferencedContainer = "container:Edit.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
launchStyle = "0"
askForAppToLaunch = "Yes"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C9FE52982A7525D000CACA1A"
BuildableName = "Chime.app"
BlueprintName = "Edit"
ReferencedContainer = "container:Edit.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
askForAppToLaunch = "Yes"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C9FE52982A7525D000CACA1A"
BuildableName = "Chime.app"
BlueprintName = "Edit"
ReferencedContainer = "container:Edit.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Loading

0 comments on commit 6593137

Please sign in to comment.