Skip to content

Plugin tutorial, more changes #4570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,12 @@ jobs:
name: Test hls-notes-plugin test suite
run: cabal test hls-notes-plugin-tests || cabal test hls-notes-plugin-tests

# The plugin tutorial is only compatible with 9.6 and 9.8.
# No particular reason, just to avoid excessive CPP.
- if: matrix.test && matrix.ghc != '9.4' && matrix.ghc != '9.10' && matrix.ghc != '9.12'
name: Compile the plugin-tutorial
run: cabal build plugin-tutorial

test_post_job:
if: always()
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions docs/contributing/plugin-tutorial.lhs
520 changes: 272 additions & 248 deletions docs/contributing/plugin-tutorial.md

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ghcide/src/Development/IDE/GHC/Compat/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@
SrcLoc.noSrcSpan,
SrcLoc.noSrcLoc,
SrcLoc.noLoc,
SrcLoc.srcSpanToRealSrcSpan,
mapLoc,
-- * Finder
FindResult(..),
Expand Down Expand Up @@ -488,8 +489,8 @@
moduleUnit, toUnitId)
import qualified GHC.Unit.Module as Module
import GHC.Unit.State (ModuleOrigin (..))
import GHC.Utils.Error (Severity (..), emptyMessages)

Check warning on line 492 in ghcide/src/Development/IDE/GHC/Compat/Core.hs

View workflow job for this annotation

GitHub Actions / Hlint check run

Warning in module Development.IDE.GHC.Compat.Core: Use fewer imports ▫︎ Found: "import GHC.Utils.Error ( Severity(..), emptyMessages )\nimport GHC.Utils.Error ( mkPlainErrorMsgEnvelope )\n" ▫︎ Perhaps: "import GHC.Utils.Error\n ( Severity(..), emptyMessages, mkPlainErrorMsgEnvelope )\n"
import GHC.Utils.Panic hiding (try)

Check warning on line 493 in ghcide/src/Development/IDE/GHC/Compat/Core.hs

View workflow job for this annotation

GitHub Actions / Hlint check run

Warning in module Development.IDE.GHC.Compat.Core: Use fewer imports ▫︎ Found: "import GHC.Utils.Panic hiding ( try )\nimport GHC.Utils.Panic\n" ▫︎ Perhaps: "import GHC.Utils.Panic\n"
import qualified GHC.Utils.Panic.Plain as Plain


Expand Down
25 changes: 25 additions & 0 deletions haskell-language-server.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -2265,3 +2265,28 @@ test-suite ghcide-bench-test
OverloadedStrings
RecordWildCards
ViewPatterns

executable plugin-tutorial
import: defaults
-- The plugin tutorial is only compatible with 9.6 and 9.8.
-- No particular reason, just to avoid excessive CPP.
if (impl(ghc >= 9.6) && impl(ghc < 9.10))
buildable: True
else
buildable: False
ghc-options: -pgmL markdown-unlit
main-is: docs/contributing/plugin-tutorial.lhs
build-tool-depends: markdown-unlit:markdown-unlit
build-depends:
base,
ghcide,
hls-plugin-api,
aeson,
lsp,
lsp-types,
markdown-unlit,
text,
unordered-containers,
containers,
transformers,
ghc,
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,13 @@ import GHC (AddEpAnn (Ad
EpaLocation,
EpaLocation' (..),
HasLoc (..))
import GHC.Types.SrcLoc (srcSpanToRealSrcSpan)
#endif
#if MIN_VERSION_ghc(9,11,0)
import GHC (EpaLocation,
AnnsModule (am_where),
EpaLocation' (..),
HasLoc (..),
EpToken (..))
import GHC.Types.SrcLoc (srcSpanToRealSrcSpan)
#endif


Expand Down
Loading