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: 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/TreeSitterModel.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
Since fetching queries *can* be expensive the queries are fetched lazily and kept in memory for the entire session.
6
6
7
-
> Be aware that running the application in `Debug` configuration will lead to worse performance. Make sure to run it in `Release` configuration.
7
+
> Warning: Be aware that running the application in `Debug` configuration will lead to worse performance. Make sure to run it in `Release` configuration.
This article covers all the steps needed to update to the latest version of the `tree-sitter` languages
4
+
5
+
## Overview
6
+
7
+
From time to time the `tree-sitter` languages need to be updated to their latest version. This is pretty straight forward and can be done in less than 5 minutes.
8
+
9
+
## Update the Dependencies
10
+
11
+
1. Open the `CodeLanguages-Container.xcodeproj` which is located inside the `./CodeLanguages-Container` directory.
12
+

13
+
14
+
2. Go to `File > Packages > Update to Latest Package Versions` and let it resolve the SPM dependencies.
15
+
> Note: Depending on your internet connection and Mac hardware this step can take a couple of minutes.
16
+
17
+
3. Close the project
18
+
19
+
> Tip: At this stage you can check if anything changed at all by checking the git status. If `Package.resolved` does not appear in the changed files list, you don't need to proceed.
20
+
> ```bash
21
+
> $ git status
22
+
>```
23
+
24
+
## Update the Framework
25
+
26
+
1. Open your terminal and set your working directory
27
+
```bash
28
+
$ cd path/to/CodeEditLanguages
29
+
```
30
+
31
+
2. Run the `build_framework.sh` script
32
+
```bash
33
+
$ ./build_framework.sh
34
+
```
35
+
> Note: This script automatically removes old artifacts and replaces them with the new ones.
36
+
37
+
3. Check the console output. It should say `Done!` at the end.
38
+

39
+
> Tip: If you don't get the output and the script terminates early, there might be an issue. Try running the script again with the `--debug` flag appended:
40
+
> ```bash
41
+
> $ ./build_framework.sh --debug
42
+
>```
43
+
44
+
## Check if everything still works
45
+
46
+
1. Open the ``CodeEditLanguages`` Package in Xcode and run the included unit tests.
47
+
48
+
2. Once all the tests succeeded, the changes can be committed, pushed and a pull request can be opened.
0 commit comments