Skip to content

Commit

Permalink
Fail intentionally (for telemetry)
Browse files Browse the repository at this point in the history
  • Loading branch information
berberman committed Feb 22, 2021
1 parent eebf6b6 commit 8622380
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Expand Up @@ -9,7 +9,7 @@ jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
fail-fast: false # TODO
matrix:
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"]
os: [ubuntu-latest, macOS-latest]
Expand Down
11 changes: 9 additions & 2 deletions plugins/default/src/Ide/Plugin/Pragmas.hs
Expand Up @@ -2,6 +2,7 @@
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE CPP #-}

-- | Provides code actions to add missing pragmas (whenever GHC suggests to)
module Ide.Plugin.Pragmas (descriptor) where
Expand All @@ -23,7 +24,12 @@ import qualified Language.LSP.Types as J
import qualified Language.LSP.Types.Lens as J
import qualified Language.LSP.VFS as VFS
import qualified Text.Fuzzy as Fuzzy

#if __GLASGOW_HASKELL__ < 810
import HsDumpAst
#else
import GHC.Hs.Dump
#endif
import Data.Bifunctor (second)
-- ---------------------------------------------------------------------

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

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

0 comments on commit 8622380

Please sign in to comment.