What's done
* [x] Refactor the `runSession*` family function, properly add `TestConfig`, `runSessionWithTestConfig`, as the most generic `runSession*` function.
* [x] remove raraly used variants of `runSession*` functions and replaced by `runSessionWithTestConfig`.
* [x] migrate `ExceptionTests ClientSettingsTests CodeLensTests CPPTests CradleTests` to use the `hls-test-utils`
* [x] Only shift to lsp root when current root is different from the lsp root in DefaultMain of ghcide.
* [x] Remove most usage for `getCurrentDirectory`(After DefaultMain is called), Only remain those in top level of wrapper and exe, implement https://github.com/haskell/haskell-language-server/issues/3736#issuecomment-1924507928
* [x] add Note [Root Directory]
Co-authored-by: fendor <fendor@users.noreply.github.com>
Move ghcide completely to colog-logging style.
Move plugins that were relying on `ideLogger` to colog style logging.
Move opentelemetry to colog-logging style.
This allows us to drop legacy code and unify the logging experience in
HLS.
We add a bunch of new Log constructors at various locations that aim to
be identical to their previous `Logger` statements.
* Exit with non-zero exitcode if wrapper fails to launch
Only when in LSP mode, we want to launch the LSP server that offers the
restart capability.
* Install recommended GHC version for release wrapper tests
---------
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
* Add support for the multi unit argument syntax introduced in GHC 9.4: https://downloads.haskell.org/ghc/9.4.4/docs/users_guide/using.html#multiple-home-units
We now support arguments of the form
```
-unit @unitA -unit @unitB
```
where the response files `unitA` and `unitB` contain the actual list of arguments for that unit:
```
-this-unit-id a-0.1.0.0
-i
-isrc
A1
A2
```
Also refactor the session loader and simplify it.
Also adds error messages on GHC 9.4 if the units are not closed (#3422).
fixes
Fix closure check
session-loader: override old units with new in multi-unit support
Remove implicit-hie
session-loader: remember which files caused old components to be loaded, and
also pass them on to hie-bios so it can in turn pass them to `cabal repl` when
loading newer components.
This allows us to create valid set of build flags encompassing both the old and
new components, and the closure of all components in between.
The observation is that if you want to load some components X, Y, Z and so on,
cabal repl X Y Z ... will be more likely to give you a valid multi component
build plan/flags than cabal repl all, or any way of combining the results of
cabal repl X, cabal repl Y ...
Use new hie-bios
Move implicit cradles to HLS
Fix build on 9.0
Werror
Improve handling of specialTarget
* hie-bios doesn't mention the component name in the message anymore
* stack fixes
* wrapper: remove unused argument
* werror
* werror
* Implicit cradle: match implicit-hie-cradle logic
* Fix eval plugin
* ignore multi unit tests on 9.2
* Some fixes for 9.2
* Add hie.yaml for call-hierarchy-plugin tests
* Add hie.yaml for explicit-record-fields-plugin
* Add hie.yaml for hls-overloaded-record-dot-plugin
* Adapt to lsp changes for workspace/configuration
This has a few substantive changes and a lot of messing with tests.
- We now tell `lsp` our config section, and parse just that section.
- We move the logic for updating the shake build rules for client config
from a `workspace/didChangeConfiguration` handler to the new `lsp`
callback, which will ensure it gets called in all circumstances that
can be relevant.
The test changes are more annoying:
- We ignore config and logging messages by default now, so we have to
stop doing that when we care about it.
- Many tests didn't really need to _change_ the config, but rather just
to set it once at the beginning. I adjusted a lot of test functions to
allow passing in the initial config for this reason.
* don't reduce the message timeout for wingman
* Fix stan plugin
* Doh
* Add arguments to direct logs to various locations
This adds arguments to HLS to allow the user to select whether to send
logs to any or all of:
- a file
- stderr
- the client
Importantly, we can toggle off the default stderr logging, so the vscode
extension can turn it off to avoid the double logging that arises from
logging to both the client and stderr.
I've set the default to _not_ log to the client. This is a change of
behaviour (today we log to the client by default), but I think it gives
the best experience by default, since most clients do show stderr output
somewhere, and then we probably want to make a case-by-case decision on
whether to use the client logging instead.
* Remove weird test
* Fix warning
* Add a log-level argument to set the log level
`--debug` remains as an alias for `--log-level Debug`.
* Fix warning
---------
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
ghcide already depends on 1.7 which added the new module hierarchy
naming, so let's commit to that and use it throughout. Lets us delete
some CPP, which is always good.
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Support initial generic config for plugins
This enables opt-in plugins, i.e. plugins that are not enabled by default
* Support initial generic config for plugins
This enables opt-in plugins, i.e. plugins that are not enabled by default
* Address review comments and remove optionality in configInitialGenericConfig
I can't remember why this was optional in the first place, which probably means no good reason for it to be
* use defConfig instead of def
* test
* descriptor is the golden source for plugin default configs
Read plugin defaults from plugin descriptor instead of copying into initial config
This is less fragile as now the initial generic config specified in the plugin
descriptor is enforced by construction.
The downside is that now the descriptor is needed to parse the config, which
means a few places where a plugin id was enough now require a plugin descriptor,
which is much harder to get. We paper over this by moving these call sites to
the Action monad.
* redundant import
* simplify
* Build fixes
* Build fixes
* pedantic fixes
Use hiedb from hackage
gitlab-ci: remove workaround for windows 9.2.2
gitlab-ci: remove workaround for windows 9.2.2
hie-bios
update hie bios
update hie bios
bounds
hie-bios fixes
hie-bios fixes
lsp 1.6
cabal.project fixes
hie-bios fixes
lsp and hie-bios from hackage
Mark hie-bios error as expectFail
hie-bios fixes
hie-bios fixes
Stack
Stack
stack fixes
* extract ghcide:experiments-types
* extract haskell-language-server:plugins and let go of examples
The main goal here is to move the Plugins module into an internal
library so that it can be reused from the benchmark suite.
In order to
make that easier, and since they hardly serve a purpose in a repository
with 25 plugins, I delete the Example and Example2 plugin descriptors
and their dependencies.
* HLS benchmark suite
Port the ghcide benchmark suite to HLS and benchmark plugin
"configurations" independently.
This includes the following changes to the ghcide benchmark suite and
HLS:
- Support for "configurations" which are defined as sets of plugin ids.
The benchmark will be run with only these plugins enabled and all
others disabled
- Support for configurable concurrency. This relies on RTS -ol and -po
flags to place the RTS traces in the target location rather than in
the cwd
This change requires two commits, the next one places
ghcide/bench/hist/Main.hs into its final location to help 'git'
recognize the change as a file move
* ghcide/bench/hist/Main.hs -> bench/Main.hs
* CI - fix artifact names for uniqueness
* disable shorten HLS step
* Do not store eventlogs to avoid out of disk space
* render durations up to milliseconds
* shorten titles
Goal is to display the formatted CSV (via column) one row per line
* exclude formatting plugin configurations
* Extract ghcide-bench to a standalone package
* ghcide-bench: fix stderr capturing
* Fix mem stats
We parse maxResidency and allocatedBytes from the RTS -S output, but runSessionWithHandles kills the server without waiting for it to exit and these stats don't get logged.
The solution is to use runSessionWithHandles', but unfortunately it is internal and not exposed. I have raised a PR to expose it and in the meantime we need a source repo package.
* feedbacks
* delete Example plugins
* Probe-tools: Print stack ghc version
The ghc version on the $PATH is often not relevant for stack projects.
The ghc version stack is using is printed in addition.
* Probetools: cradle ghc version added to wrapper
* Revert stack ghc changes to Ide.Main
* Update exe/Wrapper.hs
Co-authored-by: fendor <fendor@users.noreply.github.com>
* Probe tools: Print version with padded spaces
Addressing <https://github.com/haskell/haskell-language-server/pull/3093#discussion_r944428948>
Co-authored-by: fendor <fendor@users.noreply.github.com>
* upgrade lsp to 1.5
* fix stack.yaml
* try fix tests
* disable verbose logging in ghcide
* fix more tests in ghcide
* fix floskell test
* disable debug log in func-test
* disable debug log in lsp itself
* Revert "disable debug log in func-test"
This reverts commit 1fd6658c77.
* remove unused import
* fix hls test utils
* upgrade lsp in nix
* fix func-tests
* Revert "fix func-tests"
This reverts commit 2ecd76d0ba.
* fix waitForDiagnosticsFromSourceWithTimeout
* use Null as dummy message in waitForDiagnosticsFromSourceWithTimeout
* simplify a test case
* add comment about lsp bad logs
* init hls-explicit-fixity-plugin
* Update dependencies
* Refactor: Prevent block on startup
* Run pre-commit
* Compatibility: Add emptyMessages
* Remove unused ModIface
* Comment why to make this plugin a lower priority
* Provide hover content while testing fail
* Avoid lambda
* 4 space indent
* Pass Text instead of Name
Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
* update Gitpod config
* update nix shellHook & docs
* install pre-commit hook
* add kokobd as code owner to .gitpod.*
* add gen-hie to Gitpod
* add tools for doc
* remove .pre-commit-config.yaml from .gitignore
* set vscode formatter to stylish-haskell in Gitpod
* refactor selection range plugin
* refine selection range
* add CodeKind to CodeRange
* rename hls-selection-range-plugin to hls-code-range-plugin
* update docs about selection range
* cleanup RuleTypes.hs
* add the missing bang pattern
* fix subRange
* add some unit tests to CodeRange.Rules
* add tests for removeInterleaving
* add even more tests
* fix extra sources
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Make wrapper a LSP on failure
* Fix incorrect imports
* revert import block for smaller diff
* add missing imports
* Fix: callProcess on win32 machines not called
* import container only on win32
* add missing liftIO
Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
* Use proper structured logging for Fourmolu
Previously we just printed directly to stdout and stderr.
* Don't run Fourmolu in debug mode
It prints to stderr, due to uses of `traceM`, and it's not nice to work around this downstream.
It's of questionable utility anyway. The fact that it mostly prints information about extensions, and does so in a hard-to-read format (a string displayed as a list!) indicates that it probably isn't widely used.
* Fourmolu: parse strings to integers before comparing versions
Whoever originally wrote this (😳) had clearly had one too many beers the night before: `show @Int` is not monotonic since e.g. "10" < "2".
* Add new PluginUtility function.
Add the function `throwPluginError`. This function is intended to
provide a common `ResponseError` message for use in logging.
Renamed `response` to `pluginResponse` for more clarity.
* Call hierarchy clean up
* Make Descriptor usable as String/Text or PluginID
* Update reference to ChangeTypeSignature descriptor
* Use unpack rather than show
* Import cleanup
* Merge cleanup
* Fix test suites for effected plugins
* forgot to change the CodeAction kind in the test suite...
* Update new plugin
* Avoid race conditions with VFS and VFS version
We need to take VFS snapshots as soon as we get a change notification.
Consider the following interleaving of events:
1. Change Notification A (updates LSP VFS)
2. Restart Shake Session (A changed) initiated
3. Change Notification B (updates LSP VFS)
4. Restart Shake Session (A changed) takes VFS snapshot and possibly performs more computation
5. Restart Shake Session (B changed)
In particular, between step 3 and 5, we took a snapshot for a previous build,
but this snapshot included changes from a newer VFS state that the build should
not have seen.
To fix this, we need to take snapshots as soon as a notification handler is
called, before forking any threads. This works because LSP calls all handlers
in a single threaded fashion and these handlers block message processing. It
is essential to this on the LSP handler thread rather than the reactor thread
that GHCIDE sets up in order to maintin the property.
* Disable flaky test 'add missing module (non workspace)'
* failing to set the unsafe dynflags is an error
* makeLspRecorder
* include link to the issue tracker
* avoid double popup
* catch another ghc lib dir error
* First go
* Match against specific error message.
* Basic Change Type Signature implementation.
This implementation only matches a single GHC Error message:
```
• Couldn't match type ‘Int’
with ‘Data.HashSet.Internal.HashSet Int’
Expected type: Int -> Int
Actual type: Data.HashSet.Internal.HashSet Int -> Int
• In the expression: head . toList
In an equation for ‘test’: test = head . toList
```
Specifically on `Expected type: ...`, `Actual type:...` and `In an equation ...`.
There are plenty of error messages that match this format but aren't actually valid.
* GHC 9.2.0 compat change
* Lift expectedError message into a separate binding
* Move ChangeTypeAction into it's own plugin
* Add New Error Message parsing.
- Add new regex for matching extra errors message types
- Revamp original regex to match more.
- Add basic test suite.
- Begin adding `tidyActualType` semantics to provide slightly prettier
TyVars
* Added Error Message Validation to ignore bad Messages.
- Add Pretty Printing for Types
- Added a few test scenarios
* Miscellaneous Cleanup.
* Update Tide Type Signature logic.
- Be able to tidy signatures with operators in it
- Use T.words instead of regex matching to split tyVars
* Remove locA (defaults to id in 8.10) to satisfy 9.0+
* Touch up 9.2.1
* Clean up review notes
* Update stack.yamls
* Fix copy-paste error
* Fix Local Signature resolution
* Improve logging (#2558)
* convert to contravariant logging style part 1, uses additional hardcoded log file to see it side by side with original logging
* convert Session to contravariant logging style
* convert Plugin/HLS and FireStore to contravariant logging style
* convert Rules (and most of the universe) to contravariant logging style
* fix tests, allow old style logging and contravariant logging to write to same log file
* fix import inside wrong CPP
* add CPP for LogTactic constructor
* remove redundant import
* fix ghcide tests
* remove unused import
* fix plugin tests
* LSP_TEST_STDERR should apply to contra logger as well
* fix tactic plugin test
* use CPP for Log datatype plugin constructors, remove unused imports
* add a few Pretty instances, add prettyprinter to haskell-language-sever and hls-plugin-api dependencies
* add Pretty Log instances for Session, FileStore, Notifications
* add remaining Pretty Log instances
* add logToPriorities
* fix slight interleaving issue with hslogger and logger both logging, have default logger be mutex stderr or file handle, use stderr if failing to open log file
* forgot to add .cabal files with hslogger dep
* dont use UnliftIO file IO helpers because they are too new
* remove log helper comments, use Doc instead of Text as final console/file logger input, renaming, export Log constructors
* remove accidentally added useless file, removed prettyprinter dep from hls-plugin-api because stack ghc8.6.5 doesnt have it?
* use deprecated prettyprint modules import for the sake of circleci ghc-8.6.5
* use dummy stderr logger for plugin cli commands, use priorityToHsLoggerPriority function instead of manual mapping
* remove old plugin detritus that somehow got committed
* fix prettyprinter imports for 8.6.5
* try enforcing prettyprinter bounds?
* enforcing bound makes no sense
* maybe changing stack yamls does trick
* filter out warnings when their diags are empty to more closely match original
* add ability to select wanted logging columns, match prev ghcide exe logging behaviour
* dont log anything when diags are empty in some defineEarlyCutoff versions
* use non-deprecated prettyprinter imports
* fix ghcide test module
* change logWith to accept priority at call site, remove all logToPriority functions, add cmapWithPrio that contramaps through WithPriority
* remove useless hiding import list, add comments to default recorder makers
* make cradleToOptsAndLibDir take concrete cradle to remove existential type var in Log constructor
* Types.Logger now re-exports prettyprinter, remove unused dependencies on prettyprinter and hslogger
* existential type var to remove boilerplate in Plugins.hs, remove a few Show instances
* add SourceLoc logging column, inline logToDoc functions, add comment explaining hslogger setup existence
* qualify a name to match original source
* fix -WError
* Delete the Telemetry log level (#2727)
It's a bit non-standard, and moreover it's entirely dead.
* Wall and 9.2 fix
* Remove unneeded comments/code
Co-authored-by: J. S <shenjonathan0@gmail.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
Co-authored-by: Pepe Iborra <pepeiborra@me.com>
* convert to contravariant logging style part 1, uses additional hardcoded log file to see it side by side with original logging
* convert Session to contravariant logging style
* convert Plugin/HLS and FireStore to contravariant logging style
* convert Rules (and most of the universe) to contravariant logging style
* fix tests, allow old style logging and contravariant logging to write to same log file
* fix import inside wrong CPP
* add CPP for LogTactic constructor
* remove redundant import
* fix ghcide tests
* remove unused import
* fix plugin tests
* LSP_TEST_STDERR should apply to contra logger as well
* fix tactic plugin test
* use CPP for Log datatype plugin constructors, remove unused imports
* add a few Pretty instances, add prettyprinter to haskell-language-sever and hls-plugin-api dependencies
* add Pretty Log instances for Session, FileStore, Notifications
* add remaining Pretty Log instances
* add logToPriorities
* fix slight interleaving issue with hslogger and logger both logging, have default logger be mutex stderr or file handle, use stderr if failing to open log file
* forgot to add .cabal files with hslogger dep
* dont use UnliftIO file IO helpers because they are too new
* remove log helper comments, use Doc instead of Text as final console/file logger input, renaming, export Log constructors
* remove accidentally added useless file, removed prettyprinter dep from hls-plugin-api because stack ghc8.6.5 doesnt have it?
* use deprecated prettyprint modules import for the sake of circleci ghc-8.6.5
* use dummy stderr logger for plugin cli commands, use priorityToHsLoggerPriority function instead of manual mapping
* remove old plugin detritus that somehow got committed
* fix prettyprinter imports for 8.6.5
* try enforcing prettyprinter bounds?
* enforcing bound makes no sense
* maybe changing stack yamls does trick
* filter out warnings when their diags are empty to more closely match original
* add ability to select wanted logging columns, match prev ghcide exe logging behaviour
* dont log anything when diags are empty in some defineEarlyCutoff versions
* use non-deprecated prettyprinter imports
* fix ghcide test module
* change logWith to accept priority at call site, remove all logToPriority functions, add cmapWithPrio that contramaps through WithPriority
* remove useless hiding import list, add comments to default recorder makers
* make cradleToOptsAndLibDir take concrete cradle to remove existential type var in Log constructor
* Types.Logger now re-exports prettyprinter, remove unused dependencies on prettyprinter and hslogger
* existential type var to remove boilerplate in Plugins.hs, remove a few Show instances
* add SourceLoc logging column, inline logToDoc functions, add comment explaining hslogger setup existence
* qualify a name to match original source
* fix -WError
* Improve wrapper cradle errors
* Refactor cradle result unpacking
* Fix runGhcCmd when NoImplicitPrelude is on
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* add selection range support
* add the whole import area as a selection step
* add selection range plugin to all project files
* merge type signature with value definition
* support ghc 9
* fix it for ghc-9.0
* remove unnecessary import
* reformat GhcIde.hs
* selection range: make it easier to understand
* selection range: improve error handling
* update lsp-types to 1.4.0.1
* add selection range to doc
* fix comment for findSelectionRangesByPositions
* remove a use of partial function
* update author & maintainer
* use foldlM1 instead of foldl1
* add testdata to cabal file
* update performace tips and log level
* update lsp-types in nix
Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
* Initialize and Setup Plugin Source.
* Provide Traversal Module to Haskell AST that collects Literals.
* Change Literals module to return type.
Update our parsing module to return the data type we will use in our
plugin.
The datatype: Literal
Constructors:
Overloaded - Contains an overloaded literal with a SrcSpan
NonOverloaded - Contains non-overloaded literals with a SrcSpan
NoLocation - currently unused.
This data type is bound to change. This module is designed to capture
ALL numeric literals for use in the plugin. When parsing Haskell source
tree, certain cases result in getting a plain `Expr`. This means it is
not annotated with a SrcSpan. As a result, we pass along a SrcSpan
through most functions to keep track of the most recent SrcSpan
encountered. This isn't a fool proof plan and may be removed in the
future.
* Implement Logic for actual CodeActions.
The traversal of Haskell source has been turned into a rule. This rule
generates hidden diagnostics which allow a user to run a code action
over (most) literals.
There is some "dead code" in the sense that some literals (prims to be
exact) are not allowed to be changed, despite existing in code. The
other "dead code" exists in the FormatType type. Certain extensions
exist that alter how numbers are shown or act, we make note of those
extensions but call them "NoFormat", which essentially means it's a
NOOP.
Most of the conversion is done via the Numeric module. There are plenty
of "show" functions that provide the translation of numbers into the
various formats. The only custom format is a slightly "dumb"
NumDecimal-extension-function that generates three separate options,
instead of using a numeric defined function.
* Clarify source code comments. Reformat file structure.
* Set up Test Scaffolding.
* Miscellaneous clean-up.
* Use Regex to Match Source Text.
* Remove unneccessary diagnostics from Rule.
* Update all stack versions to include new Plugin.
* Clean up Conversion.hs and AlternateNumberFormat.
Clean up function names and add supporting haddock documentation for
exported functions.
* Update cabal file bounds and add Github workflow test
* Add plugin package to all cabal.project
* Add plugin to test suite
* Push SYB changes. Test.hs is merely for testing and will be removed prior to Merge.
* Use Generics.SYB for parsing Literals from GHC Source.
Updated Literals.hs to use custom SYB traversal of the AST.
* Update hls-alternate-number-format-plugin.cabal
* WIP: run tests
* Test additions and GHC compatability changes.
* Removed dead code.
PrimLiterals were defined originally, however GHC source doesn't provide
the source text. This is one of the needs of the plugin so we don't
provide duplicate suggestions.
Swapped `Maybe Text` to `Text`. Similar to above we now ignore all
literals that have no source text attached.
Swapped `Maybe SrcSpan` to `RealSrcSpan`. Again, similar to the previous
points we now ignore literals that don't get a sourceSpan attached.
Similarly, we drop any `UselessSpan`'s as those are also not very
helpful.
* Use Set to remove duplicates from CollectLiterals Result.
Certain AST representations are traversed multiple times with the switch
to SYB. Using Set allows to easily remove duplicate Literals from our
result.
Added a test suite to monitor for regressions.
* Delete Test.hs
Inadvertently commit this file.
* Add README and bump version to 1.0.0.0.
* Update HLS cabal file for version change.
* Additional Tests.
* Update Test file to use Path library function.
* Miscellaneous Code Fixes.
- Remove unneeded imports/functions.
- Export only specified functions from each module (and add Haddock
Comment if necessary)
- Minor text changes for accuracy
* Add README to Extra Source Files.
* Update Extra Source Files to include Test Haskell Source files.
* Update Features.md and Minor Bug Fix :)
* Add new plugins to hackage workflow
* Fix Bug caused by Minor Bug Fix.
Co-authored-by: jneira <atreyu.bbb@gmail.com>
Co-authored-by: Fendor <power.walross@gmail.com>
* actual initial qualify imported names implementation
* renamed and added tests for QualifyImportedNames plugin
* fix backtick and parenthesized operators not being qualified correctly
* add tests, and remove logging
* add license, readme, and demo
* remove old demo, add slightly better demo
* remove old mp4 demo, add slightly gif demo
* update readme to use demo
* readme typo
* slight rewording of readme
* slight rewording of readme 2
* remove Demo header from readme
* don't need ShakeExtras and remove some more logging stuff
* hopefully fix ghc 9 differences, rename plugin cabal file
* forgot comma on module re-export
* minimize imports
* fix Hashmap import for ghc <= 8.8, remove unused extension pragmas
* fix hls-qualify-imported-names ghcide bound
* add test suite to CI
* add more tests for qualify imported names plugin
* change ghcide bound to match what @hololeap is doing
* add qualify imported names to feature list
* add demo, readme, test files, test hie.yaml to extra source files
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
* initial commit
project structure
initial test cases
directly modify source to rename references
* code style
* enable for ghc < 8.8.0
* remove aeson from build-depends
* update support
support ghc9
revert retrie version bump
disable feature by default
* enable plugin for testing
* fix test.yml
* code style, ghc9 retrie bump
remove unnecessary flag in test.yml
consistent indentation
increase retrie version for ghc 9.0.1 (decreased by mistake)
* avoid using Data.List.nub
* code style
fix typo in indentation test
break lines at 100 chars
rename some vars
* code style / performance
remove Retire dependency by using exactprint directly
group references by file to increase speed of checking `elem` per file
add test cases (typeclass, let expression)
add some documentation
fix bug when looking up reference in HieDb
improve error messages
rename some function / vars
* replace GhcPlugins import with Name import
* use GHC.Types.Name for ghc >= 9.0.1