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

No instantaneous diagnostics feedback? #53

Open
oblitum opened this issue Mar 8, 2019 · 10 comments
Open

No instantaneous diagnostics feedback? #53

oblitum opened this issue Mar 8, 2019 · 10 comments

Comments

@oblitum
Copy link

oblitum commented Mar 8, 2019

First thanks for this project.

I noticed this server behaves differently than all others I use, it only provide errors on file save. Any plans to provide instantaneous diagnostics like others? Some servers provide a flag for this, bingo for example provide the --diagnostics-style option.

@nwolverson
Copy link
Owner

Definitely considered having this (opt-in) - on larger projects some files can take a noticeable time for purs ide to compile, but with the right timing/debouncing it could be fine for some.

I do think you'll find that because we just do an actual compilation with no shallow syntactic linting or whatever and there's no kind of incremental parsing/analysis (whatever this is properly called) most of the time you will be in a non-compiling state and the file will just be in a big error status, unparseable.

@oblitum
Copy link
Author

oblitum commented Mar 11, 2019

I agree on that, but for example, with coc.nvim, the plugin I use with NeoVim, it doesn't try compile on every character I type, in fact that's kind horrid/annoying, I've seen that happening with some alternative plugins, I think it's an issue of the client not acting sane. coc.nvim just compiles and shows diagnostics at specific times, like when leaving insert mode.

@oblitum
Copy link
Author

oblitum commented Mar 11, 2019

FWIW, I've added server configuration for coc.nvim here:

(coc.nvim can be configured both from .vimrc as from coc-settings.json)

@nwolverson
Copy link
Owner

In what way is coc.nvim responsible for somehow deciding when to evaluate diagnostics but also it is the language server responsibility? I think more information is required here to understand the behvaiour being discussed.

Diagnostics are a "push" from language server to client, currently we use purs ide rebuild on saving a file and push diagnostics at this time. The client also notifies the server on file contents changing, what we could do is perform a rebuild on the current file/buffer contents at this point (debounced appropriately).

It could be that the vim plugin sends file update notifications only on leaving insert mode?

@oblitum
Copy link
Author

oblitum commented Mar 11, 2019

I think coc doesn't decide when to evaluate anything, just decides when to send text changes to server.

@oblitum
Copy link
Author

oblitum commented Mar 11, 2019

I don't know the internals, but I guess that's it. Instead of sending requests on every input, it sends on sensible spots. I think coc.nvim allows for configuring that too, iirc, it just takes a sensible default, but it can be changed to more requests on every character change.

@oblitum
Copy link
Author

oblitum commented Mar 11, 2019

diagnostic.refreshOnInsertMode is the coc.nvim setting to have updates for every input:

https://github.com/neoclide/coc.nvim/blob/ba4679cb69e1e81bc55d02eb86ba955e3b490af1/data/schema.json#L331-L335

@sriharshachilakapati
Copy link
Contributor

This is an interesting thing to have. I don't think the performance will be a pain when we execute it on the NeoVim's CursorHold event.

@nwolverson Can you make a command for this, so I can choose to call that command whenever I need to see the diagnostics? I had some really huge projects using PureScript, some with thousands of modules too.

I think trigger update after a CursorHold event that comes after a TextChange should be better.

@oblitum
Copy link
Author

oblitum commented Mar 15, 2019

@sriharshachilakapati coc.nvim does it on InsertLeave, it provides a good balance IMO, since I'm generally not interested in diagnostics until finished micro editing, which couples to entering Normal mode. Update rate control is more on the hands of the client than the server.

@sriharshachilakapati
Copy link
Contributor

sriharshachilakapati commented Mar 21, 2019

I ran a test run on a project I had at work which had 858 purescript modules. I've set autowrite. It was working ok, file was being written and I had webpack constantly watching for files and loading it. Not sure about pulp though, we are using purs-loader in our organization.

This shouldn't in theory cause any issue with instantaneous diagnostics. I'll take some time to experiment with the server this weekend.

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

3 participants