Comments (5)
IMO eagerly loading everything sounds like a desirable behaviour. IDE that works only for some symbols or shows only some diagnostics depending on what files user have touched before sounds pretty flawed to me. Perhaps HLS could index other files in low-priority background thread? Or maybe not all files but all current file imports and reverse imports?
from haskell-language-server.
Thanks for all your replies! The workaround @fendor provided works great!
As @fendor and @michaelpj pointed, this is currently by design and there is #3873 tracking this problem, I'm going to close this now.
from haskell-language-server.
more information, If the new project is created inside a directory that is already indexed by HLS, the goto-definiation seems to work even I didn't open the MyLib.hs
file once.
from haskell-language-server.
Hi, thank you for your bug report!
This is expected behaviour, we do not have a notion to eagerly load components directly. We still load components lazily, e.g. only when you actually open them.
The reason it works on subsequent start is, we have a sqlite database (hiedb) which caches the relevant information (e.g. definitions), so it works once it has been indexed.
There is one work-around, tell cabal to load all components with this hie.yaml
:
cradle:
cabal:
component: all
If tests and benchmarks are enabled in your cabal.project
, this is equivalent to a fully eager load of the project.
from haskell-language-server.
See #3873.
I do agree that it would be great if we at least indexed everything. However I think at the moment that requires loading everything into our session, which is a big, global choice. So I don't know that we can easily do this in the background.
I think probably what we would ideally do is get cabal to build the components out-of-process and get it to write the HIE files, which should then let us index things?
from haskell-language-server.
Related Issues (20)
- Drop support for GHC 9.2 HOT 1
- Get benchmarks working on 9.10
- Add Haskell Error Index to "code description" entry in diagnostics HOT 2
- Unwanted Completions in Comments HOT 1
- GNUmakefile needs to be patched for cabal-3.12
- HLS 2.8 sometimes gets stuck on startup HOT 2
- Improve the error message when there is a typo in the Cabal file HOT 3
- HLS gets stuck if session setup fails for any reason HOT 1
- definition.Imported symbol (reexported) fails without `$TEMPDIR/hls-test-root`
- Adding `{-# OPTIONS_GHC -Wno-all #-}` at the top of the file makes HLS cease to report errors, not only warnings.
- Multiple Components option is not documented in the online manual
- Custom notifications for starting and finishing rules
- Don't use completions for cabal file codeactions
- Renaming a record data constructor also renames record fields HOT 1
- Is ghcide-bench supposed to be built and installed by default? HOT 7
- How can I pass custom build options JUST to HLS? HOT 2
- Invalid snippet syntax causes failures in neovim text editor
- Reaching path length limit in Windows
- `Could not load module` error in test suites with custom build type
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 haskell-language-server.