elbywan / crystalline

A Language Server Protocol implementation for Crystal. 🔮
MIT License
424 stars 21 forks source link

Only publish diagnostics if the client supports it. #17

Closed hugopl closed 3 years ago

hugopl commented 3 years ago

Fixes issue #16.

hugopl commented 3 years ago

The patch works, but I didn't like to write the code dealing with fetching the client capability to call Workspace#compile twice (on workspace init and on doc/save), any reasons why the Workspace object doesn't have an instance variable for the current Server object?

elbywan commented 3 years ago

@hugopl Thanks for the PR, and sorry for the delay! 👍 @Sija Thanks for the review 👌

any reasons why the Workspace object doesn't have an instance variable for the current Server object?

Not really, I think I wanted to separate concerns when I began writing the code but as the Server & Workspace are tied anyway it does not really matter much. I'm fine with a bit of repetition.