Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: reimplement #34

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

feat: reimplement #34

wants to merge 3 commits into from

Conversation

srghma
Copy link

@srghma srghma commented Nov 2, 2024

  1. I wanted to just delete syntax files, deprecate them in favour of https://github.com/kayhide/tree-sitter-idris and feat(idris): add parser and queries nvim-treesitter/nvim-treesitter#7274

  2. but then started doing astronvim plugin https://github.com/AstroNvim/astrocommunity/pull/1258/files and couldnt connect

then I found that neovim already builtin the support for

  1. textDocument/semanticTokens/full (no need to handle it at all)
with and without lsp highlight

with

vim.api.nvim_set_hl(0, '@lsp.type.type', { fg = '#8be9fd' })                      -- Cyan
vim.api.nvim_set_hl(0, '@lsp.type.function', { fg = '#ff79c6' })                  -- Pink
vim.api.nvim_set_hl(0, '@lsp.type.enumMember', { italic = true })                 -- Purple
vim.api.nvim_set_hl(0, '@lsp.type.variable', { fg = '#ffb86c', bg = '#282828' })  -- Orange
vim.api.nvim_set_hl(0, '@lsp.type.keyword', { fg = '#bd93f9', bold = true })      -- Red
vim.api.nvim_set_hl(0, '@lsp.type.namespace', { fg = '#50fa7b', italic = true })  -- Green
vim.api.nvim_set_hl(0, '@lsp.type.postulate', { fg = '#ffffff', bg = '#ff5555' }) -- Red
vim.api.nvim_set_hl(0, '@lsp.type.module', { fg = '#f1fa8c' })                    -- Yellow

2024-11-02-01pm-30-48-screenshot

without, only treesitter

2024-11-02-01pm-33-03-screenshot

  1. and hover is builtin supported too using :lua =vim.lsp.buf.hover(), so, I deleted hover.lua too

other changes

  1. use only vim.ui
  2. add commands and keybindings
  3. TODO: restore config
  4. show warning if many lsp servers are opened simultaneusly
  5. code actions work not good rn, but actually I like <leader>la more

2024-11-02-01pm-41-40-screenshot

@clason
Copy link

clason commented Nov 4, 2024

Please don't delete syntax files, filetype detection, and ftplugins. Not everybody wants to or can use nvim-treesitter.

(You're welcome to write your own "filetype plugin", but what you're doing here is not reimplementing, it's simply removing somebody else's useful contribution.)

@srghma
Copy link
Author

srghma commented Nov 6, 2024

removing somebody else's useful contribution

moving to vim/vim#15993 , if @ShinKage allows 😃

P.S. current problems:

  1. many instance of idris2-lsp are created for one or many files (can be reused?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants