You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CodeLanguages-Container/CodeLanguages-Container.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
A collection of `tree-sitter` languages for syntax highlighting.
@@ -22,10 +25,14 @@ A collection of `tree-sitter` languages for syntax highlighting.
22
25
23
26
## Overview
24
27
25
-
This package includes a binary framework `CodeLanguagesContainer.xcframework` which bundles all languages as a binary.
28
+
This package includes a binary framework `CodeLanguagesContainer.xcframework` which bundles all `tree-sitter`languages in a single binary to greatly reduce SPM package resolution times.
26
29
27
30
The languages are then served as a `CodeLanguage`.
28
31
32
+
## SwiftTreeSitter
33
+
34
+
This package heavily depends on [SwiftTreeSitter](https://github.com/ChimeHQ/SwiftTreeSitter) by [Matt Massicotte](https://twitter.com/mattie).
35
+
29
36
## Documentation
30
37
31
38
The documentation including a guide on how to add support for new languages can be found **[here](https://codeeditapp.github.io/CodeEditLanguages/documentation/codeeditlanguages)**!
Copy file name to clipboardExpand all lines: Sources/CodeEditLanguages/Documentation.docc/Add-Languages.md
+29-7Lines changed: 29 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,13 @@ This article is a writedown on how to add support for more languages to ``CodeLa
6
6
7
7
First of all have a look at the corresponding [GitHub Issue](https://github.com/CodeEditApp/CodeEditTextView/issues/15) to see which languages still need implementation.
8
8
9
+
> Note: If you want to update existing languages see <doc:Update-Languages> instead.
10
+
9
11
## Add SPM support
10
12
11
13
If you find one you want to add, fork and clone the linked repo and create a new branch `feature/spm`.
12
14
13
-
> In the following code samples replace `{LANG}` or `{lang}` with the language you add (e.g.: `Swift` or `CPP` and `swift` or `cpp` respectively)
15
+
> Tip: In the following code samples replace `{LANG}` or `{lang}` with the language you add (e.g.: `Swift` or `CPP` and `swift` or `cpp` respectively)
14
16
15
17
### .gitignore
16
18
@@ -20,7 +22,7 @@ Edit the `.gitignore` file to exclude the `.build/` directory from git.
20
22
21
23
Create a new file `Package.swift` in the `root` directory of the repository and add the following configuration.
22
24
23
-
> Make sure to remove the comment in 'sources'.
25
+
> Warning: Make sure to remove the comment in 'sources'.
> in 'extensions' add the proper file extensions your language uses.
170
+
>Important: in'extensions' add the proper file extensions your language uses.
155
171
156
172
Now find the static constant ``CodeLanguage/allLanguages`` and add your language to it:
157
173
@@ -192,7 +208,7 @@ Make sure to test the newly created language in a sample project!
192
208
193
209
When everything is working correctly push your `tree-sitter-{lang}` changes to `origin` and also create a Pull Request to the official repository.
194
210
195
-
> Take [this PR description](https://github.com/tree-sitter/tree-sitter-javascript/pull/223) as a template and cross-reference it with your Pull Request.
211
+
>Tip: Take [this PR description](https://github.com/tree-sitter/tree-sitter-javascript/pull/223) as a template and cross-reference it with your Pull Request.
196
212
197
213
Now you can remove the local dependencies and replace it with the actual package URLs and submit a Pull Request for`CodeEditTextView`.
198
214
@@ -224,6 +240,12 @@ Also make sure to add test cases for your new language in `Tests/CodeEditLanguag
224
240
}
225
241
```
226
242
243
+
### Run Tests locally
244
+
245
+
Once you added your unit test cases run all tests locally on your machine by going to `Product>Test` or pressing `⌘+U` to make sure everything is working as intended.
246
+

247
+
227
248
## Documentation
228
249
229
-
Please make sure to add the newly created properties to the documentation `*.md` files.
250
+
Please make sure to add the newly created properties to the documentation `*.md` files in the `Documentation.docc` catalog.
Copy file name to clipboardExpand all lines: Sources/CodeEditLanguages/Documentation.docc/Documentation.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,22 @@ A collection of `tree-sitter` languages for syntax highlighting.
4
4
5
5
## Overview
6
6
7
-
This package includes a binary framework `CodeLanguagesContainer.xcframework` which bundles all languages as a binary.
7
+

8
+
9
+
This package includes a binary framework `CodeLanguagesContainer.xcframework` which bundles all `tree-sitter` languages in a single binary to greatly reduce SPM package resolution times.
8
10
9
11
The languages are then served as a ``CodeLanguage``.
10
12
13
+
## SwiftTreeSitter
14
+
15
+
This package heavily depends on [SwiftTreeSitter](https://github.com/ChimeHQ/SwiftTreeSitter) by [Matt Massicotte](https://twitter.com/mattie).
0 commit comments