tree-sitter / tree-sitter-c-sharp

C# Grammar for tree-sitter
MIT License
177 stars 47 forks source link

Indentation Support? #322

Closed KiLLeRRaT closed 9 months ago

KiLLeRRaT commented 9 months ago

Hi,

Are there any plans to add indentation support to this plugin?

I'm having a rough time with the default indent stuff in Neovim.

verbose set indentexpr?:

indentexpr=GetCSIndent(v:lnum)
        Last set from /usr/share/nvim/runtime/indent/cs.vim line 19

If there are not plans to add it, and you find that C# indents are working for you, I'd really appreciate a hand if you don't mind discussing in this issue.

My current setup:

vim.opt.autoindent = false
vim.opt.smartindent = false
vim.opt.expandtab = false
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2

When I run gww on a long line, it does this (Pipes added for visibility of the tabs:

        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory
        |   |   loggerFactory, IOutgoingEmailService outgoingEmailService)
        {

I want this (single tab only):

        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory
        |   loggerFactory, IOutgoingEmailService outgoingEmailService)
        {

Many thanks,

amaanq commented 9 months ago

wrong repo, nvim-treesitter is what you want.

KiLLeRRaT commented 9 months ago

Oh, I was under the impression that the C# language specifics (:TSInstall c_sharp) was part of this repo.

I will make an issue in nvim-treesitter then.

Cheers,