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(neovim): initial version of nvim plugin #29

Closed
wants to merge 1 commit into from

Conversation

Samyak2
Copy link

@Samyak2 Samyak2 commented Jun 1, 2023

A part of #10

Summary

image

An attempt at a neovim plugin for pest that provides:

  • filetype recognition
  • basic syntax highlighting
  • LSP support

TODO:

  • README
  • Installation options (may require moving this plugin to a separate repo)

Syntax highlighting

This plugin provides a basic syntax highlight using vim's built-in highlighter (which is a basic lexical highlighter). This seems to work well enough (see bugs below). Though, a treesitter grammar (#26) would work much better with neovim and will help other editors too.

Bugs:

  • For identifiers, the first character of the line doesn't seem to get highlighted correctly. I tried debugging for hours, no dice.

LSP support

This is already implemented in neovim/nvim-lspconfig#2629, mason-org/mason-registry#1641, williamboman/mason-lspconfig.nvim#230. If you use mason.nvim, you can simply do (even without this new plugin):

set filetype=pest
LspInstall pest_ls

Since this plugin adds filetype recognition, you can skip the first step once you install this plugin.

Another feature this plugin could add is to provide a setup function that sets up the LSP with any special config that is needed.

@Jamalam360
Copy link
Contributor

😍 thank you! I have exams this week and next week but I can look after that

@Samyak2
Copy link
Author

Samyak2 commented Jun 3, 2023

Well, this is embarrassing. I made this plugin thinking there was no vim/neovim plugin for pest. Turns out there is one and that one has a more comprehensive syntax highlighting. It would help if that was linked in this repo's README somewhere 😄

I will close this PR and add any LSP support that I can come up with to pest.vim instead

@Samyak2 Samyak2 closed this Jun 3, 2023
@Jamalam360
Copy link
Contributor

This is still valid! I think it's reasonable to merge all the IDE plugins into one repo, and I don't know if pest.vim supports the LSP yet. It wasn't linked in the README because it was abandoned. @NoahTheDuke since you merged the PR, what are your thoughts (are you working on pest.vim?)?

@NoahTheDuke
Copy link
Member

I didn't know pest.vim was abandoned. I use neovim and maintain other plugins so offered to maintain it when the pest ecosystem was democratized 1.5 years ago. I no longer use Pest day to day but I have time for open source and think it's a shame to see pest languish.

I'll be sure to look at the other PR.

@NoahTheDuke
Copy link
Member

If the question is "should we move pest.vim into this repo?", I don't see an immediate benefit. There's not enough overlap, as far as I can tell.

@Jamalam360
Copy link
Contributor

I said it was abandoned as the last push was 3 years ago before today, which I think is a reasonable assumption lol.

We can keep them separate. I don't use neovim but I presume the PRs to add Pest to the LSP registries mean I don't need to do anything else on my side?

@NoahTheDuke
Copy link
Member

I would assume so.

@Samyak2
Copy link
Author

Samyak2 commented Jun 4, 2023

it's reasonable to merge all the IDE plugins into one repo

I think it's better to keep the vim/nvim plugin in a separate repo. The reason being that most plugin managers for vim/nvim assume that each plugin is a repo on its own. Though this can be configured, each plugin manager has its own way of doing things and would be a headache for everyone involved. I think it's fine to just mention the vim plugin in this repo's README instead.

I don't use neovim but I presume the PRs to add Pest to the LSP registries mean I don't need to do anything else on my side?

I have opened a PR for neovim + LSP support (pest-parser/pest.vim#8), but it doesn't add much and is not a requirement. Users can already start using pest language server in neovim since neovim/nvim-lspconfig#2629 was merged.

@Jamalam360
Copy link
Contributor

Thank you for your work @Samyak2

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.

3 participants