Skip to content

Commit 8622380

Browse files
committed
Fail intentionally (for telemetry)
1 parent eebf6b6 commit 8622380

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
test:
1010
runs-on: ${{ matrix.os }}
1111
strategy:
12-
fail-fast: true
12+
fail-fast: false # TODO
1313
matrix:
1414
ghc: ["8.10.4", "8.10.3", "8.10.2", "8.8.4", "8.8.3", "8.8.2", "8.6.5", "8.6.4"]
1515
os: [ubuntu-latest, macOS-latest]

plugins/default/src/Ide/Plugin/Pragmas.hs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{-# LANGUAGE NamedFieldPuns #-}
33
{-# LANGUAGE OverloadedStrings #-}
44
{-# LANGUAGE ViewPatterns #-}
5+
{-# LANGUAGE CPP #-}
56

67
-- | Provides code actions to add missing pragmas (whenever GHC suggests to)
78
module Ide.Plugin.Pragmas (descriptor) where
@@ -23,7 +24,12 @@ import qualified Language.LSP.Types as J
2324
import qualified Language.LSP.Types.Lens as J
2425
import qualified Language.LSP.VFS as VFS
2526
import qualified Text.Fuzzy as Fuzzy
26-
27+
#if __GLASGOW_HASKELL__ < 810
28+
import HsDumpAst
29+
#else
30+
import GHC.Hs.Dump
31+
#endif
32+
import Data.Bifunctor (second)
2733
-- ---------------------------------------------------------------------
2834

2935
descriptor :: PluginId -> PluginDescriptor IdeState
@@ -48,7 +54,8 @@ codeActionProvider state _plId (CodeActionParams _ _ docId _ (J.CodeActionContex
4854
let dflags = ms_hspp_opts . pm_mod_summary <$> pm
4955
insertRange = maybe (Range (Position 0 0) (Position 0 0)) endOfModuleHeader pm
5056
pedits = nubOrdOn snd . concat $ suggest dflags <$> diags
51-
return $ Right $ List $ pragmaEditToAction uri insertRange <$> pedits
57+
printed = maybe "No parse!" (unsafePrintSDoc . showAstData NoBlankSrcSpan . pm_parsed_source) pm
58+
return $ Right $ List $ pragmaEditToAction uri insertRange <$> (second (const $ LangExt $ T.pack printed) <$> pedits) -- TODO
5259

5360
-- | Add a Pragma to the given URI at the top of the file.
5461
-- It is assumed that the pragma name is a valid pragma,

0 commit comments

Comments
 (0)