Coder Social home page Coder Social logo

Comments (5)

Anrock avatar Anrock commented on July 28, 2024 2

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.

BurningLutz avatar BurningLutz commented on July 28, 2024 1

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.

BurningLutz avatar BurningLutz commented on July 28, 2024

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.

fendor avatar fendor commented on July 28, 2024

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.

michaelpj avatar michaelpj commented on July 28, 2024

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)

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.