govim / govim

govim is a Go development plugin for Vim8, written in Go
BSD 3-Clause "New" or "Revised" License
872 stars 62 forks source link

cmd/govim: Language Server Client should not be created for specific language #113

Closed kyoh86 closed 5 years ago

kyoh86 commented 5 years ago

It's nonsense.

FYI: https://langserver.org/

Why LSP?

LSP creates the opportunity to reduce the m-times-n complexity problem of providing a high level of support for any programming language in any editor, IDE, or client endpoint to a simpler m-plus-n problem.

We should focus on making generic clients and language servers better. Our resources are not infinite.

myitcv commented 5 years ago

Hi @kyoh86 - what are you specifically commenting on?

Command github.com/myitcv/govim/cmd/govim (referred to simply as govim) is a Go development plugin for Vim8. It is backed by gopls, the Language Server Protocol server for Go. Because it is a Go development plugin, it doesn't really lay claim to being a generic LSP client.

Package github.com/myitcv/govim provides an API for plugin developers to interface with Vim8 in Go.

As such, I don't (currently) have it as a specific goal to provide a generic LSP client in the github.com/myitcv/govim/... modules/packages.

The golang.org/x/tools packages built around https://godoc.org/golang.org/x/tools/internal/lsp/protocol might become such a client when it possibly is "released" from being internal. That is being tracked by https://github.com/golang/go/issues/31080

kyoh86 commented 5 years ago

@myitcv

I'm sorry I didn't make it clear enough.

I'm thinking in the following way.

Otherwise, we cannot reduce the m-times-n complexity problem.

I'm given to understand that Language Server Protocol is solution for the problem.

Langserver.org says:

The problem: "The Matrix"

Go Java TypeScript ...
Emacs        
Vim        
VSCode        
...        

The solution: lang servers and clients

Language Server
Go  
Java  
TypeScript  
...  
Editor Client
Emacs  
Vim  
VSCode  
...
myitcv commented 5 years ago

@kyoh86 thanks for providing more detail. I think it depends what you are trying to solve for.

What are you trying to do right now that:

  1. can't be done in Vim?
  2. can't be done with a plugin written in VimScript?
  3. can't be done with a github.com/myitcv/govim-based plugin written in Go?
  4. can't be done with the github.com/myitcv/govim/cmd/govim Go development plugin?

My guess, given that we're having this discussion in the context of a Go-based plugin, is that you're actually looking for something between 3 and 4, say 3.5. Specifically, an LSP client, written against github.com/myitcv/govim that provides some sort of API to a Vim user.

To be honest, I don't know what that API should look like, hence I've effectively started by solving this in reverse by creating github.com/myitcv/govim/cmd/govim as a Go development plugin.

Now it's entirely possible that something generic and useful is produced in the process of continued development of github.com/myitcv/govim/cmd/govim.

So, long story short: I'm not entirely clear what goal you're trying to solve, but equally I'm not averse to a generic LSP client plugin "something" for Vim; it's just that I don't know what that looks like yet. So I'm starting with a specific goal of github.com/myitcv/govim/cmd/govim and seeing where that takes me.

myitcv commented 5 years ago

I'm going to close this issue on the basis I think it is well addressed in the FAQ (and its various links). Please say if you disagree.