From 127567df8e88cfa71feb66619a6016988d984256 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Sat, 28 Dec 2024 09:05:46 -0500 Subject: [PATCH] docs: Fix dead links to tree-sitter docs tree-sitter now uses mdbook for their docs and the switch adds a chapter number to each section, so each link to the website needs an update. --- book/src/guides/adding_languages.md | 2 +- book/src/guides/injection.md | 2 +- book/src/guides/textobject.md | 4 ++-- book/src/languages.md | 2 +- book/src/themes.md | 2 +- runtime/queries/ada/highlights.scm | 6 ------ runtime/queries/ada/locals.scm | 3 --- runtime/queries/awk/highlights.scm | 2 -- runtime/queries/tact/locals.scm | 2 -- 9 files changed, 6 insertions(+), 19 deletions(-) diff --git a/book/src/guides/adding_languages.md b/book/src/guides/adding_languages.md index aa4bf0c5..cb7e0eb6 100644 --- a/book/src/guides/adding_languages.md +++ b/book/src/guides/adding_languages.md @@ -34,7 +34,7 @@ below. 2. Create a new directory for the language with the path `runtime/queries//`. 3. Refer to the - [tree-sitter website](https://tree-sitter.github.io/tree-sitter/syntax-highlighting#queries) + [tree-sitter website](https://tree-sitter.github.io/tree-sitter/3-syntax-highlighting.html#highlights) for more information on writing queries. 4. A list of highlight captures can be found [on the themes page](https://docs.helix-editor.com/themes.html#scopes). diff --git a/book/src/guides/injection.md b/book/src/guides/injection.md index c0f75094..729a2c99 100644 --- a/book/src/guides/injection.md +++ b/book/src/guides/injection.md @@ -57,4 +57,4 @@ second argument (a string). - `#any-of?` (standard): The first argument (a capture) must be one of the other arguments (strings). -[upstream-docs]: http://tree-sitter.github.io/tree-sitter/syntax-highlighting#language-injection +[upstream-docs]: https://tree-sitter.github.io/tree-sitter/3-syntax-highlighting.html#language-injection diff --git a/book/src/guides/textobject.md b/book/src/guides/textobject.md index 4d33ab67..2cf3d3be 100644 --- a/book/src/guides/textobject.md +++ b/book/src/guides/textobject.md @@ -44,6 +44,6 @@ in its `textobjects.scm` file, function navigation should also work automaticall `function.movement` should be defined only if the node captured by `function.around` doesn't make sense in a navigation context. -[tree-sitter-queries]: https://tree-sitter.github.io/tree-sitter/using-parsers#query-syntax -[tree-sitter-captures]: https://tree-sitter.github.io/tree-sitter/using-parsers#capturing-nodes +[tree-sitter-queries]: https://tree-sitter.github.io/tree-sitter/using-parsers/queries/1-syntax.html +[tree-sitter-captures]: https://tree-sitter.github.io/tree-sitter/using-parsers/queries/2-operators.html#capturing-nodes [textobject-examples]: https://github.com/search?q=repo%3Ahelix-editor%2Fhelix+path%3A%2A%2A/textobjects.scm&type=Code&ref=advsearch&l=&l= diff --git a/book/src/languages.md b/book/src/languages.md index 0190bb44..d98b1fcb 100644 --- a/book/src/languages.md +++ b/book/src/languages.md @@ -241,4 +241,4 @@ use-grammars = { except = [ "yaml", "json" ] } When omitted, all grammars are fetched and built. -[treesitter-language-injection]: https://tree-sitter.github.io/tree-sitter/syntax-highlighting#language-injection +[treesitter-language-injection]: https://tree-sitter.github.io/tree-sitter/3-syntax-highlighting.html#language-injection diff --git a/book/src/themes.md b/book/src/themes.md index 1d0ba151..62279356 100644 --- a/book/src/themes.md +++ b/book/src/themes.md @@ -136,7 +136,7 @@ The following is a list of scopes available to use for styling: #### Syntax highlighting -These keys match [tree-sitter scopes](https://tree-sitter.github.io/tree-sitter/syntax-highlighting#theme). +These keys match [tree-sitter scopes](https://tree-sitter.github.io/tree-sitter/3-syntax-highlighting.html#highlights). When determining styling for a highlight, the longest matching theme key will be used. For example, if the highlight is `function.builtin.static`, the key `function.builtin` will be used instead of `function`. diff --git a/runtime/queries/ada/highlights.scm b/runtime/queries/ada/highlights.scm index 643fbd66..38e67d82 100644 --- a/runtime/queries/ada/highlights.scm +++ b/runtime/queries/ada/highlights.scm @@ -1,9 +1,3 @@ -;; highlight queries. -;; See the syntax at https://tree-sitter.github.io/tree-sitter/using-parsers#pattern-matching-with-queries -;; See also https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md#parser-configurations -;; for a list of recommended @ tags, though not all of them have matching -;; highlights in neovim. - [ "abort" "abs" diff --git a/runtime/queries/ada/locals.scm b/runtime/queries/ada/locals.scm index e532a2f1..83d62a43 100644 --- a/runtime/queries/ada/locals.scm +++ b/runtime/queries/ada/locals.scm @@ -1,6 +1,3 @@ -;; Better highlighting by referencing to the definition, for variable references. -;; See https://tree-sitter.github.io/tree-sitter/syntax-highlighting#local-variables - (compilation) @local.scope (package_declaration) @local.scope (package_body) @local.scope diff --git a/runtime/queries/awk/highlights.scm b/runtime/queries/awk/highlights.scm index 34d660ad..f8c903f2 100644 --- a/runtime/queries/awk/highlights.scm +++ b/runtime/queries/awk/highlights.scm @@ -1,7 +1,5 @@ ; tree-sitter-awk v0.5.1 -; https://tree-sitter.github.io/tree-sitter/using-parsers#pattern-matching-with-queries - ; Order matters [ diff --git a/runtime/queries/tact/locals.scm b/runtime/queries/tact/locals.scm index f1b3e8de..f7a4115a 100644 --- a/runtime/queries/tact/locals.scm +++ b/runtime/queries/tact/locals.scm @@ -1,5 +1,3 @@ -; See: https://tree-sitter.github.io/tree-sitter/syntax-highlighting#local-variables - ; Scopes @local.scope ; -------------------------