diff --git a/CodeLanguages-Container/CodeLanguages-Container.xcodeproj/project.pbxproj b/CodeLanguages-Container/CodeLanguages-Container.xcodeproj/project.pbxproj index 1024130..2dae242 100644 --- a/CodeLanguages-Container/CodeLanguages-Container.xcodeproj/project.pbxproj +++ b/CodeLanguages-Container/CodeLanguages-Container.xcodeproj/project.pbxproj @@ -7,12 +7,10 @@ objects = { /* Begin PBXBuildFile section */ - 28171CB829814CD800523F1C /* TreeSitterObjC in Frameworks */ = {isa = PBXBuildFile; productRef = 28171CB729814CD800523F1C /* TreeSitterObjC */; }; 282E5977298051980064B34A /* TreeSitterYAML in Frameworks */ = {isa = PBXBuildFile; productRef = 282E5976298051980064B34A /* TreeSitterYAML */; }; 2846B262296BA1CF005F60B6 /* TreeSitterDockerfile in Frameworks */ = {isa = PBXBuildFile; productRef = 2846B261296BA1CF005F60B6 /* TreeSitterDockerfile */; }; 285BF67329AAA45B00641989 /* TreeSitterLua in Frameworks */ = {isa = PBXBuildFile; productRef = 285BF67229AAA45B00641989 /* TreeSitterLua */; }; 2886C788298135540023E016 /* TreeSitterKotlin in Frameworks */ = {isa = PBXBuildFile; productRef = 2886C787298135540023E016 /* TreeSitterKotlin */; }; - 28AAB6AE29CA57D40087654B /* TreeSitterDart in Frameworks */ = {isa = PBXBuildFile; productRef = 28AAB6AD29CA57D40087654B /* TreeSitterDart */; }; 28B3F010290C207D000CD04D /* CodeLanguages_Container.h in Headers */ = {isa = PBXBuildFile; fileRef = 28B3F00F290C207D000CD04D /* CodeLanguages_Container.h */; settings = {ATTRIBUTES = (Public, ); }; }; 28B3F02D290C35D9000CD04D /* TreeSitterC in Frameworks */ = {isa = PBXBuildFile; productRef = 28B3F02C290C35D9000CD04D /* TreeSitterC */; }; 28B3F030290C35F9000CD04D /* TreeSitterCPP in Frameworks */ = {isa = PBXBuildFile; productRef = 28B3F02F290C35F9000CD04D /* TreeSitterCPP */; }; @@ -31,7 +29,11 @@ 28B3F063290C372D000CD04D /* TreeSitterZig in Frameworks */ = {isa = PBXBuildFile; productRef = 28B3F062290C372D000CD04D /* TreeSitterZig */; }; 28B9F7AA290DDAC900245748 /* TreeSitterBash in Frameworks */ = {isa = PBXBuildFile; productRef = 28B9F7A9290DDAC900245748 /* TreeSitterBash */; }; 6C0B93A82B5DD95500323006 /* TreeSitterCSS in Frameworks */ = {isa = PBXBuildFile; productRef = 6C0B93A72B5DD95500323006 /* TreeSitterCSS */; }; + 6C7CA2AD2CE9743E006D9D9A /* TreeSitterObjc in Frameworks */ = {isa = PBXBuildFile; productRef = 6C7CA2AC2CE9743E006D9D9A /* TreeSitterObjc */; }; + 6CE117F92CEA7BDC0082D393 /* TreeSitterDart in Frameworks */ = {isa = PBXBuildFile; productRef = 6CE117F82CEA7BDC0082D393 /* TreeSitterDart */; }; + 6CE117FC2CEA7CF80082D393 /* TreeSitterDart in Frameworks */ = {isa = PBXBuildFile; productRef = 6CE117FB2CEA7CF80082D393 /* TreeSitterDart */; }; 6CEC70FE29C3A85000B61C7A /* TreeSitterRegex in Frameworks */ = {isa = PBXBuildFile; productRef = 6CEC70FD29C3A85000B61C7A /* TreeSitterRegex */; }; + 6CF2B8412CE978F100CBE5D1 /* TreeSitterDart in Frameworks */ = {isa = PBXBuildFile; productRef = 6CF2B8402CE978F100CBE5D1 /* TreeSitterDart */; }; 8E74B41D2A4C88ED003A9550 /* TreeSitterHTML in Frameworks */ = {isa = PBXBuildFile; productRef = 8E74B41C2A4C88ED003A9550 /* TreeSitterHTML */; }; 8E7B0EA92A5D9BB60040DDAB /* TreeSitterTOML in Frameworks */ = {isa = PBXBuildFile; productRef = 8E7B0EA82A5D9BB60040DDAB /* TreeSitterTOML */; }; 8E7B8ABD2A5D916F00CFC1A7 /* TreeSitterPython in Frameworks */ = {isa = PBXBuildFile; productRef = 8E7B8ABC2A5D916F00CFC1A7 /* TreeSitterPython */; }; @@ -50,7 +52,6 @@ /* Begin PBXFileReference section */ 28B3F00C290C207D000CD04D /* CodeLanguages_Container.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CodeLanguages_Container.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 28B3F00F290C207D000CD04D /* CodeLanguages_Container.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CodeLanguages_Container.h; sourceTree = ""; }; - 28B3F017290C2097000CD04D /* CodeEditLanguages */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = CodeEditLanguages; path = ..; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -60,10 +61,12 @@ files = ( 9DFDC3662A02D9BE0023B3BC /* TreeSitterMarkdown in Frameworks */, 28B3F051290C36B1000CD04D /* TreeSitterPHP in Frameworks */, + 6CE117FC2CEA7CF80082D393 /* TreeSitterDart in Frameworks */, 28B3F042290C365C000CD04D /* TreeSitterHaskell in Frameworks */, 8E7B0EA92A5D9BB60040DDAB /* TreeSitterTOML in Frameworks */, 285BF67329AAA45B00641989 /* TreeSitterLua in Frameworks */, 8E87F9542A4B7DC1008C7E13 /* TreeSitterScala in Frameworks */, + 6CE117F92CEA7BDC0082D393 /* TreeSitterDart in Frameworks */, 2846B262296BA1CF005F60B6 /* TreeSitterDockerfile in Frameworks */, 9D73992A2A5A30A400CEF6E8 /* TreeSitterPerl in Frameworks */, 9D6E74512A2B9B2A0070701E /* TreeSitterOCaml in Frameworks */, @@ -84,8 +87,7 @@ 8E74B41D2A4C88ED003A9550 /* TreeSitterHTML in Frameworks */, 8ED0560A2A4DBE6E00829B80 /* TreeSitterTypeScript in Frameworks */, 28B3F05A290C36E5000CD04D /* TreeSitterRust in Frameworks */, - 28AAB6AE29CA57D40087654B /* TreeSitterDart in Frameworks */, - 28171CB829814CD800523F1C /* TreeSitterObjC in Frameworks */, + 6C7CA2AD2CE9743E006D9D9A /* TreeSitterObjc in Frameworks */, 28B3F048290C367C000CD04D /* TreeSitterJava in Frameworks */, 6CEC70FE29C3A85000B61C7A /* TreeSitterRegex in Frameworks */, 282E5977298051980064B34A /* TreeSitterYAML in Frameworks */, @@ -93,6 +95,7 @@ 8E7B8ABD2A5D916F00CFC1A7 /* TreeSitterPython in Frameworks */, 2886C788298135540023E016 /* TreeSitterKotlin in Frameworks */, 9D920B982A93B248004E4451 /* TreeSitterJSDoc in Frameworks */, + 6CF2B8412CE978F100CBE5D1 /* TreeSitterDart in Frameworks */, 6C0B93A82B5DD95500323006 /* TreeSitterCSS in Frameworks */, 28B3F057290C36D5000CD04D /* TreeSitterRuby in Frameworks */, ); @@ -104,7 +107,6 @@ 28B3F002290C207D000CD04D = { isa = PBXGroup; children = ( - 28B3F016290C2097000CD04D /* Packages */, 28B3F00E290C207D000CD04D /* CodeLanguages-Container */, 28B3F00D290C207D000CD04D /* Products */, 28B3F018290C20CF000CD04D /* Frameworks */, @@ -127,14 +129,6 @@ path = "CodeLanguages-Container"; sourceTree = ""; }; - 28B3F016290C2097000CD04D /* Packages */ = { - isa = PBXGroup; - children = ( - 28B3F017290C2097000CD04D /* CodeEditLanguages */, - ); - name = Packages; - sourceTree = ""; - }; 28B3F018290C20CF000CD04D /* Frameworks */ = { isa = PBXGroup; children = ( @@ -190,10 +184,8 @@ 2846B261296BA1CF005F60B6 /* TreeSitterDockerfile */, 282E5976298051980064B34A /* TreeSitterYAML */, 2886C787298135540023E016 /* TreeSitterKotlin */, - 28171CB729814CD800523F1C /* TreeSitterObjC */, 285BF67229AAA45B00641989 /* TreeSitterLua */, 6CEC70FD29C3A85000B61C7A /* TreeSitterRegex */, - 28AAB6AD29CA57D40087654B /* TreeSitterDart */, 9DFDC3652A02D9BE0023B3BC /* TreeSitterMarkdown */, 9D6E74502A2B9B2A0070701E /* TreeSitterOCaml */, 9D7399232A5A245000CEF6E8 /* TreeSitterAgda */, @@ -208,6 +200,10 @@ 8E7B0EA82A5D9BB60040DDAB /* TreeSitterTOML */, 9D920B972A93B248004E4451 /* TreeSitterJSDoc */, 6C0B93A72B5DD95500323006 /* TreeSitterCSS */, + 6C7CA2AC2CE9743E006D9D9A /* TreeSitterObjc */, + 6CF2B8402CE978F100CBE5D1 /* TreeSitterDart */, + 6CE117F82CEA7BDC0082D393 /* TreeSitterDart */, + 6CE117FB2CEA7CF80082D393 /* TreeSitterDart */, ); productName = "CodeLanguages-Container"; productReference = 28B3F00C290C207D000CD04D /* CodeLanguages_Container.framework */; @@ -257,10 +253,8 @@ 2846B260296BA1CF005F60B6 /* XCRemoteSwiftPackageReference "tree-sitter-dockerfile" */, 282E5975298051980064B34A /* XCRemoteSwiftPackageReference "tree-sitter-yaml" */, 2886C786298135540023E016 /* XCRemoteSwiftPackageReference "tree-sitter-kotlin" */, - 28171CB629814CD800523F1C /* XCRemoteSwiftPackageReference "tree-sitter-objc" */, 285BF67129AAA45B00641989 /* XCRemoteSwiftPackageReference "tree-sitter-lua" */, 6CEC70FC29C3A85000B61C7A /* XCRemoteSwiftPackageReference "tree-sitter-regex" */, - 28AAB6AC29CA57D40087654B /* XCRemoteSwiftPackageReference "tree-sitter-dart" */, 9DFDC3642A02D9BE0023B3BC /* XCRemoteSwiftPackageReference "tree-sitter-markdown" */, 9D6E744F2A2B9B2A0070701E /* XCRemoteSwiftPackageReference "tree-sitter-ocaml" */, 9D7399222A5A245000CEF6E8 /* XCRemoteSwiftPackageReference "tree-sitter-agda" */, @@ -275,6 +269,8 @@ 8E7B0EA72A5D9BB60040DDAB /* XCRemoteSwiftPackageReference "tree-sitter-toml" */, 9D920B962A93B248004E4451 /* XCRemoteSwiftPackageReference "tree-sitter-jsdoc" */, 6C0B93A62B5DD95500323006 /* XCRemoteSwiftPackageReference "tree-sitter-css" */, + 6C7CA2AB2CE9743E006D9D9A /* XCRemoteSwiftPackageReference "tree-sitter-objc" */, + 6CE117FA2CEA7CF80082D393 /* XCRemoteSwiftPackageReference "tree-sitter-dart" */, ); productRefGroup = 28B3F00D290C207D000CD04D /* Products */; projectDirPath = ""; @@ -524,19 +520,11 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ - 28171CB629814CD800523F1C /* XCRemoteSwiftPackageReference "tree-sitter-objc" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/lukepistrol/tree-sitter-objc"; - requirement = { - branch = feature/spm; - kind = branch; - }; - }; 282E5975298051980064B34A /* XCRemoteSwiftPackageReference "tree-sitter-yaml" */ = { isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/lukepistrol/tree-sitter-yaml.git"; + repositoryURL = "https://github.com/tree-sitter-grammars/tree-sitter-yaml.git"; requirement = { - branch = feature/spm; + branch = master; kind = branch; }; }; @@ -550,25 +538,17 @@ }; 285BF67129AAA45B00641989 /* XCRemoteSwiftPackageReference "tree-sitter-lua" */ = { isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/lukepistrol/tree-sitter-lua.git"; + repositoryURL = "https://github.com/tree-sitter-grammars/tree-sitter-lua"; requirement = { - branch = feature/spm; + branch = main; kind = branch; }; }; 2886C786298135540023E016 /* XCRemoteSwiftPackageReference "tree-sitter-kotlin" */ = { isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/lukepistrol/tree-sitter-kotlin"; + repositoryURL = "https://github.com/fwcd/tree-sitter-kotlin"; requirement = { - branch = "feature/spm-queries"; - kind = branch; - }; - }; - 28AAB6AC29CA57D40087654B /* XCRemoteSwiftPackageReference "tree-sitter-dart" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/lukepistrol/tree-sitter-dart.git"; - requirement = { - branch = feature/spm; + branch = main; kind = branch; }; }; @@ -686,9 +666,9 @@ }; 28B3F061290C372D000CD04D /* XCRemoteSwiftPackageReference "tree-sitter-zig" */ = { isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/maxxnino/tree-sitter-zig.git"; + repositoryURL = "https://github.com/tree-sitter-grammars/tree-sitter-zig.git"; requirement = { - branch = main; + branch = master; kind = branch; }; }; @@ -702,7 +682,23 @@ }; 6C0B93A62B5DD95500323006 /* XCRemoteSwiftPackageReference "tree-sitter-css" */ = { isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/tree-sitter/tree-sitter-css"; + repositoryURL = "https://github.com/tree-sitter/tree-sitter-css.git"; + requirement = { + branch = master; + kind = branch; + }; + }; + 6C7CA2AB2CE9743E006D9D9A /* XCRemoteSwiftPackageReference "tree-sitter-objc" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/tree-sitter-grammars/tree-sitter-objc"; + requirement = { + branch = master; + kind = branch; + }; + }; + 6CE117FA2CEA7CF80082D393 /* XCRemoteSwiftPackageReference "tree-sitter-dart" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/UserNobody14/tree-sitter-dart.git"; requirement = { branch = master; kind = branch; @@ -710,9 +706,9 @@ }; 6CEC70FC29C3A85000B61C7A /* XCRemoteSwiftPackageReference "tree-sitter-regex" */ = { isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/thecoolwinter/tree-sitter-regex/"; + repositoryURL = "https://github.com/tree-sitter/tree-sitter-regex.git"; requirement = { - branch = feature/spm; + branch = master; kind = branch; }; }; @@ -774,9 +770,9 @@ }; 9D7399222A5A245000CEF6E8 /* XCRemoteSwiftPackageReference "tree-sitter-agda" */ = { isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/cengelbart39/tree-sitter-agda.git"; + repositoryURL = "https://github.com/tree-sitter/tree-sitter-agda.git"; requirement = { - branch = feat/spm; + branch = master; kind = branch; }; }; @@ -814,20 +810,15 @@ }; 9DFDC3642A02D9BE0023B3BC /* XCRemoteSwiftPackageReference "tree-sitter-markdown" */ = { isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/MDeiml/tree-sitter-markdown"; + repositoryURL = "https://github.com/tree-sitter-grammars/tree-sitter-markdown"; requirement = { - kind = exactVersion; - version = 0.1.5; + branch = split_parser; + kind = branch; }; }; /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - 28171CB729814CD800523F1C /* TreeSitterObjC */ = { - isa = XCSwiftPackageProductDependency; - package = 28171CB629814CD800523F1C /* XCRemoteSwiftPackageReference "tree-sitter-objc" */; - productName = TreeSitterObjC; - }; 282E5976298051980064B34A /* TreeSitterYAML */ = { isa = XCSwiftPackageProductDependency; package = 282E5975298051980064B34A /* XCRemoteSwiftPackageReference "tree-sitter-yaml" */; @@ -848,11 +839,6 @@ package = 2886C786298135540023E016 /* XCRemoteSwiftPackageReference "tree-sitter-kotlin" */; productName = TreeSitterKotlin; }; - 28AAB6AD29CA57D40087654B /* TreeSitterDart */ = { - isa = XCSwiftPackageProductDependency; - package = 28AAB6AC29CA57D40087654B /* XCRemoteSwiftPackageReference "tree-sitter-dart" */; - productName = TreeSitterDart; - }; 28B3F02C290C35D9000CD04D /* TreeSitterC */ = { isa = XCSwiftPackageProductDependency; package = 28B3F02B290C35D9000CD04D /* XCRemoteSwiftPackageReference "tree-sitter-c" */; @@ -938,11 +924,29 @@ package = 6C0B93A62B5DD95500323006 /* XCRemoteSwiftPackageReference "tree-sitter-css" */; productName = TreeSitterCSS; }; + 6C7CA2AC2CE9743E006D9D9A /* TreeSitterObjc */ = { + isa = XCSwiftPackageProductDependency; + package = 6C7CA2AB2CE9743E006D9D9A /* XCRemoteSwiftPackageReference "tree-sitter-objc" */; + productName = TreeSitterObjc; + }; + 6CE117F82CEA7BDC0082D393 /* TreeSitterDart */ = { + isa = XCSwiftPackageProductDependency; + productName = TreeSitterDart; + }; + 6CE117FB2CEA7CF80082D393 /* TreeSitterDart */ = { + isa = XCSwiftPackageProductDependency; + package = 6CE117FA2CEA7CF80082D393 /* XCRemoteSwiftPackageReference "tree-sitter-dart" */; + productName = TreeSitterDart; + }; 6CEC70FD29C3A85000B61C7A /* TreeSitterRegex */ = { isa = XCSwiftPackageProductDependency; package = 6CEC70FC29C3A85000B61C7A /* XCRemoteSwiftPackageReference "tree-sitter-regex" */; productName = TreeSitterRegex; }; + 6CF2B8402CE978F100CBE5D1 /* TreeSitterDart */ = { + isa = XCSwiftPackageProductDependency; + productName = TreeSitterDart; + }; 8E74B41C2A4C88ED003A9550 /* TreeSitterHTML */ = { isa = XCSwiftPackageProductDependency; package = 8E74B41B2A4C88ED003A9550 /* XCRemoteSwiftPackageReference "tree-sitter-html" */; diff --git a/CodeLanguages-Container/CodeLanguages-Container.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/CodeLanguages-Container/CodeLanguages-Container.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index b166f11..43c7efd 100644 --- a/CodeLanguages-Container/CodeLanguages-Container.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/CodeLanguages-Container/CodeLanguages-Container.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,21 +1,13 @@ { + "originHash" : "c940c7467f54711e27ceb0cef308954e1fdbcc20f3dd59d96d6efbe29d7a04ba", "pins" : [ - { - "identity" : "swifttreesitter", - "kind" : "remoteSourceControl", - "location" : "https://github.com/ChimeHQ/SwiftTreeSitter.git", - "state" : { - "revision" : "2599e95310b3159641469d8a21baf2d3d200e61f", - "version" : "0.8.0" - } - }, { "identity" : "tree-sitter-agda", "kind" : "remoteSourceControl", - "location" : "https://github.com/cengelbart39/tree-sitter-agda.git", + "location" : "https://github.com/tree-sitter/tree-sitter-agda.git", "state" : { - "branch" : "feat/spm", - "revision" : "076e015d084867a3f367fce3c23dee09fb666eb2" + "branch" : "master", + "revision" : "b9b32fa042c2952a7bfca86847ea325e44ccc897" } }, { @@ -24,7 +16,7 @@ "location" : "https://github.com/tree-sitter/tree-sitter-bash.git", "state" : { "branch" : "master", - "revision" : "f7239f638d3dc16762563a9027faeee518ce1bd9" + "revision" : "49c31006d8307dcb12bc5770f35b6d5b9e2be68e" } }, { @@ -57,7 +49,7 @@ { "identity" : "tree-sitter-css", "kind" : "remoteSourceControl", - "location" : "https://github.com/tree-sitter/tree-sitter-css", + "location" : "https://github.com/tree-sitter/tree-sitter-css.git", "state" : { "branch" : "master", "revision" : "98c7b3dceb24f1ee17f1322f3947e55638251c37" @@ -66,10 +58,10 @@ { "identity" : "tree-sitter-dart", "kind" : "remoteSourceControl", - "location" : "https://github.com/lukepistrol/tree-sitter-dart.git", + "location" : "https://github.com/UserNobody14/tree-sitter-dart.git", "state" : { - "branch" : "feature/spm", - "revision" : "38d41b085dfbea84e940ef756a69485c71e403d0" + "branch" : "master", + "revision" : "e81af6ab94a728ed99c30083be72d88e6d56cf9e" } }, { @@ -174,37 +166,37 @@ { "identity" : "tree-sitter-kotlin", "kind" : "remoteSourceControl", - "location" : "https://github.com/lukepistrol/tree-sitter-kotlin", + "location" : "https://github.com/fwcd/tree-sitter-kotlin", "state" : { - "branch" : "feature/spm-queries", - "revision" : "e32e32678449efaeccd908e41ed6b27ec8c9d2cf" + "branch" : "main", + "revision" : "76f53c48d29e8588934fb55b0240d7bdfe00bfe5" } }, { "identity" : "tree-sitter-lua", "kind" : "remoteSourceControl", - "location" : "https://github.com/lukepistrol/tree-sitter-lua.git", + "location" : "https://github.com/tree-sitter-grammars/tree-sitter-lua", "state" : { - "branch" : "feature/spm", - "revision" : "47d56065016862b85ad327d6976b1e664e1c034b" + "branch" : "main", + "revision" : "34e60e7f45fc313463c68090d88d742a55d1bd7a" } }, { "identity" : "tree-sitter-markdown", "kind" : "remoteSourceControl", - "location" : "https://github.com/MDeiml/tree-sitter-markdown", + "location" : "https://github.com/tree-sitter-grammars/tree-sitter-markdown", "state" : { - "revision" : "fa6bfd51727e4bef99f7eec5f43947f73d64ea7d", - "version" : "0.1.5" + "branch" : "split_parser", + "revision" : "5cdc549ab8f461aff876c5be9741027189299cec" } }, { "identity" : "tree-sitter-objc", "kind" : "remoteSourceControl", - "location" : "https://github.com/lukepistrol/tree-sitter-objc", + "location" : "https://github.com/tree-sitter-grammars/tree-sitter-objc", "state" : { - "branch" : "feature/spm", - "revision" : "1b54ef0b5efddddf393b45e173788499cc572048" + "branch" : "master", + "revision" : "62e61b6f5c0289c376d61a8c91faf6435cde9012" } }, { @@ -246,10 +238,10 @@ { "identity" : "tree-sitter-regex", "kind" : "remoteSourceControl", - "location" : "https://github.com/thecoolwinter/tree-sitter-regex/", + "location" : "https://github.com/tree-sitter/tree-sitter-regex.git", "state" : { - "branch" : "feature/spm", - "revision" : "bcdbf846fa8cfce0d28971d43199e52c1e365aa7" + "branch" : "master", + "revision" : "4470c59041416e8a2a9fa343595ca28ed91f38b8" } }, { @@ -327,21 +319,21 @@ { "identity" : "tree-sitter-yaml", "kind" : "remoteSourceControl", - "location" : "https://github.com/lukepistrol/tree-sitter-yaml.git", + "location" : "https://github.com/tree-sitter-grammars/tree-sitter-yaml.git", "state" : { - "branch" : "feature/spm", - "revision" : "1e4bf920c1f43cea89c8858ed5e0c10b098bb2b0" + "branch" : "master", + "revision" : "7b03feefd36b5f155465ca736c6304aca983b267" } }, { "identity" : "tree-sitter-zig", "kind" : "remoteSourceControl", - "location" : "https://github.com/maxxnino/tree-sitter-zig.git", + "location" : "https://github.com/tree-sitter-grammars/tree-sitter-zig.git", "state" : { - "branch" : "main", - "revision" : "0d08703e4c3f426ec61695d7617415fff97029bd" + "branch" : "master", + "revision" : "eb7d58c2dc4fbeea4745019dee8df013034ae66b" } } ], - "version" : 2 + "version" : 3 } diff --git a/CodeLanguagesContainer.xcframework.zip b/CodeLanguagesContainer.xcframework.zip index de83d7d..8d8d776 100644 Binary files a/CodeLanguagesContainer.xcframework.zip and b/CodeLanguagesContainer.xcframework.zip differ diff --git a/Package.resolved b/Package.resolved index 4c4e8b1..6b41240 100644 --- a/Package.resolved +++ b/Package.resolved @@ -5,8 +5,17 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/ChimeHQ/SwiftTreeSitter.git", "state" : { - "revision" : "2599e95310b3159641469d8a21baf2d3d200e61f", - "version" : "0.8.0" + "revision" : "36aa61d1b531f744f35229f010efba9c6d6cbbdd", + "version" : "0.9.0" + } + }, + { + "identity" : "tree-sitter", + "kind" : "remoteSourceControl", + "location" : "https://github.com/tree-sitter/tree-sitter", + "state" : { + "revision" : "d97db6d63507eb62c536bcb2c4ac7d70c8ec665e", + "version" : "0.23.2" } } ], diff --git a/Package.swift b/Package.swift index 745a64d..5ff76ab 100644 --- a/Package.swift +++ b/Package.swift @@ -15,7 +15,7 @@ let package = Package( dependencies: [ .package( url: "https://github.com/ChimeHQ/SwiftTreeSitter.git", - exact: "0.8.0" + from: "0.9.0" ), ], targets: [ @@ -27,6 +27,7 @@ let package = Package( ], linkerSettings: [.linkedLibrary("c++")] ), + .binaryTarget( name: "CodeLanguagesContainer", path: "CodeLanguagesContainer.xcframework.zip" diff --git a/README.md b/README.md index 3b327a7..bd2642a 100644 --- a/README.md +++ b/README.md @@ -47,13 +47,13 @@ In order to add support for additional languages we have a complete guide on how | Grammar | Implemented | Syntax Highlighting | | -------------- | :---------: | :-----------------: | -| [Agda](https://github.com/cengelbart39/tree-sitter-agda/tree/feat/spm) | ✅ | _not available_ | +| [Agda](https://github.com/tree-sitter/tree-sitter-agda.git) | ✅ | _not available_ | | [Bash](https://github.com/tree-sitter/tree-sitter-bash) | ✅ | ✅ | | [C](https://github.com/tree-sitter/tree-sitter-c) | ✅ | ✅ | | [C++](https://github.com/tree-sitter/tree-sitter-cpp) | ✅ | ✅ | | [C#](https://github.com/tree-sitter/tree-sitter-c-sharp) | ✅ | ✅ | -| [CSS](https://github.com/lukepistrol/tree-sitter-css) | ✅ | ✅ | -| [Dart](https://github.com/lukepistrol/tree-sitter-dart/tree/feature/spm) | ✅ | ✅ | +| [CSS](https://github.com/tree-sitter/tree-sitter-css.git) | ✅ | ✅ | +| [Dart](https://github.com/UserNobody14/tree-sitter-dart.git) | ✅ | ✅ | | [Dockerfile](https://github.com/camdencheek/tree-sitter-dockerfile) | ✅ | ✅ | | [Elixir](https://github.com/elixir-lang/tree-sitter-elixir) | ✅ | ✅ | | [ERB, EJS](https://github.com/tree-sitter/tree-sitter-embedded-template) | | | @@ -65,10 +65,10 @@ In order to add support for additional languages we have a complete guide on how | [JSDoc](https://github.com/tree-sitter/tree-sitter-jsdoc) | ✅ | ✅ | | [JSON](https://github.com/tree-sitter/tree-sitter-json) | ✅ | ✅ | | [Julia](https://github.com/tree-sitter/tree-sitter-julia) | ✅ | _not available_ | -| [Kotlin](https://github.com/lukepistrol/tree-sitter-kotlin/tree/feature/spm-queries) | ✅ | ✅ | -| [Lua](https://github.com/lukepistrol/tree-sitter-lua/tree/feature/spm) | ✅ | ✅ | -| [Markdown](https://github.com/MDeiml/tree-sitter-markdown) | ✅ | ✅ | -| [Objective C](https://github.com/lukepistrol/tree-sitter-objc/tree/feature/spm) | ✅ | ✅ | +| [Kotlin](https://github.com/fwcd/tree-sitter-kotlin) | ✅ | ✅ | +| [Lua](https://github.com/tree-sitter-grammars/tree-sitter-lua) | ✅ | ✅ | +| [Markdown](https://github.com/tree-sitter-grammars/tree-sitter-markdown) | ✅ | ✅ | +| [Objective C](https://github.com/tree-sitter-grammars/tree-sitter-objc) | ✅ | ✅ | | [OCaml](https://github.com/tree-sitter/tree-sitter-ocaml) | ✅ | ✅ | | Plain Text | ✅ | _not available_ | | [Perl](https://github.com/ganezdragon/tree-sitter-perl) | ✅ | _not available_ | @@ -83,8 +83,8 @@ In order to add support for additional languages we have a complete guide on how | [TOML](https://github.com/cengelbart39/tree-sitter-toml/tree/feature/spm) | ✅ | ✅ | | [TypeScript/TSX](https://github.com/tree-sitter/tree-sitter-typescript) | ✅ | ✅ | | [Verilog](https://github.com/tree-sitter/tree-sitter-verilog) | ✅ | _not available_ | -| [YAML](https://github.com/lukepistrol/tree-sitter-yaml/tree/feature/spm) | ✅ | ✅ | -| [Zig](https://github.com/maxxnino/tree-sitter-zig) | ✅ | ✅ | +| [YAML](https://github.com/tree-sitter-grammars/tree-sitter-yaml.git) | ✅ | ✅ | +| [Zig](https://github.com/tree-sitter-grammars/tree-sitter-zig.git) | ✅ | ✅ | ## Related Repositories diff --git a/Sources/CodeEditLanguages/CodeLanguage+Definitions.swift b/Sources/CodeEditLanguages/CodeLanguage+Definitions.swift index f16eba8..2ac6c00 100644 --- a/Sources/CodeEditLanguages/CodeLanguage+Definitions.swift +++ b/Sources/CodeEditLanguages/CodeLanguage+Definitions.swift @@ -283,7 +283,9 @@ public extension CodeLanguage { tsName: "objc", extensions: ["m", "h"], lineCommentString: "//", - rangeCommentStrings: ("/*", "*/") + rangeCommentStrings: ("/*", "*/"), + parentURL: CodeLanguage.c.queryURL, + highlights: ["injections"] ) /// A language structure for `OCaml` diff --git a/Sources/CodeEditLanguages/CodeLanguage.swift b/Sources/CodeEditLanguages/CodeLanguage.swift index 07d8b6c..f8b6681 100644 --- a/Sources/CodeEditLanguages/CodeLanguage.swift +++ b/Sources/CodeEditLanguages/CodeLanguage.swift @@ -6,7 +6,7 @@ // import Foundation -import tree_sitter +import TreeSitter import SwiftTreeSitter import CodeLanguages_Container import RegexBuilder @@ -85,7 +85,7 @@ public struct CodeLanguage { } /// Gets the TSLanguage from `tree-sitter` - private var tsLanguage: UnsafeMutablePointer? { + private var tsLanguage: OpaquePointer? { switch id { case .agda: return tree_sitter_agda() diff --git a/Sources/CodeEditLanguages/Resources/tree-sitter-agda/highlights.scm b/Sources/CodeEditLanguages/Resources/tree-sitter-agda/highlights.scm new file mode 100644 index 0000000..d81f95e --- /dev/null +++ b/Sources/CodeEditLanguages/Resources/tree-sitter-agda/highlights.scm @@ -0,0 +1,81 @@ + + +;; Constants +(integer) @constant + +;; Variables and Symbols + +(typed_binding (atom (qid) @variable)) +(untyped_binding) @variable +(typed_binding (expr) @type) + +(id) @function +(bid) @function + +(function_name (atom (qid) @function)) +(field_name) @function + + +[(data_name) (record_name)] @constructor + +; Set +(SetN) @type.builtin + + +;; Imports and Module Declarations + +"import" @include + +(module_name) @namespace + +;; Pragmas and comments + +(pragma) @constant.macro + +(comment) @comment + +;; Keywords +[ + "where" + "data" + "rewrite" + "postulate" + "public" + "private" + "tactic" + "Prop" + "quote" + "renaming" + "open" + "in" + "hiding" + "constructor" + "abstract" + "let" + "field" + "mutual" + "module" + "infix" + "infixl" + "infixr" + "record" + "forall" + "∀" + "->" + "→" + "\\" + "λ" + "..." + "…" +] @keyword + +;; Brackets + +[ + "(" + ")" + "{" + "}"] +@punctuation.bracket + + diff --git a/Sources/CodeEditLanguages/Resources/tree-sitter-dart/highlights.scm b/Sources/CodeEditLanguages/Resources/tree-sitter-dart/highlights.scm index 0b824ea..56a68d5 100644 --- a/Sources/CodeEditLanguages/Resources/tree-sitter-dart/highlights.scm +++ b/Sources/CodeEditLanguages/Resources/tree-sitter-dart/highlights.scm @@ -1,18 +1,87 @@ -(dotted_identifier_list) @string +; Variable +(identifier) @variable + +; Keywords +; -------------------- +[ + (assert_builtin) + (break_builtin) + (const_builtin) + (part_of_builtin) + (rethrow_builtin) + (void_type) + "abstract" + "as" + "async" + "async*" + "await" + "base" + "case" + "catch" + "class" + "continue" + "covariant" + "default" + "deferred" + "do" + "dynamic" + "else" + "enum" + "export" + "extends" + "extension" + "external" + "factory" + "final" + "finally" + "for" + "Function" + "get" + "hide" + "if" + "implements" + "import" + "in" + "interface" + "is" + "late" + "library" + "mixin" + "new" + "on" + "operator" + "part" + "required" + "return" + "sealed" + "set" + "show" + "static" + "super" + "switch" + "sync*" + "throw" + "try" + "typedef" + "var" + "when" + "while" + "with" + "yield" +] @keyword ; Methods ; -------------------- -;; TODO: does not work -;(function_type - ;name: (identifier) @method) -(super) @function + +; NOTE: This query is a bit of a work around for the fact that the dart grammar doesn't +; specifically identify a node as a function call +(((identifier) @function (#match? @function "^_?[a-z]")) + . (selector . (argument_part))) @function ; Annotations ; -------------------- (annotation name: (identifier) @attribute) -(marker_annotation - name: (identifier) @attribute) ; Operators and Tokens ; -------------------- @@ -45,6 +114,7 @@ ">=" "<=" "||" + "~/" (increment_operator) (is_operator) (prefix_operator) @@ -52,6 +122,14 @@ (additive_operator) ] @operator +(type_arguments + "<" @punctuation.bracket + ">" @punctuation.bracket) + +(type_parameters + "<" @punctuation.bracket + ">" @punctuation.bracket) + [ "(" ")" @@ -71,54 +149,68 @@ ; Types ; -------------------- +(type_identifier) @type +((type_identifier) @type.builtin + (#match? @type.builtin "^(int|double|String|bool|List|Set|Map|Runes|Symbol)$")) (class_definition name: (identifier) @type) (constructor_signature name: (identifier) @type) -;; TODO: does not work -;(type_identifier - ;(identifier) @type) (scoped_identifier scope: (identifier) @type) (function_signature - name: (identifier) @method) + name: (identifier) @function) (getter_signature - (identifier) @method) + (identifier) @function) (setter_signature - name: (identifier) @method) -(enum_declaration - name: (identifier) @type) -(enum_constant - name: (identifier) @type) -(type_identifier) @type -(void_type) @type + name: (identifier) @function) ((scoped_identifier scope: (identifier) @type name: (identifier) @type) (#match? @type "^[a-zA-Z]")) -(type_identifier) @type +; Enums +; ------------------- +(enum_declaration + name: (identifier) @type) +(enum_constant + name: (identifier) @identifier.constant) ; Variables ; -------------------- ; var keyword (inferred_type) @keyword -(const_builtin) @constant.builtin -(final_builtin) @constant.builtin - ((identifier) @type - (#match? @type "^_?[A-Z]")) + (#match? @type "^_?[A-Z].*[a-z]")) ("Function" @type) +(this) @variable.builtin + ; properties -; TODO: add method/call_expression to grammar and -; distinguish method call from variable access + (unconditional_assignable_selector (identifier) @property) +(conditional_assignable_selector + (identifier) @property) + +(cascade_section + (cascade_selector + (identifier) @property)) + +((selector + (unconditional_assignable_selector (identifier) @function)) + (selector (argument_part (arguments))) +) + +(cascade_section + (cascade_selector (identifier) @function) + (argument_part (arguments)) +) + ; assignments (assignment_expression left: (assignable_expression) @variable) @@ -128,10 +220,10 @@ ; Parameters ; -------------------- (formal_parameter - name: (identifier) @parameter) + name: (identifier) @identifier.parameter) (named_argument - (label (identifier) @parameter)) + (label (identifier) @identifier.parameter)) ; Literals ; -------------------- @@ -144,81 +236,11 @@ ; (hex_floating_point_literal) ] @number -(symbol_literal) @symbol (string_literal) @string +(symbol_literal (identifier) @constant) @constant (true) @boolean (false) @boolean -(null_literal) @constant.builtin +(null_literal) @constant.null (documentation_comment) @comment (comment) @comment - -; Keywords -; -------------------- -["import" "library" "export"] @include - -; Reserved words (cannot be used as identifiers) -; TODO: "rethrow" @keyword -[ - ; "assert" - (case_builtin) - "extension" - "on" - "class" - "enum" - "extends" - "in" - "is" - "new" - "return" - "super" - "with" -] @keyword - - -; Built in identifiers: -; alone these are marked as keywords -[ - "abstract" - "as" - "async" - "async*" - "yield" - "sync*" - "await" - "covariant" - "deferred" - "dynamic" - "external" - "factory" - "get" - "implements" - "interface" - "library" - "operator" - "mixin" - "part" - "set" - "show" - "static" - "typedef" -] @keyword - -; when used as an identifier: -((identifier) @variable.builtin - (#vim-match? @variable.builtin "^(abstract|as|covariant|deferred|dynamic|export|external|factory|Function|get|implements|import|interface|library|operator|mixin|part|set|static|typedef)$")) - -["if" "else" "switch" "default"] @conditional - -[ - "try" - "throw" - "catch" - "finally" - (break_statement) -] @exception - -["do" "while" "continue" "for"] @repeat - -; Error -(ERROR) @error \ No newline at end of file diff --git a/Sources/CodeEditLanguages/Resources/tree-sitter-dart/tags.scm b/Sources/CodeEditLanguages/Resources/tree-sitter-dart/tags.scm new file mode 100644 index 0000000..35ebc99 --- /dev/null +++ b/Sources/CodeEditLanguages/Resources/tree-sitter-dart/tags.scm @@ -0,0 +1,92 @@ + +(class_definition + name: (identifier) @name) @definition.class + +(method_signature + (function_signature)) @definition.method + +(type_alias + (type_identifier) @name) @definition.type + +(method_signature +(getter_signature + name: (identifier) @name)) @definition.method + +(method_signature +(setter_signature + name: (identifier) @name)) @definition.method + +(method_signature + (function_signature + name: (identifier) @name)) @definition.method + +(method_signature + (factory_constructor_signature + (identifier) @name)) @definition.method + +(method_signature + (constructor_signature + name: (identifier) @name)) @definition.method + +(method_signature + (operator_signature)) @definition.method + +(method_signature) @definition.method + +(mixin_declaration + (mixin) + (identifier) @name) @definition.mixin + +(extension_declaration + name: (identifier) @name) @definition.extension + + +(new_expression + (type_identifier) @name) @reference.class + +(enum_declaration + name: (identifier) @name) @definition.enum + +(function_signature + name: (identifier) @name) @definition.function + +(initialized_variable_definition + name: (identifier) + value: (identifier) @name + value: (selector + "!"? + (argument_part + (arguments + (argument)*))?)?) @reference.class + +(assignment_expression + left: (assignable_expression + (identifier) + (unconditional_assignable_selector + "." + (identifier) @name))) @reference.call + +(assignment_expression + left: (assignable_expression + (identifier) + (conditional_assignable_selector + "?." + (identifier) @name))) @reference.call + +((identifier) @name + (selector + "!"? + (conditional_assignable_selector + "?." (identifier) @name)? + (unconditional_assignable_selector + "."? (identifier) @name)? + (argument_part + (arguments + (argument)*))?)* + (cascade_section + (cascade_selector + (identifier)) @name + (argument_part + (arguments + (argument)*))?)?) @reference.call + diff --git a/Sources/CodeEditLanguages/Resources/tree-sitter-dart/test.scm b/Sources/CodeEditLanguages/Resources/tree-sitter-dart/test.scm new file mode 100644 index 0000000..92a8daa --- /dev/null +++ b/Sources/CodeEditLanguages/Resources/tree-sitter-dart/test.scm @@ -0,0 +1 @@ +(if_statement (block)) \ No newline at end of file diff --git a/Sources/CodeEditLanguages/Resources/tree-sitter-kotlin/highlights.scm b/Sources/CodeEditLanguages/Resources/tree-sitter-kotlin/highlights.scm index ad7a3dc..6f1c968 100644 --- a/Sources/CodeEditLanguages/Resources/tree-sitter-kotlin/highlights.scm +++ b/Sources/CodeEditLanguages/Resources/tree-sitter-kotlin/highlights.scm @@ -1,3 +1,9 @@ +;; Based on the nvim-treesitter highlighting, which is under the Apache license. +;; See https://github.com/nvim-treesitter/nvim-treesitter/blob/f8ab59861eed4a1c168505e3433462ed800f2bae/queries/kotlin/highlights.scm +;; +;; The only difference in this file is that queries using #lua-match? +;; have been removed. + ;;; Identifiers (simple_identifier) @variable @@ -33,23 +39,11 @@ (navigation_suffix (simple_identifier) @property)) -; SCREAMING CASE identifiers are assumed to be constants -((simple_identifier) @constant -(#match? @constant "^[A-Z][A-Z0-9_]*$")) - -(_ - (navigation_suffix - (simple_identifier) @constant - (#match? @constant "^[A-Z][A-Z0-9_]*$"))) - (enum_entry (simple_identifier) @constant) (type_identifier) @type -(type_alias - (type_identifier) @type.definition) - ((type_identifier) @type.builtin (#any-of? @type.builtin "Byte" @@ -89,27 +83,12 @@ "MutableList" )) -(package_header "package" @keyword - . (identifier (simple_identifier) @namespace)) +(package_header + . (identifier)) @namespace (import_header "import" @include) -; The last `simple_identifier` in a `import_header` will always either be a function -; or a type. Classes can appear anywhere in the import path, unlike functions -(import_header - (identifier - (simple_identifier) @type @_import) - (import_alias - (type_identifier) @type.definition)? - (#match? @_import "^[A-Z]")) - -(import_header - (identifier - (simple_identifier) @function @_import .) - (import_alias - (type_identifier) @function)? - (#match? @_import "^[a-z]")) ; TODO: Seperate labeled returns/breaks/continue/super/this ; Must be implemented in the parser first @@ -152,13 +131,13 @@ ; function() (call_expression - . (simple_identifier) @function.call) + . (simple_identifier) @function) ; object.function() or object.property.function() (call_expression (navigation_expression (navigation_suffix - (simple_identifier) @function.call) . )) + (simple_identifier) @function) . )) (call_expression . (simple_identifier) @function.builtin @@ -210,11 +189,11 @@ ;;; Literals -(comment) @comment - -(shebang_line) @preproc - -(comment) @spell +[ + (line_comment) + (multiline_comment) + (shebang_line) +] @comment (real_literal) @float [ @@ -226,25 +205,21 @@ ] @number [ - "null" ; should be highlighted the same as booleans + (null_literal) ; should be highlighted the same as booleans (boolean_literal) ] @boolean (character_literal) @character -[ - (line_string_literal) - (multi_line_string_literal) -] @string +(string_literal) @string -; NOTE: Escapes not allowed in multi-line strings -(line_string_literal (character_escape_seq) @string.escape) +(character_escape_seq) @string.escape ; There are 3 ways to define a regex ; - "[abc]?".toRegex() (call_expression (navigation_expression - ([(line_string_literal) (multi_line_string_literal)] @string.regex) + ((string_literal) @string.regex) (navigation_suffix ((simple_identifier) @_function (#eq? @_function "toRegex"))))) @@ -256,9 +231,9 @@ (call_suffix (value_arguments (value_argument - [ (line_string_literal) (multi_line_string_literal) ] @string.regex)))) + (string_literal) @string.regex)))) -; - Regex.fromLiteral("[abc]?") +; - Regex.fromLiteral("[abc]?") (call_expression (navigation_expression ((simple_identifier) @_class @@ -269,14 +244,11 @@ (call_suffix (value_arguments (value_argument - [ (line_string_literal) (multi_line_string_literal) ] @string.regex)))) + (string_literal) @string.regex)))) ;;; Keywords (type_alias "typealias" @keyword) - -(companion_object "companion" @keyword) - [ (class_modifier) (member_modifier) @@ -288,7 +260,7 @@ (visibility_modifier) (reification_modifier) (inheritance_modifier) -] @type.qualifier +]@keyword [ "val" @@ -399,18 +371,10 @@ ] @punctuation.delimiter ; NOTE: `interpolated_identifier`s can be highlighted in any way -(line_string_literal +(string_literal "$" @punctuation.special (interpolated_identifier) @none) -(line_string_literal - "${" @punctuation.special - (interpolated_expression) @none - "}" @punctuation.special) - -(multi_line_string_literal - "$" @punctuation.special - (interpolated_identifier) @none) -(multi_line_string_literal +(string_literal "${" @punctuation.special (interpolated_expression) @none "}" @punctuation.special) diff --git a/Sources/CodeEditLanguages/Resources/tree-sitter-lua/highlights.scm b/Sources/CodeEditLanguages/Resources/tree-sitter-lua/highlights.scm index f3009a7..5bdfcab 100644 --- a/Sources/CodeEditLanguages/Resources/tree-sitter-lua/highlights.scm +++ b/Sources/CodeEditLanguages/Resources/tree-sitter-lua/highlights.scm @@ -132,14 +132,15 @@ (#eq? @variable.builtin "self")) (variable_list - attribute: (attribute - (["<" ">"] @punctuation.bracket - (identifier) @attribute))) + (attribute + "<" @punctuation.bracket + (identifier) @attribute + ">" @punctuation.bracket)) ;; Constants ((identifier) @constant - (#lua-match? @constant "^[A-Z][A-Z_0-9]*$")) + (#match? @constant "^[A-Z][A-Z_0-9]*$")) (vararg_expression) @constant @@ -166,13 +167,40 @@ (parameters (identifier) @parameter) -(function_call name: (identifier) @function.call) -(function_declaration name: (identifier) @function) +(function_declaration + name: [ + (identifier) @function + (dot_index_expression + field: (identifier) @function) + ]) + +(function_declaration + name: (method_index_expression + method: (identifier) @method)) + +(assignment_statement + (variable_list . + name: [ + (identifier) @function + (dot_index_expression + field: (identifier) @function) + ]) + (expression_list . + value: (function_definition))) -(function_call name: (dot_index_expression field: (identifier) @function.call)) -(function_declaration name: (dot_index_expression field: (identifier) @function)) +(table_constructor + (field + name: (identifier) @function + value: (function_definition))) -(method_index_expression method: (identifier) @method) +(function_call + name: [ + (identifier) @function.call + (dot_index_expression + field: (identifier) @function.call) + (method_index_expression + method: (identifier) @method.call) + ]) (function_call (identifier) @function.builtin @@ -192,3 +220,5 @@ (number) @number (string) @string + +(escape_sequence) @string.escape diff --git a/Sources/CodeEditLanguages/Resources/tree-sitter-lua/tags.scm b/Sources/CodeEditLanguages/Resources/tree-sitter-lua/tags.scm new file mode 100644 index 0000000..8459cd4 --- /dev/null +++ b/Sources/CodeEditLanguages/Resources/tree-sitter-lua/tags.scm @@ -0,0 +1,34 @@ +(function_declaration + name: [ + (identifier) @name + (dot_index_expression + field: (identifier) @name) + ]) @definition.function + +(function_declaration + name: (method_index_expression + method: (identifier) @name)) @definition.method + +(assignment_statement + (variable_list . + name: [ + (identifier) @name + (dot_index_expression + field: (identifier) @name) + ]) + (expression_list . + value: (function_definition))) @definition.function + +(table_constructor + (field + name: (identifier) @name + value: (function_definition))) @definition.function + +(function_call + name: [ + (identifier) @name + (dot_index_expression + field: (identifier) @name) + (method_index_expression + method: (identifier) @name) + ]) @reference.call diff --git a/Sources/CodeEditLanguages/Resources/tree-sitter-markdown-inline/highlights.scm b/Sources/CodeEditLanguages/Resources/tree-sitter-markdown-inline/highlights.scm index 7e9ce2c..8c87c78 100644 --- a/Sources/CodeEditLanguages/Resources/tree-sitter-markdown-inline/highlights.scm +++ b/Sources/CodeEditLanguages/Resources/tree-sitter-markdown-inline/highlights.scm @@ -29,9 +29,9 @@ (hard_line_break) ] @string.escape -; ")" not part of query because of -; https://github.com/nvim-treesitter/nvim-treesitter/issues/2206 -; TODO: Find better fix for this -(image ["!" "[" "]" "("] @punctuation.delimiter) -(inline_link ["[" "]" "("] @punctuation.delimiter) +(image ["!" "[" "]" "(" ")"] @punctuation.delimiter) +(inline_link ["[" "]" "(" ")"] @punctuation.delimiter) (shortcut_link ["[" "]"] @punctuation.delimiter) + +; NOTE: extension not enabled by default +; (wiki_link ["[" "|" "]"] @punctuation.delimiter) diff --git a/Sources/CodeEditLanguages/Resources/tree-sitter-objc/folds.scm b/Sources/CodeEditLanguages/Resources/tree-sitter-objc/folds.scm new file mode 100644 index 0000000..b922f8b --- /dev/null +++ b/Sources/CodeEditLanguages/Resources/tree-sitter-objc/folds.scm @@ -0,0 +1,20 @@ +; inherits: c + +[ + (class_declaration) + (class_interface) + (class_implementation) + (protocol_declaration) + (property_declaration) + (method_declaration) + (struct_declaration) + (struct_declarator) + (try_statement) + (catch_clause) + (finally_clause) + (throw_statement) + (block_literal) + (ms_asm_block) + (dictionary_literal) + (array_literal) +] @fold diff --git a/Sources/CodeEditLanguages/Resources/tree-sitter-objc/highlights.scm b/Sources/CodeEditLanguages/Resources/tree-sitter-objc/highlights.scm index ff4c8fa..c636895 100644 --- a/Sources/CodeEditLanguages/Resources/tree-sitter-objc/highlights.scm +++ b/Sources/CodeEditLanguages/Resources/tree-sitter-objc/highlights.scm @@ -1,395 +1,216 @@ -[ - (comment) - (pragma) -] @comment +; inherits: c + +; Preprocs + +(preproc_undef + name: (_) @constant) @preproc + +; Includes + +(module_import "@import" @include path: (identifier) @namespace) + +((preproc_include + _ @include path: (_)) + (#any-of? @include "#include" "#import")) + +; Type Qualifiers [ - (self) - (super) -] @variable.builtin + "@optional" + "@required" + "__covariant" + "__contravariant" + (visibility_specification) +] @type.qualifier + +; Storageclasses [ - (getter) - (setter) - (nonnull) - (nullable) - (null_resettable) - (unsafe_unretained) - (null_unspecified) - (direct) - (readwrite) - (readonly) - (strong) - (weak) - (copy) - (assign) - (retain) - (atomic) - (nonatomic) - (class) - (NS_NONATOMIC_IOSONLY) - (DISPATCH_QUEUE_REFERENCE_TYPE) -] @keyword + "@autoreleasepool" + "@synthesize" + "@dynamic" + "volatile" + (protocol_qualifier) +] @storageclass + +; Keywords [ - "@interface" "@protocol" - "@property" - "@end" + "@interface" "@implementation" "@compatibility_alias" - "@autoreleasepool" - "@synchronized" - "@class" - "@synthesize" - "@dynamic" + "@property" + "@selector" "@defs" + "availability" + "@end" +] @keyword + +(class_declaration "@" @keyword "class" @keyword) ; I hate Obj-C for allowing "@ class" :) + +(method_definition ["+" "-"] @keyword.function) +(method_declaration ["+" "-"] @keyword.function) + +[ + "__typeof__" + "__typeof" + "typeof" + "in" +] @keyword.operator + +[ + "@synchronized" + "oneway" +] @keyword.coroutine + +; Exceptions + +[ "@try" + "__try" "@catch" + "__catch" "@finally" + "__finally" "@throw" - "@selector" - "@encode" - (private) - (public) - (protected) - (package) - (optional) - (required) - "NS_ENUM" - "NS_ERROR_ENUM" - "NS_OPTIONS" - "NS_SWIFT_NAME" - (type_qualifier) - (storage_class_specifier) - "NS_NOESCAPE" - "const" - "default" - "enum" - "extern" - "inline" - "static" - "struct" - "typedef" - "typeof" - "__typeof" - "__typeof__" - "_Atomic" - "union" - "volatile" - "goto" - "register" - "__covariant" - "__contravariant" - "__GENERICS" -] @keyword +] @exception -"sizeof" @keyword.operator -"return" @keyword.return +; Variables -[ - "while" - "for" - "do" - "continue" - "break" -] @keyword.repeat +((identifier) @variable.builtin + (#any-of? @variable.builtin "self" "super")) -"#define" @constant.macro +; Functions & Methods [ - "#if" - "#ifdef" - "#ifndef" - "#else" - "#elif" - "#endif" - (preproc_directive) -] @keyword + "objc_bridge_related" + "@available" + "__builtin_available" + "va_arg" + "asm" +] @function.builtin -"#include" @include -"#import" @include -"@import" @include +(method_definition (identifier) @method) -[ - "=" +(method_declaration (identifier) @method) - "-" - "*" - "/" - "+" - "%" +(method_identifier (identifier)? @method ":" @method (identifier)? @method) - "~" - "|" - "&" - "^" - "<<" - ">>" - - "->" - - "<" - "<=" - ">=" - ">" - "==" - "!=" - - "!" - "&&" - "||" - - "-=" - "+=" - "*=" - "/=" - "%=" - "|=" - "&=" - "^=" - ">>=" - "<<=" - "--" - "++" - "@" -] @operator +(message_expression method: (identifier) @method.call) -[ - "if" - "else" - "case" - "switch" -] @keyword.conditional +; Constructors -(conditional_expression [ "?" ":" ] @keyword.conditional) +((message_expression method: (identifier) @constructor) + (#eq? @constructor "init")) -[ - (true) - (false) - (YES) - (NO) -] @keyword.boolean +; Attributes -[ "." ";" ":" "," ] @punctuation.delimiter +(availability_attribute_specifier + [ + "CF_FORMAT_FUNCTION" "NS_AVAILABLE" "__IOS_AVAILABLE" "NS_AVAILABLE_IOS" + "API_AVAILABLE" "API_UNAVAILABLE" "API_DEPRECATED" "NS_ENUM_AVAILABLE_IOS" + "NS_DEPRECATED_IOS" "NS_ENUM_DEPRECATED_IOS" "NS_FORMAT_FUNCTION" "DEPRECATED_MSG_ATTRIBUTE" + "__deprecated_msg" "__deprecated_enum_msg" "NS_SWIFT_NAME" "NS_SWIFT_UNAVAILABLE" + "NS_EXTENSION_UNAVAILABLE_IOS" "NS_CLASS_AVAILABLE_IOS" "NS_CLASS_DEPRECATED_IOS" "__OSX_AVAILABLE_STARTING" + "NS_ROOT_CLASS" "NS_UNAVAILABLE" "NS_REQUIRES_NIL_TERMINATION" "CF_RETURNS_RETAINED" + "CF_RETURNS_NOT_RETAINED" "DEPRECATED_ATTRIBUTE" "UI_APPEARANCE_SELECTOR" "UNAVAILABLE_ATTRIBUTE" + ]) @attribute -"..." @punctuation.special +; Macros -[ "(" ")" "[" "]" "{" "}"] @punctuation.bracket +(type_qualifier + [ + "_Complex" + "_Nonnull" + "_Nullable" + "_Nullable_result" + "_Null_unspecified" + "__autoreleasing" + "__block" + "__bridge" + "__bridge_retained" + "__bridge_transfer" + "__complex" + "__kindof" + "__nonnull" + "__nullable" + "__ptrauth_objc_class_ro" + "__ptrauth_objc_isa_pointer" + "__ptrauth_objc_super_pointer" + "__strong" + "__thread" + "__unsafe_unretained" + "__unused" + "__weak" + ]) @function.macro.builtin -[ - (string_literal) - (string_expression) - (system_lib_string) - (module_string) -] @string +[ "__real" "__imag" ] @function.macro.builtin -(escape_sequence) @string.escape +((call_expression function: (identifier) @function.macro) + (#eq? @function.macro "testassert")) -(null) @constant.builtin -(nil) @constant.builtin -(number_literal) @number -(number_expression) @number -(char_literal) @character +; Types -[ - (preproc_arg) - (preproc_defined) -] @function.macro +(class_declaration (identifier) @type) -[ - (type_identifier) - (primitive_type) - (sized_type_specifier) - (type_descriptor) - (generics_type_reference) -] @type +(class_interface "@interface" . (identifier) @type superclass: _? @type category: _? @namespace) + +(class_implementation "@implementation" . (identifier) @type superclass: _? @type category: _? @namespace) + +(protocol_forward_declaration (identifier) @type) ; @interface :( + +(protocol_reference_list (identifier) @type) ; ^ [ - (id) - (Class) - (Method) - (IMP) - (SEL) - (BOOL) - (instancetype) - (auto) + "BOOL" + "IMP" + "SEL" + "Class" + "id" ] @type.builtin -(declaration (type_qualifier) @type) -(cast_expression type: (type_descriptor) @type) -(sizeof_expression value: (parenthesized_expression (identifier) @type)) - -;; Type Class & Category & Protocol -(class_interface name: (identifier) @type.class) -(category_interface name: (identifier) @type.class) -(category_interface category: (identifier) @type.category) -(superclass_reference name: (identifier) @type.class) -(parameterized_class_type_arguments) @type.class -(class_implementation name: (identifier) @type.class) -(category_implementation name: (identifier) @type.class) -(compatibility_alias_declaration (identifier) @type.class) -(parameterized_class_type_arguments (identifier) @type.class) -(category_implementation category: (identifier) @type.category) -(class_forward_declaration name: (identifier) @type.class) -(protocol_forward_declaration name: (identifier) @type.protocol) -(protocol_declaration name: (identifier) @type.protocol) -(protocol_qualifiers name: (identifier) @type.protocol) -(protocol_expression (identifier) @type.protocol) - -;; Preproc def / undef -(preproc_def - name: (_) @constant) -(preproc_call - directive: (preproc_directive) @_u - argument: (_) @constant - (#eq? @_u "#undef")) - -;; Property -(property_declaration - type: _ @type - declarator: (identifier) @property) - -(property_declaration - type: _ @type - declarator: (_ - declarator: (identifier) @property)) - -(property_declaration - type: _ @type - declarator: (_ - declarator: (_ - declarator: (identifier) @property))) - -(((field_expression - (field_identifier) @property)) @_parent - (#not-has-parent? @_parent function_declarator call_expression)) - -(field_expression - field: (field_identifier) @property) - -(((field_identifier) @property) - (#has-ancestor? @property field_declaration) - (#not-has-ancestor? @property function_declarator)) - -;; Variable -declarator: (identifier) @variable - -(cast_expression value: (identifier) @variable) - -;; Function -(call_expression - function: (identifier) @function) -(function_declarator - declarator: (identifier) @function) -(preproc_function_def - name: (identifier) @function.macro) -(selector_expression - name: (identifier) @function) -(method_declaration - selector: (identifier) @function) - -(method_declaration - (keyword_selector - (keyword_declarator - keyword: (identifier) @function))) - -(method_declaration - (keyword_selector - (keyword_declarator - name: (identifier) @variable.parameter))) - -(message_expression - receiver: (field_expression - field: (field_identifier) @function)) - -(method_definition - selector: (identifier) @function) - -(swift_name_attribute_sepcifier - method: (identifier) @function) - -(setter - name: (identifier) @function) - -(method_definition - (keyword_selector - (keyword_declarator - keyword: (identifier) @function))) - -(message_expression - selector: (identifier) @function) - -(method_definition - (keyword_selector - (keyword_declarator - name: (identifier) @variable.parameter))) - -(message_expression - selector: (keyword_argument_list - (keyword_argument - keyword: (identifier) @function))) - -(message_expression - selector: (keyword_argument_list - (keyword_argument - argument: (identifier) @variable.parameter))) - -(unary_expression argument: (identifier) @function) -(va_arg_expression) @function -(va_arg_expression va_list: (identifier) @variable) -(enumerator name: (identifier) @variable) - - -;; Parameters -(parameter_declaration - declarator: (identifier) @variable.parameter) - -(parameter_declaration - declarator: (pointer_declarator) @variable.parameter) - -(parameter_declaration - declarator: (pointer_declarator - declarator: (identifier) @variable.parameter)) - -(for_in_statement - loop: (identifier) @variable) - -(dictionary_expression - key: (_expression) @variable) -(dictionary_expression - value: (_expression) @variable) -(array_expression - (identifier) @variable) -(argument_list - (identifier) @variable) -(expression_statement - (identifier) @variable) -(_expression (identifier) @variable) +; Constants + +(property_attribute (identifier) @constant "="?) + +[ "__asm" "__asm__" ] @constant.macro + +; Properties + +(property_implementation "@synthesize" (identifier) @property) + +((identifier) @property + (#has-ancestor? @property struct_declaration)) + +; Parameters + +(method_parameter ":" @method (identifier) @parameter) + +(method_parameter declarator: (identifier) @parameter) + +(parameter_declaration + declarator: (function_declarator + declarator: (parenthesized_declarator + (block_pointer_declarator + declarator: (identifier) @parameter)))) + +"..." @parameter.builtin + +; Operators [ - "__attribute" - "__attribute__" - "__cdecl" - "__clrcall" - "__stdcall" - "__fastcall" - "__thiscall" - "__vectorcall" - "_unaligned" - "__unaligned" - "__declspec" - "__unused" - "__builtin_available" - "@available" - (attribute_specifier) - (class_interface_attribute_sepcifier) - (method_variadic_arguments_attribute_specifier) -] @attribute + "^" +] @operator + +; Literals + +(platform) @string.special + +(version_number) @text.uri @number -(attribute_specifier) @attribute +; Punctuation -((identifier) @constant - (#match? @constant "^[A-Z][A-Z0-9_$]+$")) +"@" @punctuation.special -(ERROR) @error \ No newline at end of file +[ "<" ">" ] @punctuation.bracket diff --git a/Sources/CodeEditLanguages/Resources/tree-sitter-objc/indents.scm b/Sources/CodeEditLanguages/Resources/tree-sitter-objc/indents.scm new file mode 100644 index 0000000..a5a5208 --- /dev/null +++ b/Sources/CodeEditLanguages/Resources/tree-sitter-objc/indents.scm @@ -0,0 +1 @@ +; inherits: c diff --git a/Sources/CodeEditLanguages/Resources/tree-sitter-objc/injections.scm b/Sources/CodeEditLanguages/Resources/tree-sitter-objc/injections.scm new file mode 100644 index 0000000..359420d --- /dev/null +++ b/Sources/CodeEditLanguages/Resources/tree-sitter-objc/injections.scm @@ -0,0 +1,10 @@ +; inherits: c + +; TODO(amaanq): uncomment/add when I add asm support +; (ms_asm_block "{" _ @asm "}") +; +; ((asm_specifier (string_literal) @asm) +; (#offset! @asm 0 1 0 -1)) +; +; ((asm_statement (string_literal) @asm) +; (#offset! @asm 0 1 0 -1)) diff --git a/Sources/CodeEditLanguages/Resources/tree-sitter-objc/locals.scm b/Sources/CodeEditLanguages/Resources/tree-sitter-objc/locals.scm new file mode 100644 index 0000000..a5a5208 --- /dev/null +++ b/Sources/CodeEditLanguages/Resources/tree-sitter-objc/locals.scm @@ -0,0 +1 @@ +; inherits: c diff --git a/Sources/CodeEditLanguages/Resources/tree-sitter-regex/highlights.scm b/Sources/CodeEditLanguages/Resources/tree-sitter-regex/highlights.scm index e0bc98d..d062cbb 100644 --- a/Sources/CodeEditLanguages/Resources/tree-sitter-regex/highlights.scm +++ b/Sources/CodeEditLanguages/Resources/tree-sitter-regex/highlights.scm @@ -4,11 +4,15 @@ "(?" "(?:" "(?<" + "(?P<" + "(?P=" ">" "[" "]" "{" "}" + "[:" + ":]" ] @punctuation.bracket (group_name) @property @@ -30,9 +34,7 @@ "?" "|" "=" - "<=" "!" - "" "|"] @punctuation.delimiter -["*" "&" "---" "..."] @punctuation.special +(flow_mapping + (_ + key: (flow_node + (plain_scalar + (string_scalar) @property)))) -[(null_scalar) (boolean_scalar)] @constant.builtin -[(integer_scalar) (float_scalar)] @number -[(double_quote_scalar) (single_quote_scalar) (block_scalar)] @string -(escape_sequence) @escape +[ + "," + "-" + ":" + ">" + "?" + "|" +] @punctuation.delimiter -(comment) @comment -[(anchor_name) (alias_name)] @function -(yaml_directive) @type +[ + "[" + "]" + "{" + "}" +] @punctuation.bracket -(tag) @type -(tag_handle) @type -(tag_prefix) @string -(tag_directive) @property +[ + "*" + "&" + "---" + "..." +] @punctuation.special diff --git a/Sources/CodeEditLanguages/Resources/tree-sitter-zig/folds.scm b/Sources/CodeEditLanguages/Resources/tree-sitter-zig/folds.scm index 9659874..8698375 100644 --- a/Sources/CodeEditLanguages/Resources/tree-sitter-zig/folds.scm +++ b/Sources/CodeEditLanguages/Resources/tree-sitter-zig/folds.scm @@ -1,16 +1,23 @@ [ - (Block) - (ContainerDecl) - (SwitchExpr) - (InitList) - (AsmExpr) - (ErrorSetDecl) - (LINESTRING) - ( - [ - (IfPrefix) - (WhilePrefix) - (ForPrefix) - ] - ) + (block) + (switch_expression) + (initializer_list) + (asm_expression) + (multiline_string) + (if_statement) + (while_statement) + (for_statement) + (if_expression) + (else_clause) + (for_expression) + (while_expression) + (if_type_expression) + (function_signature) + (parameters) + (struct_declaration) + (opaque_declaration) + (enum_declaration) + (union_declaration) + (error_set_declaration) ] @fold + diff --git a/Sources/CodeEditLanguages/Resources/tree-sitter-zig/highlights.scm b/Sources/CodeEditLanguages/Resources/tree-sitter-zig/highlights.scm index 0989704..d55f40b 100644 --- a/Sources/CodeEditLanguages/Resources/tree-sitter-zig/highlights.scm +++ b/Sources/CodeEditLanguages/Resources/tree-sitter-zig/highlights.scm @@ -1,112 +1,132 @@ -[ - (container_doc_comment) - (doc_comment) - (line_comment) -] @comment @spell +; Variables -[ - variable: (IDENTIFIER) - variable_type_function: (IDENTIFIER) -] @variable +(identifier) @variable -parameter: (IDENTIFIER) @parameter +; Parameters -[ - field_member: (IDENTIFIER) - field_access: (IDENTIFIER) -] @field +(parameter + name: (identifier) @variable.parameter) -;; assume TitleCase is a type -( - [ - variable_type_function: (IDENTIFIER) - field_access: (IDENTIFIER) - parameter: (IDENTIFIER) - ] @type - (#match? @type "^[A-Z]([a-z]+[A-Za-z0-9]*)*$") -) -;; assume camelCase is a function -( - [ - variable_type_function: (IDENTIFIER) - field_access: (IDENTIFIER) - parameter: (IDENTIFIER) - ] @function - (#match? @function "^[a-z]+([A-Z][a-z0-9]*)+$") -) - -;; assume all CAPS_1 is a constant -( +; Types + +(parameter + type: (identifier) @type) + +((identifier) @type + (#lua-match? @type "^[A-Z_][a-zA-Z0-9_]*")) + +(variable_declaration + (identifier) @type + "=" [ - variable_type_function: (IDENTIFIER) - field_access: (IDENTIFIER) - ] @constant - (#match? @constant "^[A-Z][A-Z_0-9]+$") -) + (struct_declaration) + (enum_declaration) + (union_declaration) + (opaque_declaration) + ]) [ - function_call: (IDENTIFIER) - function: (IDENTIFIER) -] @function + (builtin_type) + "anyframe" +] @type.builtin -exception: "!" @exception +; Constants -( - (IDENTIFIER) @variable.builtin - (#eq? @variable.builtin "_") -) +((identifier) @constant + (#lua-match? @constant "^[A-Z][A-Z_0-9]+$")) -(PtrTypeStart "c" @variable.builtin) +[ + "null" + "unreachable" + "undefined" +] @constant.builtin -( - (ContainerDeclType - [ - (ErrorUnionExpr) - "enum" - ] - ) - (ContainerField (IDENTIFIER) @constant) -) +(field_expression + . + member: (identifier) @constant) -field_constant: (IDENTIFIER) @constant +(enum_declaration + (container_field + type: (identifier) @constant)) -(BUILTINIDENTIFIER) @function.builtin +; Labels -((BUILTINIDENTIFIER) @include - (#any-of? @include "@import" "@cImport")) +(block_label (identifier) @label) -(INTEGER) @number +(break_label (identifier) @label) -(FLOAT) @float +; Fields -[ - "true" - "false" -] @boolean +(field_initializer + . + (identifier) @variable.member) + +(field_expression + (_) + member: (identifier) @variable.member) + +(container_field + name: (identifier) @variable.member) + +(initializer_list + (assignment_expression + left: (field_expression + . + member: (identifier) @variable.member))) + +; Functions + +(builtin_identifier) @function.builtin + +(call_expression + function: (identifier) @function.call) + +(call_expression + function: (field_expression + member: (identifier) @function.call)) + +(function_declaration + name: (identifier) @function) + +; Modules + +(variable_declaration + (identifier) @module + (builtin_function + (builtin_identifier) @keyword.import + (#any-of? @keyword.import "@import" "@cImport"))) + +; Builtins [ - (LINESTRING) - (STRINGLITERALSINGLE) -] @string @spell + "c" + "..." +] @variable.builtin + +((identifier) @variable.builtin + (#eq? @variable.builtin "_")) -(CHAR_LITERAL) @character -(EscapeSequence) @string.escape -(FormatSequence) @string.special +(calling_convention + (identifier) @variable.builtin) -(BreakLabel (IDENTIFIER) @label) -(BlockLabel (IDENTIFIER) @label) +; Keywords [ "asm" "defer" "errdefer" "test" + "error" + "const" + "var" +] @keyword + +[ "struct" "union" "enum" "opaque" - "error" -] @keyword +] @keyword.type [ "async" @@ -116,9 +136,7 @@ field_constant: (IDENTIFIER) @constant "resume" ] @keyword.coroutine -[ - "fn" -] @keyword.function +"fn" @keyword.function [ "and" @@ -126,96 +144,124 @@ field_constant: (IDENTIFIER) @constant "orelse" ] @keyword.operator -[ - "return" -] @keyword.return +"return" @keyword.return [ "if" "else" "switch" -] @conditional +] @keyword.conditional [ "for" "while" "break" "continue" -] @repeat +] @keyword.repeat [ "usingnamespace" -] @include + "export" +] @keyword.import [ "try" "catch" -] @exception +] @keyword.exception [ - "anytype" - (BuildinTypeExpr) -] @type.builtin - -[ - "const" - "var" "volatile" "allowzero" "noalias" -] @type.qualifier - -[ "addrspace" "align" "callconv" "linksection" -] @storageclass - -[ - "comptime" - "export" - "extern" + "pub" "inline" "noinline" + "extern" + "comptime" "packed" - "pub" "threadlocal" -] @attribute +] @keyword.modifier -[ - "null" - "unreachable" - "undefined" -] @constant.builtin +; Operator [ - (CompareOp) - (BitwiseOp) - (BitShiftOp) - (AdditionOp) - (AssignOp) - (MultiplyOp) - (PrefixOp) + "=" + "*=" + "*%=" + "*|=" + "/=" + "%=" + "+=" + "+%=" + "+|=" + "-=" + "-%=" + "-|=" + "<<=" + "<<|=" + ">>=" + "&=" + "^=" + "|=" + "!" + "~" + "-" + "-%" + "&" + "==" + "!=" + ">" + ">=" + "<=" + "<" + "&" + "^" + "|" + "<<" + ">>" + "<<|" + "+" + "++" + "+%" + "-%" + "+|" + "-|" "*" + "/" + "%" "**" - "->" - ".?" + "*%" + "*|" + "||" ".*" + ".?" "?" + ".." ] @operator -[ - ";" - "." - "," - ":" -] @punctuation.delimiter +; Literals -[ - ".." - "..." -] @punctuation.special +(character) @character + +([ + (string) + (multiline_string) +] @string + (#set! "priority" 95)) + +(integer) @number + +(float) @number.float + +(boolean) @boolean + +(escape_sequence) @string.escape + +; Punctuation [ "[" @@ -224,10 +270,22 @@ field_constant: (IDENTIFIER) @constant ")" "{" "}" - (Payload "|") - (PtrPayload "|") - (PtrIndexPayload "|") ] @punctuation.bracket -; Error -(ERROR) @error +[ + ";" + "." + "," + ":" + "=>" + "->" +] @punctuation.delimiter + +(payload "|" @punctuation.bracket) + +; Comments + +(comment) @comment @spell + +((comment) @comment.documentation + (#lua-match? @comment.documentation "^//!")) diff --git a/Sources/CodeEditLanguages/Resources/tree-sitter-zig/indents.scm b/Sources/CodeEditLanguages/Resources/tree-sitter-zig/indents.scm index a2af44e..431aed5 100644 --- a/Sources/CodeEditLanguages/Resources/tree-sitter-zig/indents.scm +++ b/Sources/CodeEditLanguages/Resources/tree-sitter-zig/indents.scm @@ -1,9 +1,11 @@ [ - (Block) - (ContainerDecl) - (SwitchExpr) - (InitList) -] @indent + (block) + (switch_expression) + (initializer_list) +] @indent.begin + +(block + "}" @indent.end) [ "(" @@ -12,11 +14,9 @@ "]" "{" "}" -] @branch +] @indent.branch [ - (line_comment) - (container_doc_comment) - (doc_comment) - (LINESTRING) -] @ignore + (comment) + (multiline_string) +] @indent.ignore diff --git a/Sources/CodeEditLanguages/Resources/tree-sitter-zig/injections.scm b/Sources/CodeEditLanguages/Resources/tree-sitter-zig/injections.scm index e3ff406..48a1b44 100644 --- a/Sources/CodeEditLanguages/Resources/tree-sitter-zig/injections.scm +++ b/Sources/CodeEditLanguages/Resources/tree-sitter-zig/injections.scm @@ -1,5 +1,10 @@ -[ - (container_doc_comment) - (doc_comment) - (line_comment) -] @comment +((comment) @injection.content + (#set! injection.language "comment")) + +; TODO: add when asm is added +; (asm_output_item (string) @injection.content +; (#set! injection.language "asm")) +; (asm_input_item (string) @injection.content +; (#set! injection.language "asm")) +; (asm_clobbers (string) @injection.content +; (#set! injection.language "asm"))