mirror of
https://github.com/tauri-apps/rust-xcode-plugin.git
synced 2026-01-31 00:45:21 +01:00
Fix syntax highlighting
This commit is contained in:
22
README.md
22
README.md
@@ -8,14 +8,22 @@ Based on:
|
|||||||
https://github.com/youknowone/rust-xcode-langspec
|
https://github.com/youknowone/rust-xcode-langspec
|
||||||
https://github.com/steventroughtonsmith/lua-xclangspec
|
https://github.com/steventroughtonsmith/lua-xclangspec
|
||||||
|
|
||||||
## Install
|
If your Xcode UUID is not listed [here](https://github.com/mtak-/rust-xcode-plugin/blob/master/Plug-ins/Rust.ideplugin/Contents/Info.plist), please make an issue (or a pull request!) and I'll add it.
|
||||||
Place the `Plug-ins` and `Specifications` folders in `~Library/Developer/Xcode`
|
|
||||||
|
|
||||||
You may have to quit and reopen Xcode once or twice and click the `Load Bundle` button in a popup that should appear automatically.
|
|
||||||
|
|
||||||
Additionally if your Xcode UUID is not listed [here](https://github.com/mtak-/rust-xcode-plugin/blob/master/Plug-ins/Rust.ideplugin/Contents/Info.plist), please make an issue (or a pull request!) and I'll add it.
|
|
||||||
|
|
||||||
You can check your UUID with this command:
|
You can check your UUID with this command:
|
||||||
```sh
|
```sh
|
||||||
$ defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID
|
$ defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID
|
||||||
```
|
```
|
||||||
|
Once the UUID is added, execute the `setup.sh` script
|
||||||
|
|
||||||
|
You may have to quit and reopen Xcode once or twice and click the `Load Bundle` button in a popup that should appear automatically.
|
||||||
|
|
||||||
|
## Manual Install
|
||||||
|
Place the `Plug-ins` folders in `~Library/Developer/Xcode`
|
||||||
|
|
||||||
|
Place the `Rust.xclangspec` in `/Applications/Xcode.app/Contents/SharedFrameworks/SourceModel.framework/Versions/A/Resources/LanguageSpecifications`
|
||||||
|
|
||||||
|
Place `Xcode.SourceCodeLanguage.Rust.plist` in `/Applications/Xcode.app/Contents/SharedFrameworks/SourceModel.framework/Versions/A/Resources/LanguageMetadata`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
46
Xcode.SourceCodeLanguage.Rust.plist
Normal file
46
Xcode.SourceCodeLanguage.Rust.plist
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>commentSyntaxes</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>prefix</key>
|
||||||
|
<string>/*</string>
|
||||||
|
<key>suffix</key>
|
||||||
|
<string>*/</string>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>prefix</key>
|
||||||
|
<string>//</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>conformsToLanguageIdentifiers</key>
|
||||||
|
<array>
|
||||||
|
<string>Xcode.SourceCodeLanguage.Generic</string>
|
||||||
|
</array>
|
||||||
|
<key>fileDataTypeIdentifiers</key>
|
||||||
|
<array>
|
||||||
|
<string>public.rust-source</string>
|
||||||
|
</array>
|
||||||
|
<key>identifier</key>
|
||||||
|
<string>Xcode.SourceCodeLanguage.Rust</string>
|
||||||
|
<key>isHidden</key>
|
||||||
|
<false/>
|
||||||
|
<key>languageName</key>
|
||||||
|
<string>Rust</string>
|
||||||
|
<key>languageSpecification</key>
|
||||||
|
<string>xcode.lang.rust</string>
|
||||||
|
<key>supportsIndentation</key>
|
||||||
|
<true/>
|
||||||
|
<key>allowWhitespaceTrimming</key>
|
||||||
|
<true/>
|
||||||
|
<key>requiresHardTabs</key>
|
||||||
|
<false/>
|
||||||
|
<key>indentationTriggers</key>
|
||||||
|
<array>
|
||||||
|
<string>{</string>
|
||||||
|
<string>}</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
34
setup.sh
Executable file
34
setup.sh
Executable file
@@ -0,0 +1,34 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
# Create plug-ins directory if it doesn't exist
|
||||||
|
plugins_dir=~/Library/Developer/Xcode/Plug-ins/
|
||||||
|
if [ ! -d "$plugins_dir" ]; then
|
||||||
|
mkdir $plugins_dir
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Copy the IDE Plugin to the plug-ins directory
|
||||||
|
|
||||||
|
cp -r Plug-ins/Rust.ideplugin $plugins_dir
|
||||||
|
|
||||||
|
#Get the selected Xcode.app's path
|
||||||
|
xcode_path=$(xcode-select -p)
|
||||||
|
xcode_path=$(dirname $xcode_path)
|
||||||
|
|
||||||
|
# Get Specifications directory
|
||||||
|
spec_dir="${xcode_path}/SharedFrameworks/SourceModel.framework/Versions/A/Resources/LanguageSpecifications"
|
||||||
|
|
||||||
|
# Copy the language specification to the specs directory
|
||||||
|
cp Specifications/Rust.xclangspec $spec_dir
|
||||||
|
#cp Specifications/Rust.xcspec $spec_dir
|
||||||
|
|
||||||
|
# Get language metadata directory
|
||||||
|
metadata_dir="${xcode_path}/SharedFrameworks/SourceModel.framework/Versions/A/Resources/LanguageMetadata"
|
||||||
|
|
||||||
|
# Copy the source code language plist to the metadata directory
|
||||||
|
cp Xcode.SourceCodeLanguage.Rust.plist $metadata_dir
|
||||||
|
|
||||||
|
defaults read ${xcode_path}/Info DVTPlugInCompatibilityUUID
|
||||||
|
|
||||||
|
echo "Please restart Xcode"
|
||||||
Reference in New Issue
Block a user