Coc.nvim: A coc-purescript extension :raised_hands:

Created on 13 Jul 2019  路  10Comments  路  Source: neoclide/coc.nvim

Feature request to port the PureScript VSCode extension to Coc.

PureScript features an awesome IDE server that provides the usual development conveniences. Stuff like autocomplete, go-to-definition, and help with imports.

When language servers became a thing, nwolverson was kind enough to build a language server around the PureScript server which is already listed in Coc's docs as one of the many language servers one can enable for this awesome plugin. As a result, Coc+PureScript is pretty awesome already.

There are however some neat actions which the PureScript IDE server supports that don't work with just the language server. The strongest example is explicit imports. The PureScript IDE server allows one to hover a word and ask for an import. If there's only one possible import, Coc already manages to apply the action correctly and adds the import. However, most times a word is found as an export of many modules. In which case, the IDE server returns a list of options. Here Coc silently fails. There's a short list of these actions which are broken or unsupported.

Lucky for us, I understand Coc is actually built to work with extensions as VSCode does, and nwolverson has already built a VSCode extension which handles all these cases 馃檶 !

Do I understand correctly that one could convert or extend such a VSCode extension to work with Coc?

enhancement help wanted

Most helpful comment

It's possible to port the vscode extension to coc if someone interested.

All 10 comments

It's possible to port the vscode extension to coc if someone interested.

Cool! I don't think I'll get to it myself any time soon. Can we leave this open as the feature request for it? 馃槃

I have closed #1770 which was requesting coc-perl. Should this be closed too (or the other reopen)? I've provided the following reason there:

There's no coc-perl, but you may configure a language server like Perl-LanguageServer.

Then, you may update the wiki and add Perl to the list of configured examples, or even create the coc-perl extension yourself (also check create-coc-extension as a helper).

I'm closing this as it seems not relevant to the core project and needs to be provided independently.

For me it's a bit weird to have many coc-something requests on hold.

@oblitum why is it weird for feature requests to be on hold until someone fulfills them? If people want these extensions, people want these extensions, no? I think it's helpful to see the interest in them so that people might decide to provide them. I know it worked that way for me when I was more actively doing open-source.

Is there another place you think would be more fit for this feature request? Or perhaps there could be a single issue with all extension requests, we close all the others, and people can upvote there?

In the end, it's up to the maintainers of this project to decide what they want in their issue tracker. Personally, I think feature requests, as long as they have some upvotes, are good to have.

Is there any guide on how to convert a VSCode extension to a coc extension? I don't have any experience with either, I just need support for PureSCript auto-imports in neovim, and I'm trying to figure out how the best way to achieve that.

@shinzui you can run this in the meantime: https://github.com/FrigoEU/psc-ide-vim

But ideally, the coc plugin would handle imports too.

I saw your plugin, wouldn鈥檛 it conflict with the language server?

@shinzui what do you mean? Conflict how?

I gave you a suggestion, feel free to follow it, or to let it be. _Without any intended offense_, either I know this doesn't work and am selling you snake oil, in which case I'd suggest you be less mistrustful 馃, or I know it works for me, but you're asking if it works for you, which would be a bit lazy 馃槃.

I think the move is to simply try 馃槈 .

@alextes Hey, sorry, I didn't mean anything negative. My understanding is that psc-ide-vim also handles completion, so I wasn't sure how it would interact with coc.nvim. I'll give it a try today to see how it works.

@shinzui all good (: and true, it does also handle completion. There certainly is needless overhead in having both. I don't think coc uses omnicompletion at all, but I'm not sure. In any case, I am quite confident vim won't be trying to run completion for both unless you've configured omnicompletion in addition to coc-nvim.

Have fun with PureScript 馃榿 .

Was this page helpful?
0 / 5 - 0 ratings