Skip to content

Commit

Permalink
update!: rename to hyprlang
Browse files Browse the repository at this point in the history
  • Loading branch information
luckasRanarison committed Jan 4, 2024
1 parent 5ce9847 commit 1ec4fd9
Show file tree
Hide file tree
Showing 30 changed files with 1,170 additions and 56 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
@@ -1,10 +1,10 @@
[package]
name = "tree-sitter-hypr"
description = "hypr grammar for the tree-sitter parsing library"
version = "1.0.0"
name = "tree-sitter-hyprlang"
description = "hyprlang grammar for the tree-sitter parsing library"
version = "2.0.0"
keywords = ["incremental", "parsing", "hypr"]
categories = ["parsing", "text-editors"]
repository = "https://github.com/tree-sitter/tree-sitter-hypr"
repository = "https://github.com/tree-sitter/tree-sitter-hyprlang"
edition = "2018"
license = "MIT"

Expand Down
22 changes: 11 additions & 11 deletions README.md
@@ -1,16 +1,16 @@
# tree-sitter-hypr
# tree-sitter-hyprlang

hyprland configuration files grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).
[hyprlang](https://github.com/hyprwm/hyprlang) grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).

## Neovim

To actually use it in Neovim and get syntax highlighting, folds, smart indent, and automatic file detection, you can use the repository as a plugin by installing it with your package manager. Then, install the grammar with `:TSInstall hypr`.
To actually use it in Neovim and get syntax highlighting, folds, smart indent, and automatic file detection, you can use the repository as a plugin by installing it with your package manager. Then, install the grammar with `:TSInstall hyprlang`.

### Lazy

```lua
return {
"luckasRanarison/tree-sitter-hypr",
"luckasRanarison/tree-sitter-hyprlang",
dependencies = { "nvim-treesitter/nvim-treesitter" },
}
```
Expand All @@ -19,7 +19,7 @@ return {

```lua
use {
"luckasRanarison/tree-sitter-hypr",
"luckasRanarison/tree-sitter-hyprlang",
requires = { "nvim-treesitter/nvim-treesitter" },
}
```
Expand All @@ -36,15 +36,15 @@ Add the flake and use it as `vimPlugin` within e.g. your home manager configurat
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
tree-sitter-hypr = {
url = "github:luckasRanarison/tree-sitter-hypr";
tree-sitter-hyprlang = {
url = "github:luckasRanarison/tree-sitter-hyprlang";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
nixpkgs,
home-manager,
tree-sitter-hypr,
tree-sitter-hyprlang,
...
}: {
homeConfigurations."user@hostname" = let
Expand All @@ -57,7 +57,7 @@ Add the flake and use it as `vimPlugin` within e.g. your home manager configurat
programs.neovim = {
enable = true;
plugins = with pkgs.vimPlugins; [
tree-sitter-hypr.packages.${pkgs.system}.default
tree-sitter-hyprlang.packages.${pkgs.system}.default
{
plugin = nvim-treesitter.withAllGrammars;
type = "lua";
Expand All @@ -79,10 +79,10 @@ Add the flake and use it as `vimPlugin` within e.g. your home manager configurat

### Filetype detection

hyprs configuration does not have a specific filetype extension. Thus, we detect `.conf` with a path pattern. If your configuration does not get initialized as filetype `hypr` you can set it locally with `:set filetype=hypr` or add another pattern for type detection to your config. The following snippet resolves files with name `hyprland.conf` and sets `hypr` as filetype.
hyprlang does not have a specific filetype extension. Thus, we detect `.conf` with a path pattern. If your configuration does not get initialized as filetype `hyprlang` you can set it locally with `:set filetype=hyprlang` or add another pattern for type detection to your config. The following snippet resolves files with name `hyprland.conf` and sets `hyprlang` as filetype.

```lua
vim.filetype.add({
pattern = { [".*/hyprland%.conf"] = "hypr" },
pattern = { [".*/hyprland%.conf"] = "hyprlang" },
})
```
2 changes: 1 addition & 1 deletion binding.gyp
@@ -1,7 +1,7 @@
{
"targets": [
{
"target_name": "tree_sitter_hypr_binding",
"target_name": "tree_sitter_hyprlang_binding",
"include_dirs": [
"<!(node -e \"require('nan')\")",
"src"
Expand Down
8 changes: 4 additions & 4 deletions bindings/node/binding.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions bindings/node/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions bindings/rust/lib.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 comments on commit 1ec4fd9

@aserowy
Copy link
Contributor

@aserowy aserowy commented on 1ec4fd9 Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luckasRanarison

where did you find the reference for the change in file extension? Cause if we get a unique extension we can replace path patterns with:

vim.filetype.add({ extension = { hyprlang = "hypr or somthing like this" } })

@luckasRanarison
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't get a file extension, just got an official name.

When I started this project it wasn't a thing so I just named it hypr, and hyprlang just got official some weeks ago so I thought it would make sense to rename it . Also, now that it's the case and because this parser became useful for many people, I've decided to add it directly to nvim-treesitter nvim-treesitter/nvim-treesitter#5852, so if this get merged the plugin would become unnecessary and people could just add their own detection strategy.

@aserowy
Copy link
Contributor

@aserowy aserowy commented on 1ec4fd9 Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, my wording was... easy to misunderstand :D. Hoped we got one.

@luckasRanarison
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, my wording was... easy to misunderstand :D. Hoped we got one.

Ah sorry, I see xD

Please sign in to comment.