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

Any chance to integrate OmniSharp? #960

Closed
partounian opened this issue Sep 27, 2017 · 11 comments
Closed

Any chance to integrate OmniSharp? #960

partounian opened this issue Sep 27, 2017 · 11 comments

Comments

@partounian
Copy link

https://github.com/OmniSharp/omnisharp-vim

@w0rp
Copy link
Member

w0rp commented Sep 27, 2017

I'm not sure. I don't know how it works. Someone else might.

@w0rp w0rp added the triage label Sep 27, 2017
@stuart-bennett
Copy link

stuart-bennett commented Nov 6, 2017

Caveat - I'm new to extending Vim + Ale so my observations might not be totally accurate or completely unfounded :)

OmniSharp doesn't fit as neatly into the typical usage I've seen of Ale. By that I mean typically there's a standalone command that performs the linting whereas OmniSharp runs as a separate long-running process (using HTTP to handle back and forth between vim), it loads project files at startup to bootstrap a lot of rich functionality including linting.

It has a /codecheck endpoint that does the linting of source code and the OmniSharp-Vim plugin exposes this via Omnisharp#CodeCheck() function.

@w0rp - is it possible / can you suggest anyways to define a linter like (I know return types aren't correct but this how I could envisage it working):

function! ale_linters#cs#GetCommand(buffer) abort
    	" From omnisharp-vim, returns 0 || 1
	return g:OmniSharp_loaded
endfunction

function! ale_linters#cs#Executable(buffer) abort
	call OmniSharp_CodeCheck()
endfunction

call ale#linter#Define('cs', {
\   'name': 'omnisharp',
\   'executable_callback': ale_linters#cs#Executable
\   'command_callback': ale_linters#cs#GetCommand
...

So basically instead of calling out to an external cmd, invoke a Vim function? Feels like this might be outside the use-case for Ale, and should perhaps just write a custom function to invoke the Vim function and manually add the results to the linting errors collection?

@w0rp
Copy link
Member

w0rp commented Nov 6, 2017

I'm not sure, that sounds a bit unusual.

@stuart-bennett
Copy link

stuart-bennett commented Nov 7, 2017

Yeah, I suppose fundamentally it operates like Language Server Protocol Server would, in fact the OmniSharp team appear to be working on that (https://github.com/OmniSharp/csharp-language-server-protocol)
I didn't notice that Ale had support for LSP so maybe this will be a lot easier when this OmniSharp LSP implementation is available.

@w0rp
Copy link
Member

w0rp commented Nov 7, 2017

Integrating with an LSP server is a better bet.

@jmg5e
Copy link

jmg5e commented Nov 19, 2017

You should maybe check out (https://github.com/OmniSharp/omnisharp-node-client). I have had success getting ominsharp support using the vim-lsp plugin. What all goes into defining linters that take advantage of ale's lsp capabilities?

@w0rp
Copy link
Member

w0rp commented Nov 19, 2017

Have a look at the rls or pyls linters for examples. There are a few other examples. Also consult the documentation for ale#linter#Define.

@JDeuce
Copy link

JDeuce commented Nov 22, 2017

Ah damn I just switched from syntastic to ale recently and I want to start using omnisharp. The integration with syntastic is working fine so I guess the solution is to just go back to using that for now.

@w0rp
Copy link
Member

w0rp commented Nov 22, 2017

If you really want it, you could open a pull request for it.

@JulioJu
Copy link
Contributor

JulioJu commented Oct 28, 2018

Actually, OmniSharp works well with ALE. Maybe https://github.com/w0rp/ale/blob/master/doc/ale-cs.txt and https://github.com/w0rp/ale#1-supported-languages-and-tools could be updated ? And this current Issue could be closed ?

@w0rp
Copy link
Member

w0rp commented Oct 29, 2018

I'll add some text in the documentation. Thanks for the information!

@w0rp w0rp closed this as completed Oct 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants