jeapostrophe / racket-langserver

Other
269 stars 24 forks source link

Feature Request: Highlight Test Coverage #134

Open gordoncyu opened 2 months ago

gordoncyu commented 2 months ago

It would be great if other editors could use the language server to highlight code not covered by tests, just like how DrRacket does.

dannypsnl commented 2 months ago

Do you mean the functionality describe in https://docs.racket-lang.org/plait/testing-tutorial.html?

gordoncyu commented 2 months ago

Yes, I am referring to the "Syntactic test suite coverage". Currently I am just running raco cover thing.rhm and opening the html file in chrome, but giving this information in editor would definitely smooth my workflow and be aligned with the stated goal of "provid[ing] functionality that mimics DrRacket's code tools as closely as possible" in the README, helping in the way any LSP should.

6cdh commented 2 months ago

I think lsp server can't do that. Test coverage requires to run the code, while lsp server does not run the code and should not run.

There should be a editor specific plugin to do it. For example, there is a button or codelens, click it to run tests in repl, and repl does something under the hood, then show information in editor.

dannypsnl commented 1 month ago

Make sense, @gordoncyu you can also open this request to https://github.com/Eugleo/magic-racket.

gordoncyu commented 1 month ago

I use neovim btw, so doing so would not be my prerogative. I followed @6cdh's advice, writing my own plugin: https://github.com/gordoncyu/racket-cover.nvim.