haskell-language-server/test
jinser 763f34cb1e
Provide explicit import in inlay hints (#4235)
* Provide explicit import in inlay hints

* Filter explict imports inlay hints by visible range

* Update lsp dep by source-repository-package

to writing test before new release of haskell/lsp.

* Add test for hls-explicit-imports-plugin inlay hints

* Comment inlay hints start position

* Use `isSubrangeOf` to test if the range is visible

* Remove inlayHintsResolveProvider placeholder for now

* Use explicit InlayHintKind_Type

* Revert "Update lsp dep by source-repository-package"

This reverts commit 245049a580.

* Combine InlayHints by sconcat them

and remove `instance PluginRequestMethod Method_InlayHintResolve`
since have not decide how to combine.

* compress multiple spaces in abbr import tilte

* update test to match inlay hints kind

* rename squashedAbbreviateImportTitle to abbreviateImportTitleWithoutModule

* Request inlay hints with testEdits

* ExplicitImports fallback to codelens when inlay hints not support

* fix explicitImports inlayHints test

* simplify isInlayHintsSupported

* comment fallback

* empty list instead of null codeLens

* clearify name `paddingLeft`

* fix clientCapabilities

* add test for inlay hints without its client caps

* use codeActionNoInlayHintsCaps to avoid error

* simplify isInlayHintSupported

* comment about paddingLeft

* use null as inlay hints kind

* add tooltip for explicit imports inlay hints to improve UX

* chore comments

* refactor

* comment InL [] to indicate no info

* ignore refine inlay hints

* add plcInlayHintsOn config

* update func-test

* keep order to make Parser works

* always provide refine in code lens

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-07-09 14:58:37 +00:00
..
functional Cleanup imports after CPP removal + few hlint fixes (#4337) 2024-06-27 06:38:22 +02:00
testdata Provide explicit import in inlay hints (#4235) 2024-07-09 14:58:37 +00:00
utils/Test/Hls Another attempt at using the lsp API for some progress reporting (#4218) 2024-05-19 16:06:38 +01:00
wrapper Cleanup CI configs and cabal files 2024-06-20 09:03:31 +01:00
README.md Cleanup func-test suite (#3828) 2023-10-09 13:04:34 +00:00

The func-test test suite.

This is the integration test suite for cross-plugin and cross-package features.

Add integration tests to func-test only if they satisfy one or more of the following conditions:

  • It tests the interaction between more than one plugin.
    • For example, plugin A provides a Diagnostic that plugin B requires to provide a CodeAction.
    • However, it is also valid, and often preferable, to depend on the required plugin directly in plugin B's test suite.
  • It tests HLS specific LSP code.
    • For example, we test that config changes are appropriately propagated.
      • Note, this is slightly debatable, since the test could also be part of ghcide.
    • Non HLS specific LSP code may exist in HLS temporarily, but any LSP extensions should be upstreamed to lsp.
  • It tests features of the haskell-language-server-wrapper executable.
    • For example, argument parsing.
  • It tests features of the haskell-language-server executable.
    • For example, argument parsing.
  • It tests features provided by hls-plugin-api that require an integration test (i.e. a unit test doesn't suffice).
    • Example: Testing the Logger setup.

If you think that a test that currently lives in func-test does not meet the conditions above, open a ticket for discussion or try to move the test to a better location.

Note: func-test is a historical test suite. It was originally written for Haskell IDE Engine, which was merged with the ghcide project. The integration test-suite func-test (back then unit-test existed as well) was used to test all kinds of features provided by Haskell IDE Engine (HIE). When ghcide and HIE merged together, the integration test suite was vastly copied. HLS moved to a plugin-based architecture, which mainly entails that plugin tests are isolated in the respective plugin's test suite. Over time, func-test started to bit rot and wasn't maintained properly any more, since all new tests were added to the plugin or ghcide test suites.