Previously we opened file FooX before FooX+1 which we import from FooX
so there is a race condition if we try to resolve imports in FooX fast
enough. Now we open them in reverse order to fix this.
The other option would be to write all files to disk before opening
them but given that we can easily avoid this here, I’d rather keep
things in memory.
* Rename hie-core to ghcide
The name `hie-core` has caused a lot of confusion as to how we relate
to haskell-ide-engine so changing it should hopefully help with that.
I also think that ghcide is still a good name once we hopefully
integrate with haskell-ide-engine more closely.
The name ghcide seems to have a reasonable amount of support on
Twitter https://twitter.com/ndm_haskell/status/1170681262987710464
which is of course the only good way to come up with names.
* Add a readme that points people to the new directory.
* Fix bogus replacements
* Use a proper link
* links are hard
* Adding more info to dor
* Adding fields to the graph
* Spelling mistakes and params
* Removing single line function
* Moving the duplicated code
* Revert "Moving the duplicated code"
This reverts commit 520b5d9b0d.
* Adding more structure to graph
* Working tests with graph which is more easy to understand and change.
have few more tests to migrate
* Adding edge details
* One more to go
* Adding more verbose field information
* All tests now tests the fields that are being added
* Removing unused Import
* defined not refined
* Unused imports
* Names need to be consitent
* Acutal and Expected, not expected and expected
* Removing unused export
* Lints
* daml visualize with lsp
* Working command execution with ide
* Have to call visual now
* Split function
* Wrong constuctions of world or the module
* Working almost
* Have to gather all modules
* Now works end to end. Considers all the daml files in workspace
* removing unused code
* removing unused dependency
* Removing unused JS code and better error message
* Function re-arrange
* Removing us of heaad, instead handling error
* Format and rearranging
* Removing unused assignment
* Formating everything
* missed dependency
* Generating visual only for the file that is open
* Using modules from generated pkg, error messages
* Bringing back the commands
* Names and formating
* consitent error message
* Removing Just pattern match using _use now
* package
* Moving visual to a different module
* Function simple
* Removing Rule as it increases memeory consumption
* TODO LSP error
* White space
* Fmt things
* Handling if command was executed for a non daml files
* Better error message
* debugging
* Fix executeCommand
* Adding tests to execute command. Thanks moritz
* Unwanted lines
* Spaces and comment
* 3rd time ?
* Spaces are white
* assert equal instead of assert bool
* Only report progress when client supports it
This fixes an issue that some people encountered when running hie-core
in Emacs with a version of haskell-lsp that does not understand
progress events.
* Fix tests
* More test fixes
* 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
* Support depending on potentially stale values in damlc
For now, this is opt-in and only enabled for the scenario service.
Locations should be properly mapped so if lines are inserted above a
scenario, the scenario link will move down.
* hie-core/test: Dedicated test suite for hie-core
* Apply hlint suggestion
Use System.Environment.Blank's setEnv which has a non-overwrite mode
that implements precisely what we were doing with more code before.
* buildifier fixes
* hie-core-exe works on Windows now - ghc-paths was fixed
* DA.Bazel.Runfiles based on bazel-runfiles
* locateRunfilesMb -> locateRunfiles
* .exe extension on Windows
* Add docstring to locateRunfiles
* bazel-runfiles: Normalize on Windows
* Get draft rule in
* Hlint is now firing
* First hlint unit test
* This gets hlint working in the ide
* Select hlint.yaml contextually. Wip
* Fix prod path
* Switch between prod and test versions of hlint.yaml
* Format
* Ignore hlint hints in the language tests
* Add some debugging stuff. LSP stress test is broken
* Update compiler/damlc/daml-ide-core/src/Development/IDE/Core/Rules/Daml.hs
Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* Tidy up some details
* Simplify settings (remove unused parseFlags)
* Fix LSP stress tests
* ./fmt.sh
* Collapse to one hlint.yaml, provide options
* Fix location of hlint runfiles
* Disable hlint by default; enable for shake-ide tests
* lint (ironic)
* Remove filtering of lints from integration test
* ./fmt.sh
* Respect the flag
* Silence opininated lint
* Update compiler/damlc/daml-opts/daml-opts-types/DA/Daml/Options/Types.hs
Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* Update compiler/damlc/lib/DA/Cli/Damlc.hs
Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* I really did mean optHlintEnable here
* Move hlint enabled check to ofInterest like shouldRunScenarios
* Rename variable
* Cache settings
* Missed a merge conflict
* lift liftIO
* Remove the hlint-testing POC
* use useNoFile_
* Move files in daml-foundations/daml-ghc to compiler/damlc
There is also a bit of refactoring going on to actually split things
apart into sensible targets. What is still missing is a cleanup of the
module hierarchy and a cleanup of the test targets but I’ll leave
those for separate PRs.
As a nice bonus, this also reduces dependencies between targets so it
will speed up compiles.
* Update .hie-bios
Most of them were caused by off-by-one errors in goto definition.
There was also one test that was marked as an expected failure but the
actual bug has been fixed for some time and the only reason it was
failing is that the error message was different than the test
expected.
I’ve also renamed daml-ghc-shake-test-ci to damlc-shake-tests which is
something that I might actually be able to remember :)
Previously, we only checked two diagnostics messages. However, the
second diagnostics messages does not actually need to correspond to
the latest change but can just be a message that has been in the queue
from one of the 1000 changes before. Now we make sure to actually
check all (or at least every second) diagnostic.
This was technically also an issue before but since we only emitted
diagnostics when they changed and we alternate between two states it
worked fine. The way we implement debouncing means that we can now
also end up emitting two consecutive diagnostics changes for the same
set of diagnostics which made this test flaky.
Previously, we emitted diagnostics notifications as soon as we got
them. This resulted in a lot of flickering due to diagnostics getting
cleared briefly when typing only to immediately reappear.
Now, we buffer them for 0.1s so that a new event restoring the
same diagnostics for a slightly modified file will overwrite the
initial clear of diagnostics for the new document version.
* Update rules_haskell and static GHC
Remove patches that have been upstreamed or are no longer required.
Update still required patches to match the new rules_haskell version.
Previously we patched rules_haskell to coerce GHC into using static
Haskell libraries in most places. In particular we moved hs-libraries
entries into extra-libraries entries in the package configuration files.
A much cleaner approach is to compile GHC with a static RTS, then GHC
will by itself choose to load static Haskell libraries.
* Remove haskell_cc_import
* da-hs-daml-cli -> daml-cli
* da-hs-damlc-app -> damlc-app
* Move the span related functionality to one place
* Fuse docHeaders away
* Decouple AtPoint from the rest of the rule database, simplifying the dependencies
* Move the import related functionality to one place
* Move all the closely tied to GHC modules together
* Rename the Logger module
* Push the other module renames through the code base
* Rename Development.IDE.State to Development.IDE.Core
* Rename Functions.Compile to Core.Compile
* Fix up some module names
* Cut down on non-sensicle exports
* Don't worry about setting source - no one uses it
* Reorder the module header
* Give more sensible names to the diagnostic creating functions
* Use more appropriate diagnostic functions
* Simplify the internal diagnostic creations
* Rewrite the diagnostics to go direct, not via GHC error types
* Remove redundant dflags from some functions
* Make sure the warning vs error distinction remains
* Remove unnecessary extensions
* Move IDE stress test to lsp-tests
* Lower timeout.
The test case takes < 3 seconds on my machine. The 180 seconds timeout
seems far too much.
* Data.Text.Extended -> Data.Text
For a cyclic import we actually have to write the files to disks,
otherwise we can end up with an error about the module not existing if
we check imports before the other module has been added to the VFS.
This implements step 1. from #1507 and also adds a test that uses an
insane percent-encoding to verify that we can handle that.
I also tested this in the IDE on Windows and Linux.
Previously we had two layers of indirection:
In the compiler we emitted Event, we then translated this to
ClientNotification which was then translated to
FromServerMessage.
Apart from being confusing and convoluted this also resulted in us
doing the conversion to generic LSP types too late so we had scenario
specific code in places where it shouldn’t be.
This PR removes the indirection and just uses FromServerMessage
directly.
* Add an option to the IDE to disable the scenario service
This is useful for several reasons:
1. We currently have to disable all tests using the scenario service
on Windows since they are extremely flaky due to issues we haven’t
been able to solve so far. This allows us to run at least a subset of
tests on CI.
2. The LSP tests currently start a new instance of damlc for each
test (we might want to revisit this but it seems to be sufficiently
fast so far) and not starting the scenario service allows us to speed
things up a bit.
3. On large projects, this could be useful to avoid having the IDE use
up even more memory and speed things up a bit. However, this PR does
not yet expose this in a convenient way so there is more work to be
done (in separate PRs) to make that a viable option.
* Fix LSP tests on Windows
This needs more work but I’d like to get the initial boilerplate in
first. We will also have to make some changes to lsp-test and expand
it in various ways but those should hopefully be upstreamable.