Comments (10)
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.
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.
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.
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.
I think coc doesn't decide when to evaluate anything, just decides when to send text changes to server.
from purescript-language-server.
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.
diagnostic.refreshOnInsertMode
is the coc.nvim setting to have updates for every input:
from purescript-language-server.
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.
@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.
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)
- Support configuring spago file/target
- Neovim configuration HOT 6
- BUG: Deleting/renaming modules does NOT purge them from the cache HOT 3
- Support completion for qualified do imports
- Docs: Update formatter section HOT 1
- Organizeing imports deletes comments HOT 1
- Hover (show documentation) does not work with recent coc.nvim HOT 8
- Suggestion: Extend diagnostics on type to buffer switches HOT 1
- Support multiple spans per diagnostic
- Incorrect "Go to definition" behavior for the `Bind` data type.
- E715: Dictionary required when trying to apply sourse.sortImports code action HOT 2
- Breakpoints?
- Use with spaghetto (spago@next)
- amazing stuff; just wondering if it supports eval? like in -- >> HOT 1
- Warning/Error reporting not working? HOT 5
- Action to export HOT 1
- Find references returns no references HOT 1
- Should optional field return null? HOT 1
- Stale errors/warnings stick around after a full build
- Presence of VTA prevents LSP functionality
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from purescript-language-server.