pschanely / CrossHair

An analysis tool for Python that blurs the line between testing and type systems.
Other
1.04k stars 49 forks source link

Neovim LSP Support #198

Open PorcoRosso85 opened 1 year ago

PorcoRosso85 commented 1 year ago

Describe the solution you'd like A imprementation LSP integration to Neovim buildin lsp

Your thought? Maybe for not small amount of user..

pschanely commented 1 year ago

So! CrossHair ships with an LSP server built in! (docs)

I am not familiar with neovim, but as you say, it also appears to have built-in LSP support. (docs)

In theory they might just happen to work together. Would you be willing to check it out, see whether it works, and report back? I fit works, we might add a little section for the docs for example IDE configuration snippets.

PorcoRosso85 commented 1 year ago

Sounds great. Excuse me because I'm just neovim user, I can't imprement external lsp configuration.

I would be glad if someone reading this knows that users are already potential.

@pschanely Can that someone who implemented this contact you if they complete the implementation?

pschanely commented 1 year ago

I poked around just now and got it to work! You just run the vim.lsp.start command with cmd = {'python', '-m', 'crosshair', 'server'}; e.g.:

:lua vim.lsp.start({name = 'ch-lsp', cmd = {'python', '-m', 'crosshair', 'server'}, root_dir = '.'})

The only trick is that you have to make sure that the python you execute is the one for your project. (and that crosshair is installed for that python environment)

Screen Shot 2023-03-02 at 6 26 38 AM

I'll add something to the docs this week with the command above. Thank you for the suggestion!

PorcoRosso85 commented 1 year ago

Thanks.

I've tried, but there is no response. Excuse me, let me know how to debug depite that contract is broken. Anything is wrong?

Maybe this issue is also in same issue. https://github.com/pschanely/CrossHair/issues/199

PorcoRosso85 commented 1 year ago

Your command is runnable. Thanks.

It can be a plugin if we imprement a plugin lua file to run whenever neovim will run

スクリーンショット 2023-03-03 10 48 38