* Update to latest version of lsp libraries
* Compute completions on kick
This is not only for faster completions.
It's also needed to have semi-fresh completions after editing.
This is specially important for the first completion request of a file - without this change there are no completions available at all
* Emit LSP custom messages on kick start/finish
useful to synchonize on these events in tests
* Fix completions tests after https://github.com/haskell/lsp/pull/376
* Restore cabal update with comments
* Use new lsp in stack 9.0.1
Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
Co-authored-by: jneira <atreyu.bbb@gmail.com>
* CI: caching: do `bench` & `test` separately
`cabal v2-build all --enable-tests --enable-benchmarks` inferres 1 version per dep
keeping all targets.
People (frequently) & CI do `test` & `bench` separately.
So `all tests` & `all bench` deps may not end up.
Even current code does not match the CI guarantees, as all plugins get `test`
separately, so their deps can not match-up.
`caching` should not assume guarantees bigger then provided.
* CI: caching: rm workaround
This workaround was not addressing the CI behaviour.
* CI: {caching, test, bench}: output `freeze` or warning
* CI: {caching, test, bench}: m v2-update unification
* CI: caching: do bench caching only for what gets used
Efficient use of available space.
* CI: caching: fx benchmark caching step
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
* CI: {caching, test, bench}: `haskell/actions/setup` does the update
* CI: caching: m fx
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
* CI: add hlint workflow
* CI: hlint: update to action
This is what `fmt.sh` runs.
* CI: hlint: use version 3.3.1
* CI: hlint: fix args
* CI: hlint: use 3.3.4
* CI: {caching,test,bench}: mk cache aware of package dep versions
1. CI caches 3rd patry dependency binaries.
2. That is why we do not want to trigger on all `.cabal` changes. We want to
cache only when changes in `.cabal` descriptions lead to changes in versions of
deps used, or in their compilation flags. `freeze` files:
For example the bits of the resulting `.freeze` file:
active-repositories: hackage.haskell.org:merge
constraints: any.Boolean ==0.2.4,
...
any.HsYAML ==0.2.1.0,
HsYAML -exe,
any.HsYAML-aeson ==0.2.0.1,
HsYAML-aeson -exe,
any.JuicyPixels ==3.3.6,
JuicyPixels -mmap,
any.MemoTrie ==0.6.10,
MemoTrie -examples,
...
any.QuickCheck ==2.14.2,
QuickCheck -old-random +templatehaskell,
aeson -bytestring-builder -cffi -developer -fast,
...
any.aeson-pretty ==0.8.9,
aeson-pretty -lib-only,
bifunctors +semigroups +tagged,
any.blaze-textual ==0.2.2.1,
blaze-textual -developer -integer-simple +native,
...
any.brittany ==0.13.1.2,
brittany -brittany-dev-lib -brittany-test-perf,
...
any.clock ==0.8.2,
clock -llvm,
any.cmdargs ==0.10.21,
cmdargs +quotation -testprog,
...
any.comonad ==5.0.8,
comonad +containers +distributive +indexed-traversable,
...
any.hashtables ==1.2.4.2,
hashtables -bounds-checking -debug -detailed-profiling -portable -sse42 +unsafe-tricks,
haskell-language-server -alternatenumberformat +brittany +callhierarchy +class +eval +floskell +fourmolu +haddockcomments +hlint -ignore-plugins-ghc-bounds +importlens +modulename +ormolu -pedantic +pragmas +qualifyimportednames +refineimports -rename +retrie +splice +stylishhaskell +tactic,
...
any.hlint ==3.2.7,
hlint -ghc-lib +gpl -hsyaml +threaded,
hls-eval-plugin -pedantic,
hls-graph -embed-files -pedantic -stm-stats,
hls-hlint-plugin -ghc-lib -hlint33 -pedantic,
...
any.integer-logarithms ==1.0.3.1,
integer-logarithms -check-bounds +integer-gmp,
...
any.lens ==5.0.1,
lens -benchmark-uniplate -dump-splices +inlining -j +test-hunit +test-properties +test-templates +trustworthy,
...
any.scientific ==0.3.7.0,
scientific -bytestring-builder -integer-simple,
any.semigroupoids ==5.3.6,
semigroupoids +comonad +containers +contravariant +distributive +tagged +unordered-containers,
any.semigroups ==0.19.2,
semigroups +binary +bytestring -bytestring-builder +containers +deepseq +hashable +tagged +template-haskell +text +transformers +unordered-containers,
...
any.transformers-compat ==0.6.6,
transformers-compat -five +five-three -four +generic-deriving +mtl -three -two,
...
any.vector ==0.12.3.1,
vector +boundschecks -internalchecks -unsafechecks -wall,
any.vector-algorithms ==0.8.0.4,
vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks,
...
index-state: hackage.haskell.org 2021-11-29T12:28:17Z
```
You got the idea. `freeze` collects stuff for dependencies.
I also checked - it solves & collects all package configuration across all
subprojects in one file.
* CI: {caching,test,bench}: freeze: allow to fail
Before we not had this at all.
Now - most cases would use it.
But for example, all HLS subprojects can not solve single version of deps for
GHC 9.0 at once.
And depending on `.cabal` is not the right way, as it means to account of only 1
configuration of many in the project.
* CI: {caching,test,bench}: fx cache keys
* CI: {caching,test,bench}: freeze: output result into log
* CI: caching: add workaround to allow last step to fail
* CI: {caching,test,bench}: use only freeze file hash
This solves the `build all` problem when all projects can't infer the consitent
package version.
Also would allow caching workflow on manual start - to work & cache in a broken
or complex PRs.
* Enable manual run
* Remove skip ghcide
We want to build all deps
* Enable manual run of hackage
* allow only check packages
* Enable manual run of build
* CI: caching: fix early termination expression check
It is obscure bug.
Details are in
https://matrix.to/#/!oOjZFsoNYPAbTEgSOA:libera.chat/$tB_L6wbaxe1ElQtYzMI9woID4hZyscS6Rhpn-nsCc6Y?via=libera.chat&via=matrix.org&via=monoid.al
Because after the second path somehow it always returned `False` - the caching
runs always resulted in early termination.
* CI: caching: fx `cabal.project` copying
In the
https://github.com/haskell/haskell-language-server/runs/4596861600?check_suite_focus=true
of
https://github.com/haskell/haskell-language-server/pull/2503
Noted that:
I rm cabal.project. The sources of cabal-ghc921.project contain:
index-state: 2021-12-18T00:00:07Z
cp cabal-ghc921.project cabal.project
Then from cabal.project CI retrieves finderprint 2021-11-29T08:11:08Z.
Seems like GitHub uses alias cp=cp -i - preventing UNIX-like default copying over behaviour.
& rm cabal.project does not remove the file.
cabal.project seems to be protected from deletion.
* cabal*.project: index-state +1s
Renewing cache.
* CI: {caching,test}: make rm/cp comment more informative
* CI: {caching,test}: upd commets
This should short-cirquit.
* cabal*.project: index-state +1s
* Correct small typo
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Use `extQ` to choose parser.
- In the process of development, it was forgotten that the "parent" type
of patterns and exprs is different. When traversal occurs, SYB would
throw out `Pat` types as it was only expecting `HsExpr` types.
- Using `extQ` allows us to chain the expected types and we can then
destructure patterns appropriately.
* Revert "Disable alternate numbers format plugin temporary (#2498)"
This reverts commit 15d7402696.
* Rework troubleshooting section, add basic explainer
This is an attempt to make the troubleshooting doc a bit better
structured. It's a bit lacking in concrete details for some of the
common problems (because I forget exactly how they mainfest), but I hope
that we can beef this up as things come up.
I also added a short explainer doc which explains some of the key
concepts.
* Update docs/troubleshooting.md
Co-authored-by: Pepe Iborra <pepeiborra@me.com>
* Reorganize a bit
Co-authored-by: Anton Latukha <anton.latukha@gmail.com>
Co-authored-by: Pepe Iborra <pepeiborra@me.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* CI: caching: add early termination
* CI: caching: run cache check 3 times a day
Recently there is a lot of PRs/builds from internal repo branches. Repo cache
has 10G pool limit & PR caches are not shared between PRs, but main branch cache
is.
Checking & when missing rebuilding it ensures that if internal branch PRs pushed main state
out of the pool - it gets reinstituted.
*afaik* there is no way to prioritize main branch cache better, since GitHub CI
FIFO caches out of the pool by build time.
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Disable alternateNumberFormat temporary
* Disable alternateNumberFormat tests
* Add a warn in docs
* Add link to issue in docs
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Bump class plugin to work with GHC 9.0.1
* Update class flag in hls cabal file
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* CI: workflows: disable stack where it is not used
Hopefully it would remove it & its files from being cached in the action. & also
not includde into environment.
* CI: {bench,hackage} add Linux platform config
For future caching configuraiton.
* CI: {caching,test,bench,hackage}: retrieving index timestamp
For 1:1 according cache to it.
* CI: {caching,test,bench,hackage}: new caching process
Sources are stored separately.
Before this cache was storing per Platform/GHC sources & compiled results
together. While deps sources does not depend on platform or GHC, they are
platform & GHC agnostic. Because sources & compiled results were stored togather
& sources took ~1/2-2/3 of that - cache stored multiple duplicates of the same
source code.
This config stores the source code separately.
And at the same time tries to store & share all source code which may be needed.
& all compiled deps that would be used in different workflows.
* CI: caching: separate source retrieval step & separate build step
* CI: {caching,bench}: add executable patching for cache
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* CI: caching: upd doc
* CI: caching: rm schedule
It seems would not be needed.
`cabal.project` has pinned Hackage revision & when HLS code updates in `master`
is during merges.
* CI: caching: build & save cache
* CI: (caching,test,bench): org bootstrap
This were organized but others were ommited, because `build` & `hackage` have a
different purpose I postphoned addind bootstrap to them.
* CI: rm submodule checkouts
Seems like HLS does not plan to use submodules.
* CI: bench: fitting the workflow to strategy chosen
Still kept the 9.0.1 bootstrap, because the very next workflow standard GHC
update would hit the need of that code.
* CI: bench: default to bash
* CI: bench: rm env step
* CI: Circle-CI: m fx
Merely to refresh the Circle-CI report status in the PR
* CI: caching: fx: rm executable name patching
* Remove support for ghc 8.8.3/8.10.5
* Remove ghc-8.10.5 from circleci
* Correct releases links
* Rename stack test dir
* Parametrize stack wrapper test
* CI: (cache-deps->caching)
* CI: caching: add doc
* CI: rm 8.10.5
Since next HLS release is no longer supports this version.
* CI: update to currently recommended Cabal version
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
* CI: cache-deps: rm pull request hook
I needed to remove
b0621d7490
before merge.
That is my fault, I should be more conservative between draft<->mergable PR.
* CI: cache-deps: shift cache regeneration time
Since most contributors are in the US & EU, & lets pretend they contribute
between 17:00 - 00:30 - this cache time seems better.
* 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>
* Add test-case for projects that use symbolic links
In particular, this test checks whether modules that are actually
symbolic lins can be found by ghcide.
This is known to be broken, as Session.hs canonicalises Targets, e.g.
saves the location of the symbolic link. When we later try to load that
module, we can't find it, as it won't be part of the known targets since
it is not canonicalized.
* Dont canonicalise Targets during session setup
Canonicalising Targets makes it harder later to actually find the
targets during import analysis, as ghcide only looks for modules in the
import paths and checks for existence in the known target Map.
However, import analysis doesn't canonicalise target candidates, thus
the lookup in the known target Map will always fail.
We no longer canonicalise Targets, so import analysis will succeed
loading modules that are actually symbolic links.
* Prefer makeAbsolute over canonicalizePath
* Use makeAbsolute to read HIE files from disk
* Restore repeated builds
the ghcide build fails for win and ghc-8.8 with segfaults
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.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>
* Add modern issue templates
* Replace with modern issues templates
* Mention discussions in the blank issue
* Mention explicitly vscode binaries location
* Correct grammar
Co-authored-by: fendor <fendor@users.noreply.github.com>
* Correct grammar
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
* Rephrase into
Co-Authored-by @michaelpj
* they already let you open a blank one
* Comment out suggestions
Co-authored-by: fendor <fendor@users.noreply.github.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Rerun tests between run attempts
* without quotes
* Bump up versions for hackage
* Add support for auth github requests
As anonymous ones reach the api limit quickly
Via a unique argument with a github oauth token
* Add changelog for 1.5.1
* Fix makrdownlint warnings
* Bump up index state
* Bump up plugin version
* build with -v3 on error
* More backjumps for tests and benchs
* Add last prs
* eval plugin needs ghcide>=1.5.0.1
* Include #2395 in the changelog
* Ignore deferred tests for win and 9.0.1
* Ignore tactics tests for ubuntu+8.6.5
* Check the build workflow
* Add gitlab/ghcup specific intructions
* Apply suggestions from @michaelpj
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
* Note where are release artifacts
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Use hackage version of czipwith
* Update stack.yaml's
* Remove source czipwith
* Update index and clean cabal-ghc921.project
* extra-1.7.9 has a breaking change so no way
* Increase resources for circleci
As for November 16, circleci has set a timeout of 1 hour for jobs in free plans
Trying to increase resources to make the build faster as suggested by its support center
* Use more threads reduce build times
* Correct runs-on field
* Update stack.yaml's
* Dont fail fast if we are checking
* Use ref_name to check it is a check
* Bump patch version of brittany plugin
* Allow newer base/th for czipwith
* Add enough allow-newers to allow build the project
Having all subpackages included in the `packages` field
* Correct allow-newer's
* Add missing cd's
* Bump up ghcide to 1.5.0
* Exclude pkgs not buildable with 9.0.1
* Bum up plugins with changes versions
* Bum up subpackages with changes versions
* Bum up hls version to 1.5.0
* Bump up haddock plugin version
* Allow ghcide 1.5
* Use ghcide 1.5.0 in the rest of plugins
* Use ghcide 1.5.0 for pragmas
* Allow tactics 1.5.0 for hls
* Remove czipwith in hackage ci script
* Disable 9.0.1 for hackage ci
* Use bounds operator consistently
* Build formatters with newer ghc-lib-parser
* Only stylish-haskell needs newer ghc-lib
* Avoid ghc-9.0.1 in other way
* Script needs a min time version
* First draft of 1.5.0 changelog
* Comment out hackage for 9.0.1
* allow newer ghc-lib-parser
* Remove redundant entry
* Correct condition
* Cancel previous hackage jobs
* Add link to pepe's talk slides
* Use th-extras master
* Use th-extras master and uncomment packages
* add extra-1.7.9
* Add required extra-deps
* Comment unbuildable packages again
* Add ignore-plugins-ghc-bounds
* Add #2354
* Complete ghc deprecation notice
* Add extra-1.7.9
* Add #2346 to Changelog
* Use hackage version of czipwith
* Update stack.yaml's
* Remove source czipwith
* Update index and clean cabal-ghc921.project
* extra-1.7.9 has a breaking change so no way
* Increase resources for circleci
As for November 16, circleci has set a timeout of 1 hour for jobs in free plans
Trying to increase resources to make the build faster as suggested by its support center
* Use more threads reduce build times
* Correct runs-on field
Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
* Not suggest exported imports
* Add testing explicit-imports-plugin to github workflow
* Add comment
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
* First temporal changes
* Clean up tests plugin inclusion
Deprecate them as they will be removed when all tests are
moved to their own plugin packages
* Use force-plugins in project files
* Add ghc-9.0.1 to hackage release workflow
Diabling actual upload if the branch contains 'check'
* Improve force-plugins explanation
* Correct deprecated pragma location
* Dont use deprecated pragma
* Correct yaml config error
* Change flag name
* Use new flag name in project files