* [bench-hist] break down in rule functions
* Extract the benchmarking Shake rules to a shake-bench package
There's some room for reusing the rules used in the historic benchmarking suite
in other projects. This change makes that a bit easier and improves the
documentation and code structure.
The new structure is:
- lib:shake-bench - a Cabal library with functions to generate Shake rules
- ghcide:bench:benchHist - the ghcide instantiation of the above Shake rules
That's not to say that shake-bench is completely decoupled from ghcide -
there are still plenty of assumptions on how the benchmarks are organized, their
outputs, etc. But with a little bit of effort, it should be easy to make
these rules more reusable
* Fix nix build
* Fix license
* hlints and redundant imports
* more hlints
* Exclude shake-bench from the stack build
* Move tracing functions to own module
* Bump opentelemetry to 0.6.0
* Write Values map size to OpenTelemetry metric
* Trace all requests and notifications
Instead of doing it in `HoverDefinition`, do it in
with{Response,Notification,...}. These wrap all handlers, so this should
cover everything. It also means that the span covers the entire
processing time for the request, where before we missed the setup
happening in the with* functions.
* Add flag for OpenTelemetry profiling
Run GC regularly with --ot-profiling
* Add flag to enable OT profiling in benchmark
* Use heapsize instead of ghc-datasize
I renamed the fork to distringuish from the original.
It is still being pulled from git using stack. This will be addressed
once I can push the fork to hackage.
* Bump opentelemetry to 0.6.1 - fixes 8.6 build
* Use heapsize from hackage
* Address HLint messages
* Record size of each key independently
* Refactor `startTelemetry` function
* Remove delay between measuring memory loops
* Each key in values map gets own OT instrument
* Measure values map length more rarely
* Rename --ot-profiling to --ot-memory-profiling
* Add docs for how to use the opentelemetry output
* Add instructions to build release version of tracy
* Clarify dependencies in opentelemetry instructions
* Fix LSP traces
* otTraced: delete unused
* Extract types out of D.IDE.Core.Shake
to avoid circular module dependencies
* Extract startTelemetry out of D.IDE.Shake and upgrade to 0.2
No more segfaults
* [nix] install opentelemetry
* [nix] install tracy
* Fix merge wibble
* Measure recursive sizes with sharing
* Sort keys for cost attribution
* Remove debug traces
* Allocate less, group keys, clean up hlints
* Add -A4G to the flags used for --ot-memory-profiling
* Modularize D.IDE.Core.Tracing
I want to reuse this code more directly in the non lsp driver
* Direct driver: report closure sizes when --ot-memory-profiling
An eventlog memory analysis doesnt' seem so relevant since this mode is not
interactive, but we could easily produce both if wanted to
* Everything is reachable from GhcSessionIO, so compute it last
I suspect the ShakeExtras record is reachable from GhcSessionIO
* bound recursion and use logger
* hlint suggestions
* Fix 8.6 build
* Format imports
* Do the memory analysis with full sharing. GhcSessionIO last
* Fail fast in the memory analysis
* error handling
* runHeapsize now takes initSize as an input argument
* Trace Shake sessions
* Reduced frequency for sampling values length
* Drop the -fexternal-interpreter flag in the Windows stack build
* Produce more benchmark artifacts
* Fix stack descriptors to use heapsize-0.2 from Hackage
* Bump to heapsize-0.3.0
* Record completions snippets (#900)
* Add field for RecordSnippets to CachcedCompletion
* Initial version of local record snippets
* Supprt record snippet completion for non local declarations.
* Better integration of local completions with current implementation
* Clean up non-local completions.
* Remove commented code.
* Switch from String to Text
* Remove ununsed definition
* Treat only Records and leave other defintions as is.
* Differentiate Records from Data constructors for external declaration
* Update test to include snippet in local record completions expected list.
* Update completionTest to also compare insertText.
* Add test for record snippet completion for imported records.
* Hlint fixes
* Hlint fixes
* Hlint suggestions.
* Update type.
* Consolidate imports
* Unpack tuple with explicit names
* Idiomatic changes
* Remove unused variable
* Better variable name
* Hlint suggestions
* Handle exhaustive pattern warning
* Add _ to snippet field name suggestions
* Remove type information passed around but not used
* Update to list comprehension style
* Eliminate intermediate function
* HLint suggestions.
* Idiomatic list comprehension
Co-authored-by: Pepe Iborra <pepeiborra@me.com>
* [nix] use gitignore.nix (#920)
* Ignore import list while producing completions (#919)
* Drop any items in explicit import list
* Test if imports not included in explicit list show up in completions
* Update README.md (#924)
* Custom cradle loading (#928)
When using ghcide as a library, it may be desirable to host the hie.yaml file
in a location other than the project root, or even avoid the file system altogether
* Favor `lookupPathToId` over `pathToId` (#926)
* Favor `lookupPathToId` over `pathToId`
* Fix `typecheckParentsAction`
* Fix `needsCompilationRule`
* Return completion snippets only when client supports it (#929)
* Use the real client capabilities on completions
* Return completion snippets only when supported by the client
Restored from https://github.com/haskell/ghcide/pull/900
* Redundant import
* Fix stack windows build
Co-authored-by: Michalis Pardalos <m.pardalos@gmail.com>
Co-authored-by: Michalis Pardalos <mpardalos@gmail.com>
Co-authored-by: Guru Devanla <gdevanla@users.noreply.github.com>
Co-authored-by: Samuel Ainsworth <skainsworth@gmail.com>
* Add github test action
* Disable unreliable test
Does not work reliably on all platforms.
Reenable when #861 lands
* Add hlint and -Werror
* Explicit timeout
6h is the default and also the maximum:
https://docs.github.com/en/free-pro-team@latest/actions/reference/usage-limits-billing-and-administration
* Experiment tests to use Cabal instead of Stack
* Fix an unreliable test
* Trim down matrix
* Add ghc-lib to the test matrix
* Address broken hie-compat ghc-lib build
* Drop stack descriptor family
We keep two stack descriptors:
- One for Nightly
- One for Windows (stuck in GHC 8.10.1)
To ensure that `stack test` doesn't break, we keep running the stack tests in CI
* Update README to point end users to HLS
* Drop support for `stack test`
* Enable tests in windows ci
* Use lsp-test-0.11.0.6
* Fix tests in windows
* Use chocolatey to install cabal in ci
* Fix test: type constructor external
* Fix test: non workspace file
* Mark cpp-error as ignored for windows
* Ignore plugin tests for windows
* Fix stack 8.6 build
* Avoid sharing the cache between test and bench stack builds
* Add hie-bios revision to stack.yaml
https://github.com/haskell/ghcide/pull/801#issuecomment-691833344
Skipping other stack descriptors as not strictly needed
* Disable benchmark job until master is fixed
* Use implicit-hie when no explicit hie.yaml
* Use implicit-hie-cradle master in all build config files
* Set correct hie-bios version for ghc-8.10.1
* Fix windows ci build
* Cancellation of user actions
* Dispatch event handlers asynchronously
* add tests for asynchronous features
This adds a new Test plugin for custom requests
and a new blocking Command
* hlint
* Link the Testing plugin only when --testing
* Fix expectNoMoreDiagnostics
Needs also https://github.com/bubba/lsp-test/pull/74
* Upgrade lsp-test to a version that understands CustomClientMethod
* Add a benchmark to track startup times
* Benchmark automation
disable benchmarks easily
save GC stats to file
cradle, rts, filter and samples options
path to ghcide
configurable example
--help
more detailed CSV output
hover after edit
pause for GC
configurable timeout
upgrade extra (required to build bench)
Include max residency in BenchRun
Include all details on output
* reduce threadDelay to avoid upsetting lsp-test
* Fix startup time measurement
* Added new edit experiment
* fix doc comment
* hlints
* Upgrade to lsp-test 0.11.0.2
* Flag failed experiments
* Update ghcide.cabal
There are a couple of cases to handle as seen below.
Thanks @jneira for help discovering them all.
There used to be linking errors but I no longer see those after the multi-cradle patch
Non Nix
=========
The table below shows a couple of combinations of cradles and ghcide versions in a
non-Nix environment. All the version mismatches are now handled as follows:
- "Cannot satisfy package" - `-package-id` flags referencing
package versions not available (generally base)
- "bad interface" - tried to load an interface file created by a different version of ghc
cradle/ghcide | 8.6 | 8.8 | 8.10
--------------|-----|----|---
Cabal 8.6 | success | cannot satisfy package | cannot satisfy package
Cabal 8.8 | cannot satisfy package | success | cannot satisfy package
Cabal 8.10 | cannot satisfy package | cannot satisfy package | success
Stack 8.6 | success | bad-interface | bad-interfac-
Stack 8.8 | bad-interface | success | bad-interface
Stack 8.10 | bad-interface | bad-interface | success
Nix
=========
Because Nix redefines the libdir to point at the run-time ghc installation,
it's actually much easier to detect a version mismatch:
just compare the compile-time and run-time libdirs
* Update to hie-bios 0.5.0
* Fix test-cases due to changes in the direct cradle
* Update test/exe/Main.hs comment
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* 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
* Require shake-0.18.4 which contains actionBracket
* Change progress reporting to use files rather than Shake nodes
* Remove inadvertantly writing down Shake twice
* Don't support old haddock-library versions
* Update stack.yaml values
* Remove some more haddock_library CPP
* Make sure the latest haddock-library is on GHC 8.4
* Remove JSON instances for completions, since we are not implementing "resolve"
* Remove completion resolve data from tests
* Better docs
* Fix tests
* Fix for 8.4
* Turn Haddock markup into Markdown
* Add types to completion items
* Make it work on 8.8 and 8.4
* Revert "Remove completion resolve data from tests"
This reverts commit 625d710f11.
* Revert "Remove JSON instances for completions, since we are not implementing "resolve""
This reverts commit 12ff27dce7.
* Fix tests
* Require higher version of regex-pcre-builtin
* Replace Pandoc with direct conversion from Haddock to Markdown
* Show kinds of type constructors too
* A few fixed to Markdown conversion
* Check optNewColonConvention
* Fix build on 8.4 and 8.8
* More fixes for 8.4 and 8.8
* Check only the common part of the completion text
* Make icons consistent with Outline
* Test docs for completions
* Make constructors return the corresponding CompletionItem + tests for that behavior
* Make test work on 8.4
* Test for #45
* Remove redundant symbols from imports
Fixes#45
* Update src/Development/IDE/LSP/CodeAction.hs
Co-Authored-By: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
* Apply suggestions from code review
Co-Authored-By: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
* Add regex-tdfa extra deps to ghc-lib build
* Fix for GHC 8.4 (error message prints qualified binding)
GHC ticket #14881 changed this to print identifiers unqualified
* dropBindingsFromImportLine: make total
Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
* Initial implementation of completion support
* Add fuzzy to set of additional dependencies in 8.8
* Fix test
* Work a bit more on completion
* Attempt at getting completions from last good tckd module
* Revert "Attempt at getting completions from last good tckd module"
This reverts commit 04ca13b9d8.
* "useWithStale" everywhere
* Some suggestions by @cocreature
* Adjust positions in the document
* Start working on tests
* Fix compilation problem
* Fix tests
* Better type tests
Previously we had a mix of GHC_STABLE and checks on
__GLASGOW_HASKELL__. This PR changes this to always check on
MIN_GHC_API_VERSION. Depending on whether you use ghc-lib or not (now
controlled by a cabal flag), this macro expands to MIN_VERSION_ghc or
MIN_VERSION_ghc_lib.
* #2326, GHC 8.4 compatibility
* Fix up CI
* Add a Shake lower bound
* Upgrade to a hie-bios which is GHC 8.4 compatible
* Add a GHC 8.4 stack
* Fix HLint again
* Upgrade haskell-lsp and lsp-test
There have been some fixes upstream that should hopefully mean that we
no longer need to mark the lsp-tests as flaky on Windows. I am having
trouble reproducing the flakiness locally, so let’s see what happens
on CI.
* Also bump stack.yaml
This is in preparation for #2326 as well as for splitting hie-core
into a separate repo. Given that, it explicitely avoids using our
dev-env.
We do need to install a few system packages, so for now this uses the
hosted builder so we can do this. Another option would be to just add
those to our builders. I don’t really have a preference either
way. The builds are < 5 minutes so I don’t expect issues from using
the hosted builders.
* Update the hie-bios commit SHA
* Also update the SHA in our bazel WORKSPACE
* Update the hash too
* Tutorial for Emacs integration
* Update hie-bios patch