-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
766 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
steps: | ||
- powershell: | | ||
cask install | ||
.\script\test.ps1 | ||
displayName: Run tests (Windows) | ||
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) | ||
|
||
- bash: | | ||
set -e | ||
cask install | ||
script/test | ||
displayName: Run tests | ||
condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
queries/* -linguist-detectable | ||
queries/** -linguist-detectable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,33 @@ | ||
#+TITLE: tree-sitter-langs | ||
#+TITLE: Tree-sitter Language Bundle for Emacs | ||
|
||
This is a convenient language bundle for the Emacs package [[https://github.com/ubolonton/emacs-tree-sitter][tree-sitter]]. It serves as an interim distribution mechanism, until ~tree-sitter~ is widespread enough for language-specific major modes to incorporate its functionalities. | ||
#+BEGIN_HTML | ||
<a href="https://dev.azure.com/emacs-tree-sitter/tree-sitter-langs/_build/latest?definitionId=2&branchName=master" rel="nofollow"> | ||
<img src="https://dev.azure.com/emacs-tree-sitter/tree-sitter-langs/_apis/build/status/ci?branchName=master&label=build&api-version=6.0-preview.1" alt="Build Status" style="max-width:100%;"> | ||
</a> | ||
#+END_HTML | ||
|
||
This is a convenient language bundle for the Emacs package [[https://github.com/emacs-tree-sitter/elisp-tree-sitter][tree-sitter]]. It serves as an interim distribution mechanism, until ~tree-sitter~ is widespread enough for language-specific major modes to incorporate its functionalities. | ||
|
||
For each supported language, this package provides: | ||
1. Pre-compiled grammar binaries for 3 major platforms: macOS, Linux and Windows, on x86_64. In the future, ~tree-sitter-langs~ may provide tooling for major modes to do this on their own. | ||
2. An optional ~highlights.scm~ file that provides highlighting patterns. This is mainly intended for major modes that are not aware of ~tree-sitter~. A language major mode that wants to use ~tree-sitter~ for syntax highlighting should instead provide the query patterns on its own, using the mechanisms defined by [[https://ubolonton.github.io/emacs-tree-sitter/syntax-highlighting/interface-for-modes/][tree-sitter-hl]]. | ||
3. Optional query patterns for other minor modes that provide high-level functionalities on top of ~tree-sitter~, such as code folding, evil text objects... As with highlighting patterns, major modes that are directly aware of ~tree-sitter~ should provide the query patterns on their own. | ||
|
||
** Building grammars from source | ||
It's more convenient to work with this repository as a submodule of [[https://github.com/ubolonton/tree-sitter-langs][emacs-tree-sitter]]. However, if you want to skip that, below are the steps to build grammars from source using only this repository. | ||
It's more convenient to work with this repository as a submodule of [[https://github.com/emacs-tree-sitter/elisp-tree-sitter#building-grammars-from-source][emacs-tree-sitter]]. However, if you want to skip that, below are the steps to build grammars from source using only this repository. | ||
|
||
*** Tools and dependencies | ||
- Install [[https://cask.readthedocs.io][cask]]. | ||
- Install ~npm~. (Some grammars depend on another npm-packaged grammar. For example: ~cpp~, ~typescript~.) | ||
- Install [[https://tree-sitter.github.io/tree-sitter/creating-parsers#installation][tree-sitter CLI tool]] (if you don't use NodeJS, you can download the binary directly from [[https://github.com/tree-sitter/tree-sitter/releases][GitHub]]). | ||
- Clone this repository and install its dependencies. | ||
#+begin_src bash | ||
git clone https://github.com/ubolonton/tree-sitter-langs | ||
cd tree-sitter-langs | ||
cask install | ||
#+end_src | ||
- Install NodeJS. It is needed to generate the grammar code from the JavaScript DSL. The recommended tool to manage NodeJS is [[https://volta.sh/][volta]]. | ||
- Install [[https://tree-sitter.github.io/tree-sitter/creating-parsers#installation][tree-sitter CLI tool]]. (Its binary can also be downloaded directly from [[https://github.com/tree-sitter/tree-sitter/releases][GitHub]].) *Note: versions 0.20+ cannot be used, as they introduce [[https://github.com/tree-sitter/tree-sitter/pull/1157][a breaking change]] in binary storage location*. | ||
|
||
*** Building a single grammar | ||
Run ~script/compile <lang>~, where ~lang~ is one of the languages under [[./repos][repos/]]. | ||
#+begin_src bash | ||
cask eval "(progn (require 'tree-sitter-langs-build) (tree-sitter-langs-compile 'rust))" | ||
script/compile rust | ||
#+end_src | ||
|
||
*** Building the whole grammar bundle | ||
#+begin_src bash | ||
cask eval "(progn (require 'tree-sitter-langs-build) (tree-sitter-langs-create-bundle))" | ||
script/compile all | ||
#+end_src |
Oops, something went wrong.