mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-14 09:20:04 -04:00
prettier formatting yml and md
This commit is contained in:
parent
37544570c9
commit
80e41f22ce
9 changed files with 36 additions and 32 deletions
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
|
|
@ -1,6 +1,6 @@
|
||||||
name: Bug report
|
name: Bug report
|
||||||
description: Create a report to help us improve
|
description: Create a report to help us improve
|
||||||
labels: [ bug ]
|
labels: [bug]
|
||||||
|
|
||||||
body:
|
body:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
|
|
|
||||||
5
.github/ISSUE_TEMPLATE/feature_request.md
vendored
5
.github/ISSUE_TEMPLATE/feature_request.md
vendored
|
|
@ -1,10 +1,9 @@
|
||||||
---
|
---
|
||||||
name: Feature request
|
name: Feature request
|
||||||
about: Suggest an idea for this project
|
about: Suggest an idea for this project
|
||||||
title: ''
|
title: ""
|
||||||
labels: enhancement
|
labels: enhancement
|
||||||
assignees: ''
|
assignees: ""
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Is your feature request related to a problem? Please describe.**
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
name: Highlighting issue
|
name: Highlighting issue
|
||||||
description: Missing or incorrect highlights or you want to change the way something is highlighted
|
description: Missing or incorrect highlights or you want to change the way something is highlighted
|
||||||
labels: [ highlights ]
|
labels: [highlights]
|
||||||
|
|
||||||
body:
|
body:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
|
|
|
||||||
16
.github/workflows/lint.yml
vendored
16
.github/workflows/lint.yml
vendored
|
|
@ -1,6 +1,6 @@
|
||||||
name: Linting and style checking
|
name: Linting and style checking
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize, reopened, ready_for_review]
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
|
|
@ -25,10 +25,10 @@ jobs:
|
||||||
name: StyLua
|
name: StyLua
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Lint with stylua
|
- name: Lint with stylua
|
||||||
uses: JohnnyMorganz/stylua-action@v2
|
uses: JohnnyMorganz/stylua-action@v2
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
version: latest
|
version: latest
|
||||||
args: --check .
|
args: --check .
|
||||||
|
|
|
||||||
4
.github/workflows/test-queries.yml
vendored
4
.github/workflows/test-queries.yml
vendored
|
|
@ -3,11 +3,11 @@ name: Test queries
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- "master"
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize, reopened, ready_for_review]
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- "master"
|
||||||
|
|
||||||
# Cancel any in-progress CI runs for a PR if it is updated
|
# Cancel any in-progress CI runs for a PR if it is updated
|
||||||
concurrency:
|
concurrency:
|
||||||
|
|
|
||||||
4
.github/workflows/tests.yml
vendored
4
.github/workflows/tests.yml
vendored
|
|
@ -3,11 +3,11 @@ name: Tests
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- "master"
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize, reopened, ready_for_review]
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- "master"
|
||||||
|
|
||||||
# Cancel any in-progress CI runs for a PR if it is updated
|
# Cancel any in-progress CI runs for a PR if it is updated
|
||||||
concurrency:
|
concurrency:
|
||||||
|
|
|
||||||
2
.github/workflows/update-lockfile.yml
vendored
2
.github/workflows/update-lockfile.yml
vendored
|
|
@ -2,7 +2,7 @@ name: Update lockfile
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '30 6 * * *'
|
- cron: "30 6 * * *"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ If you haven't already, you should really come and reach out to us on our
|
||||||
As you know, `nvim-treesitter` is roughly split in two parts:
|
As you know, `nvim-treesitter` is roughly split in two parts:
|
||||||
|
|
||||||
- Parser configurations : for various things like `locals`, `highlights`
|
- Parser configurations : for various things like `locals`, `highlights`
|
||||||
- What we like to call *modules* : tiny lua modules that provide a given feature, based on parser configurations
|
- What we like to call _modules_ : tiny lua modules that provide a given feature, based on parser configurations
|
||||||
|
|
||||||
Depending on which part of the plugin you want to contribute to, please read the appropriate section.
|
Depending on which part of the plugin you want to contribute to, please read the appropriate section.
|
||||||
|
|
||||||
|
|
@ -44,7 +44,7 @@ on the "Neovim tree-sitter" [Matrix channel].
|
||||||
## Parser configurations
|
## Parser configurations
|
||||||
|
|
||||||
Contributing to parser configurations is basically modifying one of the `queries/*/*.scm`.
|
Contributing to parser configurations is basically modifying one of the `queries/*/*.scm`.
|
||||||
Each of these `scheme` files contains a *tree-sitter query* for a given purpose.
|
Each of these `scheme` files contains a _tree-sitter query_ for a given purpose.
|
||||||
Before going any further, we highly suggest that you [read more about tree-sitter queries](https://tree-sitter.github.io/tree-sitter/using-parsers#pattern-matching-with-queries).
|
Before going any further, we highly suggest that you [read more about tree-sitter queries](https://tree-sitter.github.io/tree-sitter/using-parsers#pattern-matching-with-queries).
|
||||||
|
|
||||||
Each query has an appropriate name, which is then used by modules to extract data from the syntax tree.
|
Each query has an appropriate name, which is then used by modules to extract data from the syntax tree.
|
||||||
|
|
@ -56,7 +56,7 @@ For now these are the types of queries used by `nvim-treesitter`:
|
||||||
- `folds.scm`: used to define folds.
|
- `folds.scm`: used to define folds.
|
||||||
- `injections.scm`: used to define injections.
|
- `injections.scm`: used to define injections.
|
||||||
|
|
||||||
For these types there is a *norm* you will have to follow so that features work fine.
|
For these types there is a _norm_ you will have to follow so that features work fine.
|
||||||
Here are some global advices:
|
Here are some global advices:
|
||||||
|
|
||||||
- If your language is listed [here](https://github.com/nvim-treesitter/nvim-treesitter#supported-languages),
|
- If your language is listed [here](https://github.com/nvim-treesitter/nvim-treesitter#supported-languages),
|
||||||
|
|
@ -222,7 +222,6 @@ Used for XML-like tags.
|
||||||
|
|
||||||
#### Conceal
|
#### Conceal
|
||||||
|
|
||||||
|
|
||||||
```scheme
|
```scheme
|
||||||
@conceal ; for captures that are only used for concealing
|
@conceal ; for captures that are only used for concealing
|
||||||
```
|
```
|
||||||
|
|
|
||||||
26
README.md
26
README.md
|
|
@ -42,7 +42,7 @@ We recommend using the nightly builds of Neovim if possible.
|
||||||
You can find the current roadmap [here](https://github.com/nvim-treesitter/nvim-treesitter/projects/1).
|
You can find the current roadmap [here](https://github.com/nvim-treesitter/nvim-treesitter/projects/1).
|
||||||
The roadmap and all features of this plugin are open to change, and any suggestion will be highly appreciated!**
|
The roadmap and all features of this plugin are open to change, and any suggestion will be highly appreciated!**
|
||||||
|
|
||||||
Nvim-treesitter is based on three interlocking features: [**language parsers**](#language-parsers), [**queries**](#adding-queries), and [**modules**](#available-modules), where *modules* provide features – e.g., highlighting – based on *queries* for syntax objects extracted from a given buffer by *language parsers*.
|
Nvim-treesitter is based on three interlocking features: [**language parsers**](#language-parsers), [**queries**](#adding-queries), and [**modules**](#available-modules), where _modules_ provide features – e.g., highlighting – based on _queries_ for syntax objects extracted from a given buffer by _language parsers_.
|
||||||
Users will generally only need to interact with parsers and modules as explained in the next section.
|
Users will generally only need to interact with parsers and modules as explained in the next section.
|
||||||
For more detailed information on setting these up, see ["Advanced setup"](#advanced-setup).
|
For more detailed information on setting these up, see ["Advanced setup"](#advanced-setup).
|
||||||
|
|
||||||
|
|
@ -50,12 +50,12 @@ For more detailed information on setting these up, see ["Advanced setup"](#advan
|
||||||
|
|
||||||
### Table of contents
|
### Table of contents
|
||||||
|
|
||||||
* [Quickstart](#quickstart)
|
- [Quickstart](#quickstart)
|
||||||
* [Supported languages](#supported-languages)
|
- [Supported languages](#supported-languages)
|
||||||
* [Available modules](#available-modules)
|
- [Available modules](#available-modules)
|
||||||
* [Advanced setup](#advanced-setup)
|
- [Advanced setup](#advanced-setup)
|
||||||
* [Extra features](#extra-features)
|
- [Extra features](#extra-features)
|
||||||
* [Troubleshooting](#troubleshooting)
|
- [Troubleshooting](#troubleshooting)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
@ -85,9 +85,11 @@ For other plugin managers such as `packer.nvim`, see this [Installation page fro
|
||||||
Treesitter uses a different _parser_ for every language, which needs to be generated via `tree-sitter-cli` from a `grammar.js` file, then compiled to a `.so` library that needs to be placed in neovim's `runtimepath` (typically under `parser/{language}.so`).
|
Treesitter uses a different _parser_ for every language, which needs to be generated via `tree-sitter-cli` from a `grammar.js` file, then compiled to a `.so` library that needs to be placed in neovim's `runtimepath` (typically under `parser/{language}.so`).
|
||||||
To simplify this, `nvim-treesitter` provides commands to automate this process.
|
To simplify this, `nvim-treesitter` provides commands to automate this process.
|
||||||
If the language is already [supported by `nvim-treesitter`](#supported-languages), you can install it with
|
If the language is already [supported by `nvim-treesitter`](#supported-languages), you can install it with
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
:TSInstall <language_to_install>
|
:TSInstall <language_to_install>
|
||||||
```
|
```
|
||||||
|
|
||||||
This command supports tab expansion.
|
This command supports tab expansion.
|
||||||
You can also get a list of all available languages and their installation status with `:TSInstallInfo`.
|
You can also get a list of all available languages and their installation status with `:TSInstallInfo`.
|
||||||
Parsers not on this list can be added manually by following the steps described under ["Adding parsers"](#adding-parsers) below.
|
Parsers not on this list can be added manually by following the steps described under ["Adding parsers"](#adding-parsers) below.
|
||||||
|
|
@ -171,6 +173,7 @@ We are looking for maintainers to add more parsers and to write query files for
|
||||||
|
|
||||||
<!--This section of the README is automatically updated by a CI job-->
|
<!--This section of the README is automatically updated by a CI job-->
|
||||||
<!--parserinfo-->
|
<!--parserinfo-->
|
||||||
|
|
||||||
- [x] [ada](https://github.com/briot/tree-sitter-ada) (maintained by @briot)
|
- [x] [ada](https://github.com/briot/tree-sitter-ada) (maintained by @briot)
|
||||||
- [x] [agda](https://github.com/AusCyberman/tree-sitter-agda) (maintained by @Decodetalkers)
|
- [x] [agda](https://github.com/AusCyberman/tree-sitter-agda) (maintained by @Decodetalkers)
|
||||||
- [x] [arduino](https://github.com/ObserverOfTime/tree-sitter-arduino) (maintained by @ObserverOfTime)
|
- [x] [arduino](https://github.com/ObserverOfTime/tree-sitter-arduino) (maintained by @ObserverOfTime)
|
||||||
|
|
@ -407,7 +410,7 @@ require'nvim-treesitter.configs'.setup {
|
||||||
|
|
||||||
#### Folding
|
#### Folding
|
||||||
|
|
||||||
Tree-sitter based folding. *(Technically not a module because it's per windows and not per buffer.)*
|
Tree-sitter based folding. _(Technically not a module because it's per windows and not per buffer.)_
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
set foldmethod=expr
|
set foldmethod=expr
|
||||||
|
|
@ -428,7 +431,7 @@ directory with `parser_install_dir` option in that is passed to `setup`.
|
||||||
This directory must be writeable and must be explicitly added to the
|
This directory must be writeable and must be explicitly added to the
|
||||||
`runtimepath`. For example:
|
`runtimepath`. For example:
|
||||||
|
|
||||||
``` lua
|
```lua
|
||||||
vim.opt.runtimepath:append("/some/path/to/store/parsers")
|
vim.opt.runtimepath:append("/some/path/to/store/parsers")
|
||||||
|
|
||||||
require'nvim-treesitter.configs'.setup {
|
require'nvim-treesitter.configs'.setup {
|
||||||
|
|
@ -449,6 +452,7 @@ will still be considered installed. (For example if
|
||||||
considered installed, even though it is not in `parser_install_dir`)
|
considered installed, even though it is not in `parser_install_dir`)
|
||||||
|
|
||||||
The default paths are:
|
The default paths are:
|
||||||
|
|
||||||
1. first the package folder. Where `nvim-treesitter` is installed.
|
1. first the package folder. Where `nvim-treesitter` is installed.
|
||||||
2. second the site directory. This is the "site" subdirectory of `stdpath("data")`.
|
2. second the site directory. This is the "site" subdirectory of `stdpath("data")`.
|
||||||
|
|
||||||
|
|
@ -490,7 +494,7 @@ Once the parser is installed, you can update it (from the latest revision of the
|
||||||
Note that neither `:TSInstall` nor `:TSInstallFromGrammar` copy query files from the grammar repository.
|
Note that neither `:TSInstall` nor `:TSInstallFromGrammar` copy query files from the grammar repository.
|
||||||
If you want your installed grammar to be useful, you must manually [add query files](#adding-queries) to your local nvim-treesitter installation.
|
If you want your installed grammar to be useful, you must manually [add query files](#adding-queries) to your local nvim-treesitter installation.
|
||||||
Note also that module functionality is only triggered if your language's filetype is correctly identified.
|
Note also that module functionality is only triggered if your language's filetype is correctly identified.
|
||||||
If Neovim does not detect your language's filetype by default, you can use [Neovim's `vim.filetype.add()`](https://neovim.io/doc/user/lua.html#vim.filetype.add()) to add a custom detection rule.
|
If Neovim does not detect your language's filetype by default, you can use [Neovim's `vim.filetype.add()`](<https://neovim.io/doc/user/lua.html#vim.filetype.add()>) to add a custom detection rule.
|
||||||
|
|
||||||
If you use a git repository for your parser and want to use a specific version, you can set the `revision` key
|
If you use a git repository for your parser and want to use a specific version, you can set the `revision` key
|
||||||
in the `install_info` table for you parser config.
|
in the `install_info` table for you parser config.
|
||||||
|
|
@ -645,11 +649,13 @@ require("nvim-treesitter.install").prefer_git = true
|
||||||
#### I want to use a HTTP proxy for downloading the parsers
|
#### I want to use a HTTP proxy for downloading the parsers
|
||||||
|
|
||||||
You can either configure curl to use additional CLI arguments in your Lua config:
|
You can either configure curl to use additional CLI arguments in your Lua config:
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
require("nvim-treesitter.install").command_extra_args = {
|
require("nvim-treesitter.install").command_extra_args = {
|
||||||
curl = { "--proxy", "<proxy url>" },
|
curl = { "--proxy", "<proxy url>" },
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
or you can configure git via `.gitconfig` and use git instead of curl
|
or you can configure git via `.gitconfig` and use git instead of curl
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue