-
-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removes TreeSitterLanguages dependency from Example project (#22)
* Removes TreeSitterLanguages dependency from Example project * Ignores all .swiftpm and .build folders
- Loading branch information
Showing
20 changed files
with
75,667 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.DS_Store | ||
/.swiftpm | ||
/.build | ||
.swiftpm | ||
.build | ||
xcuserdata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
Example/Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
Example/Example/JavaScriptLanguage/TreeSitterIndentationScopes+Helpers.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import Runestone | ||
|
||
public extension TreeSitterIndentationScopes { | ||
static var javaScript: TreeSitterIndentationScopes { | ||
return TreeSitterIndentationScopes( | ||
indent: [ | ||
"array", | ||
"object", | ||
"arguments", | ||
"statement_block", | ||
"class_body", | ||
"parenthesized_expression", | ||
"jsx_element", | ||
"jsx_opening_element", | ||
"jsx_expression", | ||
"switch_body" | ||
], | ||
outdent: [ | ||
"else", | ||
"}", | ||
"]" | ||
]) | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
Example/Example/JavaScriptLanguage/TreeSitterLanguage+Helpers.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Foundation | ||
import Runestone | ||
import TreeSitterJavaScript | ||
import TreeSitterJavaScriptQueries | ||
|
||
public extension TreeSitterLanguage { | ||
static var javaScript: TreeSitterLanguage { | ||
let highlightsQuery = TreeSitterLanguage.Query(contentsOf: TreeSitterJavaScriptQueries.Query.highlightsFileURL) | ||
let injectionsQuery = TreeSitterLanguage.Query(contentsOf: TreeSitterJavaScriptQueries.Query.injectionsFileURL) | ||
return TreeSitterLanguage(tree_sitter_javascript(), | ||
highlightsQuery: highlightsQuery, | ||
injectionsQuery: injectionsQuery, | ||
indentationScopes: .javaScript) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.DS_Store | ||
/.build | ||
/Packages | ||
/*.xcodeproj | ||
xcuserdata/ | ||
DerivedData/ | ||
.swiftpm/config/registries.json | ||
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata | ||
.netrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// swift-tools-version: 5.6 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "Languages", | ||
products: [ | ||
.library(name: "TreeSitterJavaScript", targets: ["TreeSitterJavaScript"]), | ||
.library(name: "TreeSitterJavaScriptQueries", targets: ["TreeSitterJavaScriptQueries"]) | ||
|
||
], | ||
targets: [ | ||
.target(name: "TreeSitterJavaScript", cSettings: [.headerSearchPath("src")]), | ||
.target(name: "TreeSitterJavaScriptQueries", resources: [.copy("queries")]) | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# TreeSitterJavaScript | ||
|
||
A description of this package. |
10 changes: 10 additions & 0 deletions
10
Example/Languages/Sources/TreeSitterJavaScript/include/public.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
typedef struct TSLanguage TSLanguage; | ||
const TSLanguage *tree_sitter_javascript(void); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
Oops, something went wrong.