summaryrefslogtreecommitdiffstats
path: root/cmd-has-session.c
blob: 53e1c4d4ffcaa51a580b7023b500a6a8e252616d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* $Id: cmd-has-session.c,v 1.9 2008-06-05 21:25:00 nicm Exp $ */

/*
 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#include <sys/types.h>

#include "tmux.h"

/*
 * Cause client to report an error and exit with 1 if session doesn't exist.
 */

void	cmd_has_session_exec(struct cmd *, struct cmd_ctx *);

const struct cmd_entry cmd_has_session_entry = {
	"has-session", "has",
	CMD_TARGET_SESSION_USAGE,
	0,
	cmd_target_init,
	cmd_target_parse,
	cmd_has_session_exec,
	cmd_target_send,
	cmd_target_recv,
	cmd_target_free,
	cmd_target_print
};

void
cmd_has_session_exec(struct cmd *self, struct cmd_ctx *ctx)
{
	struct cmd_target_data	*data = self->data;
	struct session		*s;

	if ((s = cmd_find_session(ctx, data->target)) == NULL)
		return;

	if (ctx->cmdclient != NULL)
		server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0);
}
diffstat' width='100%'> -rw-r--r--vendored_parsers/tree-sitter-typescript/README.md15
-rw-r--r--vendored_parsers/tree-sitter-typescript/bindings/rust/README.md46
-rw-r--r--vendored_parsers/tree-sitter-typescript/bindings/swift/TreeSitterTypeScript/typescript.h17
-rw-r--r--vendored_parsers/tree-sitter-typescript/common/corpus/declarations.txt741
-rw-r--r--vendored_parsers/tree-sitter-typescript/common/corpus/expressions.txt203
-rw-r--r--vendored_parsers/tree-sitter-typescript/common/corpus/functions.txt19
-rw-r--r--vendored_parsers/tree-sitter-typescript/common/corpus/types.txt1264
-rw-r--r--vendored_parsers/tree-sitter-typescript/common/define-grammar.js711
-rw-r--r--vendored_parsers/tree-sitter-typescript/common/scanner.h418
-rw-r--r--vendored_parsers/tree-sitter-typescript/package.json19
-rw-r--r--vendored_parsers/tree-sitter-typescript/script/known-failures.txt2
-rwxr-xr-xvendored_parsers/tree-sitter-typescript/script/parse-examples73
-rw-r--r--vendored_parsers/tree-sitter-typescript/tsx/corpus/expressions.txt6
-rw-r--r--vendored_parsers/tree-sitter-typescript/tsx/src/grammar.json1415
-rw-r--r--vendored_parsers/tree-sitter-typescript/tsx/src/node-types.json478
-rw-r--r--vendored_parsers/tree-sitter-typescript/tsx/src/parser.c491664
-rw-r--r--vendored_parsers/tree-sitter-typescript/tsx/src/scanner.c14
-rw-r--r--vendored_parsers/tree-sitter-typescript/tsx/src/tree_sitter/parser.h16
-rw-r--r--vendored_parsers/tree-sitter-typescript/typescript/src/grammar.json1411
-rw-r--r--vendored_parsers/tree-sitter-typescript/typescript/src/node-types.json472
-rw-r--r--vendored_parsers/tree-sitter-typescript/typescript/src/parser.c494137
-rw-r--r--vendored_parsers/tree-sitter-typescript/typescript/src/scanner.c14
-rw-r--r--vendored_parsers/tree-sitter-typescript/typescript/src/tree_sitter/parser.h16
41 files changed, 688168 insertions, 305481 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1362cd609..9b6113fb7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,7 +2,7 @@
### Parsing
-Updated JavaScript parser.
+Updated JavaScript and TypeScript parser.
## 0.55 (released 1st February 2024)
diff --git a/vendored_parsers/tree-sitter-typescript/.eslintrc.js b/vendored_parsers/tree-sitter-typescript/.eslintrc.js
new file mode 100644
index 000000000..b2e707a9e
--- /dev/null
+++ b/vendored_parsers/tree-sitter-typescript/.eslintrc.js
@@ -0,0 +1,20 @@
+module.exports = {
+ 'env': {
+ 'commonjs': true,
+ 'es2021': true,
+ },
+ 'extends': 'google',
+ 'overrides': [
+ ],
+ 'parserOptions': {
+ 'ecmaVersion': 'latest',
+ 'sourceType': 'module',
+ },
+ 'rules': {
+ 'indent': ['error', 2, {'SwitchCase': 1}],
+ 'max-len': [
+ 'error',
+ {'code': 120, 'ignoreComments': true, 'ignoreUrls': true, 'ignoreStrings': true},
+ ],
+ },
+};
diff --git a/vendored_parsers/tree-sitter-typescript/.gitattributes b/vendored_parsers/tree-sitter-typescript/.gitattributes
index ce88adfd5..469cb1d97 100644
--- a/vendored_parsers/tree-sitter-typescript/.gitattributes
+++ b/vendored_parsers/tree-sitter-typescript/.gitattributes
@@ -1,5 +1,20 @@
-parser.c linguist-vendored
-parser.h linguist-vendored
-grammar.json linguist-vendored
-tsx/examples/* linguist-vendored
-typescript/examples/* linguist-vendored
+typescript/src/** linguist-vendored
+tsx/src/** linguist-vendored
+
+/examples/* linguist-vendored
+
+typescript/src/grammar.json linguist-generated
+typescript/src/node-types.json linguist-generated
+typescript/src/parser.c linguist-generated
+
+tsx/src/grammar.json linguist-generated
+tsx/src/node-types.json linguist-generated
+tsx/src/parser.c linguist-generated
+
+typescript/src/grammar.json -diff
+typescript/src/node-types.json -diff
+typescript/src/parser.c -diff
+
+tsx/src/grammar.json -diff
+tsx/src/node-types.json -diff
+tsx/src/parser.c -diff
diff --git a/vendored_parsers/tree-sitter-typescript/.github/ISSUE_TEMPLATE/bug_report.md b/vendored_parsers/tree-sitter-typescript/.github/ISSUE_TEMPLATE/bug_report.md
deleted file mode 100644
index f26ee3a2c..000000000
--- a/vendored_parsers/tree-sitter-typescript/.github/ISSUE_TEMPLATE/bug_report.md
+++ /dev/null
@@ -1,31 +0,0 @@
----
-name: Bug report
-about: Report unexpected parsing results
-title: ''
-labels: 'bug'
-assignees: ''
-
----
-
-The following piece of code is valid but it is parsed incorrectly:
-
-```typescript
-
-```
-
-Here's a link to the TypeScript Playground showing that the snippet above is valid JavaScript or TypeScript:
-<!-- Please check your code at https://www.typescriptlang.org/play
- and paste the URL below. -->
-
-<!-- Please run `tree-sitter parse YOUR_FILE` and show us the output. -->
-The output of `tree-sitter parse` is the following:
-
-```
-
-```
-
-<!-- If there is no `ERROR` or `MISSING` node in the output above,
- explain what you were expecting: -->
-
-<!-- Name of the broken/missing feature, link to official
- documentation, and any other relevant info is appreciated: -->
diff --git a/vendored_parsers/tree-sitter-typescript/.github/ISSUE_TEMPLATE/bug_report.yml b/vendored_parsers/tree-sitter-typescript/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 000000000..136c76496
--- /dev/null
+++ b/vendored_parsers/tree-sitter-typescript/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,59 @@
+name: Bug Report
+description: File a bug or issue
+title: "bug: "
+labels: [bug]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ **Before** reporting an issue, make sure to search [existing issues](https://github.com/tree-sitter/tree-sitter-typescript/issues). Usage questions such as ***"How do I...?"*** either belong in [Discussions](https://github.com/tree-sitter/tree-sitter/discussions) upstream or in our [Discord server](https://discord.gg/w7nTvsVJhm) and will be closed.
+ If your issue is related to a bug in your editor-experience because your editor *leverages* tree-sitter and this parser, then it is likely your issue does *NOT* belong here and belongs in the relevant editor's repository.
+ - type: checkboxes
+ attributes:
+ label: Did you check existing issues?
+ description: Make sure you've checked all of the below before submitting an issue
+ options:
+ - label: I have read all the [tree-sitter docs](https://tree-sitter.github.io/tree-sitter/using-parsers) if it relates to using the parser
+ required: false
+ - label: I have searched the existing issues of tree-sitter-typescript
+ required: true
+ - type: input
+ attributes:
+ label: "Tree-Sitter CLI Version, if relevant (output of `tree-sitter --version`)"
+ placeholder: "tree-sitter 0.20.8 (6bbb50bef8249e6460e7d69e42cc8146622fa4fd)"
+ validations:
+ required: false
+ - type: textarea
+ attributes:
+ label: Describe the bug
+ description: A clear and concise description of what the bug is. Please include any related errors you see such as parsing errors or tree-sitter cli errors.
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: Steps To Reproduce/Bad Parse Tree
+ description: Steps to reproduce the behavior. If you have a bad parse tree, please include it here. You can get this by running `tree-sitter parse <path-to-file>` and copying the output.
+ placeholder: |
+ 1.
+ 2.
+ 3.
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: Expected Behavior/Parse Tree
+ description: A concise description of what you expected to happen, or in the case of a bad parse tree, the expected parse tree.
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: Repro
+ description: Minimal code to reproduce this issue. Ideally this should be reproducible with the C library or the tree-sitter cli, do not suggest an editor or external tool. Also, a link to the TypeScript Playground showing that the snippet below is valid JavaScript or TypeScript would be great (https://www.typescriptlang.org/play)
+ value: |
+ // Example code that causes the issue
+ function foo() {
+ // Code that fails to parse, or causes an error
+ }
+ render: TypeScript
+ validations:
+ required: false
diff --git a/vendored_parsers/tree-sitter-typescript/.github/ISSUE_TEMPLATE/config.yml b/vendored_parsers/tree-sitter-typescript/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 000000000..3ba13e0ce
--- /dev/null
+++ b/vendored_parsers/tree-sitter-typescript/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1 @@
+blank_issues_enabled: false
diff --git a/vendored_parsers/tree-sitter-typescript/.github/ISSUE_TEMPLATE/feature_request.md b/vendored_parsers/tree-sitter-typescript/.github/ISSUE_TEMPLATE/feature_request.md
deleted file mode 100644
index 1c2016fa6..000000000
--- a/vendored_parsers/tree-sitter-typescript/.github/ISSUE_TEMPLATE/feature_request.md
+++ /dev/null
@@ -1,13 +0,0 @@
----
-name: Feature request
-about: Suggest an idea for this project
-title: ''
-labels: ''
-assignees: ''
-
----
-
-<!--
- The tree-sitter-typescript project is a TypeScript and TSX parser only.
- How can we improve it?
--->
diff --git a/vendored_parsers/tree-sitter-typescript/.github/ISSUE_TEMPLATE/feature_request.yml b/vendored_parsers/tree-sitter-typescript/.github/ISSUE_TEMPLATE/feature_request.yml
new file mode 100644
index 000000000..9619c0048
--- /dev/null
+++ b/vendored_parsers/tree-sitter-typescript/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -0,0 +1,36 @@
+name: Feature Request
+description: Suggest a new feature
+title: "feature: "
+labels: [enhancement]
+body:
+ - type: checkboxes
+ attributes:
+ label: Did you check the tree-sitter docs?
+ description: Make sure you read all the docs before submitting a feature request
+ options:
+ - label: I have read all the [tree-sitter docs](https://tree-sitter.github.io/tree-sitter/using-parsers) if it relates to using the parser
+ required: false
+ - type: textarea
+ validations:
+ required: true
+ attributes:
+ label: Is your feature request related to a problem? Please describe.
+ description: A clear and concise description of what the problem is. Ex. I think the grammar models this rule incorrectly and can be improved, or the TypeScript spec has officially added a new feature that should be added to the grammar.
+ - type: textarea
+ validations:
+ required: true
+ attributes:
+ label: Describe the solution you'd like
+ description: A clear and concise description of what you want to happen.
+ - type: textarea
+ validations:
+ required: true
+ attributes:
+ label: Describe alternatives you've considered
+ description: A clear and concise description of any alternative solutions or features you've considered.
+ - type: textarea
+ validations:
+ required: false
+ attributes:
+ label: Additional context
+ description: Add any other context or screenshots about the feature request here. If your feature request is related to a new TypeScript feature, please include a link to the relevant **official** TypeScript documentation.
diff --git a/vendored_parsers/tree-sitter-typescript/.github/pull_request_template.md b/vendored_parsers/tree-sitter-typescript/.github/pull_request_template.md
index 2714bb61f..d6ee77b24 100644
--- a/vendored_parsers/tree-sitter-typescript/.github/pull_request_template.md
+++ b/vendored_parsers/tree-sitter-typescript/.github/pull_request_template.md
@@ -1,6 +1,5 @@
+# Checklist
-
-Checklist:
- [ ] All tests pass in CI.
- [ ] There are sufficient tests for the new fix/feature.
- [ ] Grammar rules have not been renamed unless absolutely necessary.
diff --git a/vendored_parsers/tree-sitter-typescript/.github/workflows/build.yml b/vendored_parsers/tree-sitter-typescript/.github/workflows/build.yml
deleted file mode 100644
index 1f3194e7b..000000000
--- a/vendored_parsers/tree-sitter-typescript/.github/workflows/build.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-name: build
-
-on:
- push:
- pull_request:
-
-jobs:
- build:
- name: build
- runs-on: ubuntu-latest
- steps:
- - name: Checkout code
- uses: actions/checkout@v2
-
- - name: Setup Node
- uses: actions/setup-node@v2-beta
- with:
- node-version: '12'
-
- - name: Display Node versions
- run: |
- node --version
- npm --version
-
- - name: Install dependencies
- run: npm install
-
- - name: Build and check generated files
- run: |
- npm run build
- script/check-generated-files
-
- - name: Test corpus & parse examples
- run: npm test
diff --git a/vendored_parsers/tree-sitter-typescript/.github/workflows/ci.yml b/vendored_parsers/tree-sitter-typescript/.github/workflows/ci.yml
new file mode 100644
index 000000000..084480365
--- /dev/null
+++ b/vendored_parsers/tree-sitter-typescript/.github/workflows/ci.yml
@@ -0,0 +1,30 @@
+name: CI
+on:
+ workflow_dispatch:
+ pull_request:
+ push:
+
+jobs:
+ test:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: true
+ matrix:
+ os: [macos-latest, ubuntu-latest]
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 18
+ - run: npm install
+ - run: npm test
+
+ test_windows:
+ runs-on: windows-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 18
+ - run: npm install
+ - run: npm run test-windows
diff --git a/vendored_parsers/tree-sitter-typescript/.github/workflows/lint.yml b/vendored_parsers/tree-sitter-typescript/.github/workflows/lint.yml
new file mode 100644
index 000000000..103e92ae7
--- /dev/null
+++ b/vendored_parsers/tree-sitter-typescript/.github/workflows/lint.yml
@@ -0,0 +1,19 @@
+name: Lint
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - "**"
+
+jobs:
+ lint:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: Install modules
+ run: npm install
+ - name: Run ESLint
+ run: npm run lint
diff --git a/vendored_parsers/tree-sitter-typescript/.github/workflows/publish_crate.yml b/vendored_parsers/tree-sitter-typescript/.github/workflows/publish_crate.yml
deleted file mode 100644
index 5735603b2..000000000
--- a/vendored_parsers/tree-sitter-typescript/.github/workflows/publish_crate.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-name: Publish on crates.io
-
-on:
- push:
- tags:
- - v*
-
-env:
- CARGO_TERM_COLOR: always
- CARGO_INCREMENTAL: 0
-
-jobs:
- publish:
-
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@v3
-
- - name: Install rust
- uses: actions-rs/toolchain@v1
- with:
- toolchain: stable
- profile: minimal
- override: true
-
- - name: Verify publish crate
- run: cargo publish --dry-run
-
- - name: Publish crate
- run: cargo publish
- env:
- CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
diff --git a/vendored_parsers/tree-sitter-typescript/.github/workflows/release.yml b/vendored_parsers/tree-sitter-typescript/.github/workflows/release.yml
new file mode 100644
index 000000000..870eb84b1
--- /dev/null
+++ b/vendored_parsers/tree-sitter-typescript/.github/workflows/release.yml
@@ -0,0 +1,103 @@
+name: Release
+
+on:
+ workflow_run:
+ workflows: ["CI"]
+ branches:
+ - master
+ types:
+ - completed
+
+jobs:
+ release:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Get previous commit SHA
+ id: get_previous_commit
+ run: |
+ LATEST_TAG=$(git describe --tags --abbrev=0)
+ if [[ -z "$LATEST_TAG" ]]; then
+ echo "No tag found. Failing..."
+ exit 1
+ fi
+ echo "latest_tag=${LATEST_TAG#v}" >> "$GITHUB_ENV" # Remove 'v' prefix from the tag
+
+ - name: Check if version changed and is greater than the previous
+ id: version_check
+ run: |
+ # Compare the current version with the version from the previous commit
+ PREVIOUS_NPM_VERSION=${{ env.latest_tag }}
+ CURRENT_NPM_VERSION=$(jq -r '.version' package.json)
+ CURRENT_CARGO_VERSION=$(awk -F '"' '/^version/ {print $2}' Cargo.toml)
+ if [[ "$CURRENT_NPM_VERSION" != "$CURRENT_CARGO_VERSION" ]]; then # Cargo.toml and package.json versions must match
+ echo "Mismatch: NPM version ($CURRENT_NPM_VERSION) and Cargo.toml version ($CURRENT_CARGO_VERSION)"
+ echo "version_changed=false" >> "$GITHUB_ENV"
+ else
+ if [[ "$PREVIOUS_NPM_VERSION" == "$CURRENT_NPM_VERSION" ]]; then
+ echo "version_changed=" >> "$GITHUB_ENV"
+ else
+ IFS='.' read -ra PREVIOUS_VERSION_PARTS <<< "$PREVIOUS_NPM_VERSION"
+ IFS='.' read -ra CURRENT_VERSION_PARTS <<< "$CURRENT_NPM_VERSION"
+ VERSION_CHANGED=false
+ for i in "${!PREVIOUS_VERSION_PARTS[@]}"; do
+ if [[ ${CURRENT_VERSION_PARTS[i]} -gt ${PREVIOUS_VERSION_PARTS[i]} ]]; then
+ VERSION_CHANGED=true
+ break
+ elif [[ ${CURRENT_VERSION_PARTS[i]} -lt ${PREVIOUS_VERSION_PARTS[i]} ]]; then
+ break
+ fi
+ done
+
+ echo "version_changed=$VERSION_CHANGED" >> "$GITHUB_ENV"
+ echo "current_version=${CURRENT_NPM_VERSION}" >> "$GITHUB_ENV"
+ fi
+ fi
+
+ - name: Display result
+ run: |
+ echo "Version bump detected: ${{ env.version_changed }}"
+
+ - name: Fail if version is lower
+ if: env.version_changed == 'false'
+ run: exit 1
+
+ - name: Setup Node
+ if: env.version_changed == 'true'
+ uses: actions/setup-node@v4
+ with:
+ node-version: 18
+ registry-url: "https://registry.npmjs.org"
+ - name: Publish to NPM
+ if: env.version_changed == 'true'
+ env:
+ NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
+ run: npm publish
+
+ - name: Setup Rust
+ if: env.version_changed == 'true'
+ uses: actions-rs/toolchain@v1
+ with:
+ profile: minimal
+ toolchain: stable
+ override: true
+ - name: Publish to Crates.io
+ if: env.version_changed == 'true'
+ uses: katyo/publish-crates@v2
+ with:
+ registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
+
+ - name: Tag versions
+ if: env.version_changed == 'true'
+ run: |
+ git checkout master
+ git config user.name github-actions[bot]
+ git config user.email github-actions[bot]@users.noreply.github.com
+ git tag -d "v${{ env.current_version }}" || true
+ git push origin --delete "v${{ env.current_version }}" || true
+ git tag -a "v${{ env.current_version }}" -m "Version ${{ env.current_version }}"
+ git push origin "v${{ env.current_version }}"
diff --git a/vendored_parsers/tree-sitter-typescript/.gitignore b/vendored_parsers/tree-sitter-typescript/.gitignore
index b8da6bbe4..1dc211f8c 100644
--- a/vendored_parsers/tree-sitter-typescript/.gitignore
+++ b/vendored_parsers/tree-sitter-typescript/.gitignore
@@ -3,6 +3,7 @@ node_modules
.node-version
target
build
+/.build
*.log
Cargo.lock
package-lock.json
diff --git a/vendored_parsers/tree-sitter-typescript/.npmignore b/vendored_parsers/tree-sitter-typescript/.npmignore
index d5fc53933..3ff284137 100644
--- a/vendored_parsers/tree-sitter-typescript/.npmignore
+++ b/vendored_parsers/tree-sitter-typescript/.npmignore
@@ -1,9 +1,6 @@
-corpus
-examples
-.travis.yml
+/test
+/examples
+/build
+/script
+/target
appveyor.yml
-.gitattributes
-build
-script
-target
-test.ts
diff --git a/vendored_parsers/tree-sitter-typescript/Cargo.toml b/vendored_parsers/tree-sitter-typescript/Cargo.toml
index 7105979f6..80bb93244 100644
--- a/vendored_parsers/tree-sitter-typescript/Cargo.toml
+++ b/vendored_parsers/tree-sitter-typescript/Cargo.toml
@@ -1,31 +1,32 @@
[package]
name = "tree-sitter-typescript"
-description = "Typescript grammar for the tree-sitter parsing library"
-version = "0.20.2"
+description = "Typescript grammar for tree-sitter"
+version = "0.20.5"
authors = ["Max Brunsfeld <maxbrunsfeld@gmail.com>"]
license = "MIT"
-readme = "README.md"
+readme = "bindings/rust/README.md"
keywords = ["incremental", "parsing", "typescript", "tsx"]
categories = ["parsing", "text-editors"]
repository = "https://github.com/tree-sitter/tree-sitter-typescript"
-edition = "2018"
+edition = "2021"
+autoexamples = false
build = "bindings/rust/build.rs"
include = [
- "common",
- "bindings/rust",
- "typescript/grammar.js",
- "typescript/src",
- "tsx/grammar.js",
- "tsx/src",
- "queries"
+ "common",
+ "bindings/rust",
+ "typescript/grammar.js",
+ "typescript/src",
+ "tsx/grammar.js",
+ "tsx/src",
+ "queries",
]
[lib]
path = "bindings/rust/lib.rs"
[dependencies]
-tree-sitter = ">= 0.19, < 0.21"
+tree-sitter = "~0.20.10"
[build-dependencies]
-cc = "1.0"
+cc = "~1.0.83"
diff --git a/vendored_parsers/tree-sitter-typescript/Package.swift b/vendored_parsers/tree-sitter-typescript/Package.swift
new file mode 100644
index 000000000..f789c0200
--- /dev/null
+++ b/vendored_parsers/tree-sitter-typescript/Package.swift
@@ -0,0 +1,27 @@
+// swift-tools-version: 5.6
+import PackageDescription
+
+let package = Package(
+ name: "TreeSitterTypeScript",
+ platforms: [.macOS(.v10_13), .iOS(.v11)],
+ products: [.library(name: "TreeSitterTypeScript", targets: ["TreeSitterTypeScript"])],
+ targets: [
+ .target(
+ name: "TreeSitterTypeScript",
+ path: ".",
+ exclude: [
+ ],
+ sources: [
+ "typescript/src/parser.c",
+ "typescript/src/scanner.c",
+ "tsx/src/parser.c",
+ "tsx/src/scanner.c",
+ ],
+ resources: [
+ .copy("queries"),
+ ],
+ publicHeadersPath: "bindings/swift",
+ cSettings: [.headerSearchPath("typescript/src")]
+ ),
+ ]
+)
diff --git a/vendored_parsers/tree-sitter-typescript/README.md b/vendored_parsers/tree-sitter-typescript/README.md
index 246cfe010..be10a5227 100644
--- a/vendored_parsers/tree-sitter-typescript/README.md
+++ b/vendored_parsers/tree-sitter-typescript/README.md
@@ -1,16 +1,17 @@
-tree-sitter-typescript
-===========================
+# tree-sitter-typescript
-[![Build Status](https://github.com/tree-sitter/tree-sitter-typescript/workflows/build/badge.svg)](https://github.com/tree-sitter/tree-sitter-typescript/actions?query=workflow%3Abuild)
-[![Build status](https://ci.appveyor.com/api/projects/status/rn11gs5y3tm7tuy0