Giter Club home page Giter Club logo

Comments (10)

nwolverson avatar nwolverson commented on July 21, 2024 1

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.

from purescript-language-server.

oblitum avatar oblitum commented on July 21, 2024

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.

from purescript-language-server.

oblitum avatar oblitum commented on July 21, 2024

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

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

from purescript-language-server.

nwolverson avatar nwolverson commented on July 21, 2024

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?

from purescript-language-server.

oblitum avatar oblitum commented on July 21, 2024

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

from purescript-language-server.

oblitum avatar oblitum commented on July 21, 2024

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.

from purescript-language-server.

oblitum avatar oblitum commented on July 21, 2024

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

from purescript-language-server.

sriharshachilakapati avatar sriharshachilakapati commented on July 21, 2024

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.

from purescript-language-server.

oblitum avatar oblitum commented on July 21, 2024

@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.

from purescript-language-server.

sriharshachilakapati avatar sriharshachilakapati commented on July 21, 2024

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.

from purescript-language-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.