* Multi component support
In this commit we add support for loading multiple components into one
ghcide session.
The current behaviour is that each component is loaded lazily into the
session. When a file from an unrecognised component is loaded, the
cradle is consulted again to get a new set of options for the new
component. This will cause all the currently loaded files to be
reloaded into a new HscEnv which is shared by all the currently known
components. The result of this is that functions such as go-to
definition work between components if they have been loaded into the
same session but you have to open at least one file from each component
before it will work.
Only minimal changes are needed to the internals to ghcide to make the
file searching logic look in include directories for all currently
loaded components. The main changes are in exe/Main.hs which has been
heavily rewritten to avoid shake indirections. A global map is created
which maps a filepath to the HscEnv which should be used to compile it.
When a new component is created this map is completely refreshed so each
path maps to a new
Which paths belong to a componenent is determined by the targets listed
by the cradle. Therefore it is important that each cradle also lists all
the targets for the cradle. There are some other choices here as well
which are less accurate such as mapping via include directories which
is the aproach that I implemented in haskell-ide-engine.
The commit has been tested so far with cabal and hadrian.
Also deleted the .ghci file which was causing errors during testing and
seemed broken anyway.
Co-authored-by: Alan Zimmerman <alan.zimm@gmail.com>
Co-authored-by: fendor <power.walross@gmail.com>
* Final tweaks?
* Fix 8.4 build
* Add multi-component test
* Fix hlint
* Add cabal to CI images
* Modify path
* Set PATH in the right place (hopefully)
* Always generate interface files and hie files
* Use correct DynFlags in mkImportDirs
You have to use the DynFlags for the file we are currently compiling to
get the right packages in the package db so that lookupPackage doesn't
always fail.
* Revert "Always generate interface files and hie files"
This reverts commit 820aa24189.
* remove traces
* Another test
* lint
* Unset env vars set my stack
* Fix extra-source-files
As usual, stack doesn’t understand Cabal properly and doesn’t seem to
like ** wildcards so I’ve enumerated it manually.
* Unset env locally
Co-authored-by: Alan Zimmerman <alan.zimm@gmail.com>
Co-authored-by: fendor <power.walross@gmail.com>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* [#518] Build ghcide with GHC 8.10.1
Resolves#518
* Move CPP logic to the Compat module
* Revert changes to mkHieFile
* Add local fork of HieAst for 8.10.1
The fix for mkHieFile didn't make it into 8.10.1, so the override is still needed
* Ignore hlint in src-ghc810/HieAst.hs
* Whitelist CPP for Development.IDE.GHC.Orphans
* [#518] Build ghcide with GHC 8.10.1
Resolves#518
* Move CPP logic to the Compat module
* Revert changes to mkHieFile
* Add local fork of HieAst for 8.10.1
The fix for mkHieFile didn't make it into 8.10.1, so the override is still needed
* Ignore hlint in src-ghc810/HieAst.hs
* Whitelist CPP for Development.IDE.GHC.Orphans
* Plugin tests known broken in 8.10.1 (#556)
* Bump up ghc-check version
Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
Co-authored-by: pepe iborra <pepeiborra@gmail.com>
* Use custom version of h-l-t
* Use normalized path functions from h-l-t
* Restore empty path corner case
* Create a wrapper over NFP to override IsString
* Use maybe instead fromMaybe
* Use patched version of lsp-types in all yaml files
* Remove unused import
* Rename specific NormalizeFilePath to NormalizeFilePath'
* Remove specific newtype and IsString instance
* Use released haskell-lsp-0.21
* Adapt to type changes of haskell-lsp-0.21
* Add tags field to CompletionItem
* Fix test case about empty file path
* Correct stack.yaml used in azure ci cache
* Build ghcide including tests in windows azure ci
* Qualify haskell-lsp modules to avoid name clashes
* Add azure job for windows and ghc-8.6
* Trigger build in branches starting with azure
* Add other valid stack.yaml to windows using matrix
* Using azure task Cache@2 instead CacheBeta@0
* Ignore tests in windows for now
* Install happy standalone to avoid spurious build error
* Add comment about installing happy
* Use matrix names more consistent with existing ones
* Enable build using ghc-8.8.2 for windows
* Ignore .vscode dir
* Use templates and matrix in linux job