* Move getFilesOfInterest into the IDE, and OfInterest out into DAML
* Have the IDE mode kick all active files each time
* Add a missing .cabal dependency
* Add a missing dependencies
* Use the right thing, if any files have parse errors, then don't worry
* Print messages to stderr rather than stdout
* Add a big warning that writing to stdout is a bad plan
* Move Definition and Hover over to IDE.LSP
* Copy LanguageServer over to IDE Core, not ideal, but hard to abstract right now
* Warn that there are two copies of a given module
* Move printing out the SDK version out of language-server
This implements part 2 of #1507 and fixes the daml-ghc-test-dev test
suite on Windows (not enabled on CI due to GRPC issues).
I have also tested this in the IDE on Windows and Linux.
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.
* Up-(actually down-)grade to ghc-lib-8.8.0.20190610
* A `#ifndef GHC_STABLE` removed. `ml_hie_file` must be set unconditionally
* Pass Opt_WriteHie in xFlagsSet
* Oops. Revert. This breaks Windows. Very confusing
* Disable test; track in issue https://github.com/digital-asset/daml/issues/1582
* Remove Opt_WriteHie flag (Causes test failures trying to write into a read-only filesystem in CI)
Ironically `managed` didn't turn out to make our code more manageable
and we ended up mostly using it in very isolated places only to then
immediately convert it back to bracket-style functions using `with`.
This PR also removes the use of `managed` from the GcpLogger which was
the only other place where we are using it and it finally kills the
rather silly logic that starting up the scenario service was tied to
having an event logger.
The details are described in a comment but the short story is
that a roundtrip Uri -> FilePath -> Uri necessarily loses information
on which characters were escaped. The long-term solution here is to
avoid this roundtrip altogether but this at least fixes the issue for
now.
* Use haskell-lsp’s builtin VFS in "damlc ide"
haskell-lsp has a builtin VFS that it updates automatically on the
corresponding requests. This PR removes our own VFS implementation and
uses that builtin VFS in "damlc ide". To allow the use of functions
like setBufferModified (we use that heavily in daml-ghc-shake-test-ci)
without having to spawn an LSP server, we also add a fallback where we
spin up our own LSP implementation.
* Upgrade to ghc-lib-0.20190531
* Listen up Wally, Remove redundant commented code!
* Argh! WhattamistakeAtomakeA!
* Whitespace to force Azure pipeline to reconsider ignoring this PR
* Repackage ghc-lib, update SHAs and push again
* Refer to a non-existent release as an experiment
* Put the release number back
* Fix build of haskell-ide-core-public
* Demo program for haskell-ide-core as a library
* Fix all warnings in the Demo file
* Build the IDE demo
* Give a better error message than undefined
* HLint
* Fix copyright header
* Sort the dependencies
* Improve the comment
* Bazel formatting
* Disable building on Windows until ghc-paths is fixed
* Bazel formatting
* Specify the main function
* The PackageDynFlags instances are no longer required because its not a rule result
* Move all the package custom pieces out of the ide-core
* Move the optMbPackageName out to daml-ghc
* Make sure we clean up all temporary files
* Clean up the import list
* Move runGhcFast to its one use site
* Rename the #ifdef for GHC_STABLE
* More CPP required for GHC stable
* Add a compatibility wrapper for HIE functionality which is new in GHC HEAD
* HLint ignores
* Finish the dummy implementations
* Add a bazel build for the ide-core library against GHC
* language: fix: move interface files to a different
This fixes https://github.com/digital-asset/daml/issues/1009. We move
the created interface files and hie files to a hidden directory
".interfaces" when creating a package.
* removing the ifaceDir option and hardcode the dir
* compiler: follow ghc convention and put conf files in package.conf.d dir
We follow the ghc convention and locate all .conf files for the package
database in the `package.conf.d` dir.
* addressed neil's comment
* Implement cross-package goto definition
This is more tricky than one might think at first:
- The interface files do not contain proper source spans so we cannot
use the information in there.
- We could theoretically try to get the source location from the DALFs
but that is the wrong layer and also not an option when we want to
act as a Haskell IDE.
So what we do instead is whenever we write interface files we also
write .hie files and consult those instead when we get useless source
spans otherwise.
* Move optLocateHieFile and optLocateSrcFile to a separate type
* Remove a duplicated comment
* Remove traverse from the convertor
* Move removing typeable to the converter
* Don't reexport getGhcCore
* Move coresForFile to its usage
* Just print out the GHC Core for everything, including internal modules
* Move modIsInternal out of haskell-ide-core
* Move some DynFlags setters over to Config
* Remove an unused orphan instance
* Move the orphans out to a different module
* Move functions for generating import syntax out of haskell-ide-core
* Expose fakeDynFlags as a blob, not the pieces
* Clean up the definition of fakeDynFlags
* Inline showSDocDefault
* HLint
* Fix the comment on IDE.Orphans
* Split the Options into a separate module
* Make the Logger handle live in IO
* Reduce the amount of IDE logging to just two
* Rename CompileOpts to IdeOptions
* Rename PackageState to PackageDynFlags
* Clean up setting the PackageDynFlags
* Stop hiding PackageState, we no longer clash on it
* Introduce a helper for collecting the package flags
* Move the StringBuffer conversion to its only use
* I have no idea now LPat and Pat previously managed to unify...
* Avoid using unRealSrcSpan as its only introduced for GHC 8.8
* Add some CPP to permit compiling with GHC 8.6
* Permit CPP in one more place
* Remove the requirement for Binary on Shake rules (was not used)
* Add a deriving Show on Event, easier for external integrations
* Rename GeneratePackageState to LoadPackageState and move its fields to the rule, rather than the key
* Inline getPackageState away
* Change to passing a ModRenaming to the package loader. Two reasons:
1) When loading non-DAML things we might want to omit the renaming
2) The type ModRenaming has documentation of semantics, unlike [(String, String)]
Before it was garbled and wrong:
Range: Range Start: Position Line: 2Character: 15End: Position Line: 2Character: 15
After it's correct and like it was before:
Range: 3:15-3:17