Skip to content

Commit 8264e7c

Browse files
committed
Try changing haskell source files with new workflow structure
1 parent 9910887 commit 8264e7c

File tree

3 files changed

+31
-18
lines changed

3 files changed

+31
-18
lines changed

.github/workflows/pre-commit.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,25 @@ jobs:
99
file-diff:
1010
runs-on: ubuntu-latest
1111
outputs:
12-
changed_files: ${{ env.GIT_DIFF }}
12+
git-diff: ${{ steps.git-diff.outputs.diff }}
1313
steps:
14-
- uses: actions/checkout@v3
15-
- uses: technote-space/[email protected]
16-
with:
17-
PATTERNS: |
18-
+(src|exe|test|ghcide|plugins|hls-plugin-api|hie-compat|hls-graph|hls-test-utils)/**/*.hs
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
- name: Find changed files
17+
uses: technote-space/[email protected]
18+
id: git-diff
19+
with:
20+
PATTERNS: |
21+
+(src|exe|test|ghcide|plugins|hls-plugin-api|hie-compat|hls-graph|hls-test-utils)/**/*.hs
22+
- name: "ECHO changed files"
23+
run: echo env.GIT_DIFF
1924
pre-commit:
2025
runs-on: ubuntu-latest
2126
needs: file-diff
22-
if: needs.file-diff.changed_files
2327
steps:
28+
- name: "ECHO changed files"
29+
run: echo ${{ needs.file-diff.outputs.git-diff }}
30+
- uses: actions/checkout@v3
2431
- uses: ./.github/actions/setup-build
2532
with:
2633
os: ${{ runner.os }}
@@ -51,4 +58,4 @@ jobs:
5158
- uses: actions/setup-python@v4
5259
- uses: pre-commit/[email protected]
5360
with:
54-
extra_args: --files ${{ needs.file-diff.changed_files }}
61+
extra_args: --files ${{ needs.file-diff.output.git-diff }}

ghcide/src/Development/IDE/Plugin/HLS.hs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ module Development.IDE.Plugin.HLS
1010
) where
1111

1212
import Control.Exception (SomeException)
13-
import Control.Lens ((^.))
13+
import Control.Lens ((^.))
1414
import Control.Monad
15-
import qualified Data.Aeson as J
15+
import qualified Data.Aeson as J
1616
import Data.Dependent.Map (DMap)
1717
import qualified Data.Dependent.Map as DMap
1818
import Data.Dependent.Sum
1919
import Data.Either
20-
import qualified Data.List as List
20+
import qualified Data.List as List
2121
import Data.List.NonEmpty (NonEmpty, nonEmpty, toList)
22-
import qualified Data.Map as Map
22+
import qualified Data.Map as Map
2323
import Data.String
2424
import Data.Text (Text)
2525
import qualified Data.Text as T
@@ -133,15 +133,15 @@ executeCommandHandlers recorder ecs = requestHandler SWorkspaceExecuteCommand ex
133133
parseCmdId x = case T.splitOn ":" x of
134134
[plugin, command] -> Just (PluginId plugin, CommandId command)
135135
[_, plugin, command] -> Just (PluginId plugin, CommandId command)
136-
_ -> Nothing
136+
_ -> Nothing
137137

138138
-- The parameters to the HLS command are always the first element
139139

140140
execCmd ide (ExecuteCommandParams _ cmdId args) = do
141141
let cmdParams :: J.Value
142142
cmdParams = case args of
143143
Just (J.List (x:_)) -> x
144-
_ -> J.Null
144+
_ -> J.Null
145145
case parseCmdId cmdId of
146146
-- Shortcut for immediately applying a applyWorkspaceEdit as a fallback for v3.8 code actions
147147
Just ("hls", "fallbackCodeAction") ->
@@ -206,6 +206,7 @@ extensiblePlugins recorder xs = mempty { P.pluginHandlers = handlers }
206206
Nothing -> pure $ Left $ combineErrors errs
207207
Just xs -> do
208208
caps <- LSP.getClientCapabilities
209+
209210
pure $ Right $ combineResponses m config caps params xs
210211

211212
-- ---------------------------------------------------------------------

plugins/hls-alternate-number-format-plugin/src/Ide/Plugin/Literals.hs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module Ide.Plugin.Literals (
88
collectLiterals
99
, Literal(..)
1010
, getSrcText
11+
1112
, getSrcSpan
1213
) where
1314

@@ -16,7 +17,7 @@ import Data.Text (Text)
1617
import qualified Data.Text as T
1718
import Development.IDE.GHC.Compat hiding (getSrcSpan)
1819
import Development.IDE.Graph.Classes (NFData (rnf))
19-
import Generics.SYB (Data, Typeable, everything,
20+
import Generics.SYB (Data, Typeable, everything,
2021
extQ)
2122
import qualified GHC.Generics as GHC
2223

@@ -29,8 +30,12 @@ data Literal = IntLiteral LiteralSrcSpan Text Integer
2930
deriving (GHC.Generic, Show, Ord, Eq, Data)
3031

3132
newtype LiteralSrcSpan = LiteralSrcSpan { unLit :: RealSrcSpan }
33+
3234
deriving (GHC.Generic, Show, Ord, Eq, Data)
3335

36+
37+
38+
3439
instance NFData LiteralSrcSpan where
3540
rnf x = x `seq` ()
3641

@@ -40,14 +45,14 @@ instance NFData Literal
4045
-- | Return a Literal's Source representation
4146
getSrcText :: Literal -> Text
4247
getSrcText = \case
43-
IntLiteral _ txt _ -> txt
48+
IntLiteral _ txt _ -> txt
4449
FracLiteral _ txt _ -> txt
4550

4651
-- | Return a Literal's Real Source location
4752
getSrcSpan :: Literal -> RealSrcSpan
4853
getSrcSpan = \case
49-
IntLiteral ss _ _ -> unLit ss
50-
FracLiteral ss _ _ -> unLit ss
54+
IntLiteral ss _ _ -> unLit ss
55+
FracLiteral ss _ _ -> unLit ss
5156

5257
-- | Find all literals in a Parsed Source File
5358
collectLiterals :: (Data ast, Typeable ast) => ast -> [Literal]

0 commit comments

Comments
 (0)