lukas-reineke / indent-blankline.nvim

Indent guides for Neovim
MIT License
4.07k stars 102 forks source link

Add "vue", "svelte" & "angular" to scope_languages #845

Closed ynhhoJ closed 5 months ago

ynhhoJ commented 6 months ago

Resolves #844

Before: image

After: image

lukas-reineke commented 6 months ago

Have you read :help ibl.config.scope? I don't believe any of these are scope.

ynhhoJ commented 6 months ago

Have you read :help ibl.config.scope? I don't believe any of these are scope.

Yeah, i think you are right there. Those are indentation from treesitter.

Is there way to configure node_types for languages what are not present in scope_languages.lua?

This code does not has any effect:

require("ibl").setup {
      indent = { char = "▏" },
      scope = {
        include = {
          node_type = {
            css = {
              "block",
              "declaration",
            },
          },
        },
      },
    }
ynhhoJ commented 6 months ago

@lukas-reineke , i updated languages_scope file. Can you verify if everything is good, please?

CSS ![image](https://github.com/lukas-reineke/indent-blankline.nvim/assets/22500212/250c43b5-2127-4746-a69b-de9706a12cba)
Code ```css @tailwind base; @tailwind components; @tailwind utilities; :root {} body { .test { color: black; } } ```
SCSS ![image](https://github.com/lukas-reineke/indent-blankline.nvim/assets/22500212/d759a7b2-84d7-439a-a143-8af9931058a7) ![image](https://github.com/lukas-reineke/indent-blankline.nvim/assets/22500212/400c9dc9-787b-4674-b6a0-85f84fcc958c) ![image](https://github.com/lukas-reineke/indent-blankline.nvim/assets/22500212/dea73fd3-e753-421c-8bed-6da1698227f4) ![image](https://github.com/lukas-reineke/indent-blankline.nvim/assets/22500212/9e353d9f-1a56-488e-861e-68e8e9b08b0d)
Code ```scss @use "sass:math"; @function scale-below($value, $base, $ratio: 1.618) { @while $value > $base { $value: math.div($value, $ratio); } @return $value; } $normal-font-size: 16px; sup { font-size: scale-below(20px, 16px); } $sizes: 40px, 50px, 80px; @each $size in $sizes { .icon-#{$size} { font-size: $size; height: $size; width: $size; } } @mixin reset-list { margin: 0; padding: 0; list-style: none; } @mixin horizontal-list { @include reset-list; li { display: inline-block; margin: { left: -2px; right: 2em; } } } ```
Vue ![image](https://github.com/lukas-reineke/indent-blankline.nvim/assets/22500212/05c03a96-11d8-44bd-9718-a3a95944204a)
Code ```vue ```
lukas-reineke commented 5 months ago

I still don't think this is right. CSS variable scoping works very differently to normal languages. This is not easy to display with the indentation.

https://blog.logrocket.com/css-variables-scoping/

I don't think adding CSS and SCSS will work.

Vue and Angular are fine.

ynhhoJ commented 5 months ago

I removed SCSS & CSS from language_scope.lua