Skip to content

Commit c212e98

Browse files
committed
Fix error in hls-plugin-api
1 parent a275fa1 commit c212e98

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

.github/workflows/flags.yml

+5
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,16 @@ jobs:
6969
ghc: ${{ matrix.ghc }}
7070
os: ${{ runner.os }}
7171

72+
# The purpose of this job is to ensure that the build works even with flags
73+
# in their non-default settings. Below we:
74+
# - enable flags that are off by default
75+
# - disable flags that are on by default
7276
- name: Configue flags for all components
7377
run: |
7478
cabal configure \
7579
--constraint "hls-graph +embed-files +stm-stats" \
7680
--constraint "ghcide +ekg +executable +test-exe" \
81+
--constraing "hls-plugin-api -use-fingertree"
7782
--constraint "all +pedantic"
7883
cat cabal.project.local
7984

hls-plugin-api/bench/Main.hs

+9-9
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
-- vs RangeMap-based "in-range filtering" approaches
33
module Main (main) where
44

5-
import Control.DeepSeq (force)
6-
import Control.Exception (evaluate)
7-
import Control.Monad (replicateM)
5+
import Control.DeepSeq (force)
6+
import Control.Exception (evaluate)
7+
import Control.Monad (replicateM)
88
import qualified Criterion
99
import qualified Criterion.Main
10-
import Data.Random (RVar)
11-
import qualified Data.Random as Fu
12-
import qualified Ide.Plugin.RangeMap as RangeMap
13-
import Language.LSP.Types (Position (..), Range (..), UInt,
14-
isSubrangeOf)
15-
import qualified System.Random.Stateful as Random
10+
import Data.Random (RVar)
11+
import qualified Data.Random as Fu
12+
import qualified Ide.Plugin.RangeMap as RangeMap
13+
import Language.LSP.Protocol.Types (Position (..), Range (..), UInt,
14+
isSubrangeOf)
15+
import qualified System.Random.Stateful as Random
1616

1717

1818
genRangeList :: Int -> RVar [Range]

hls-plugin-api/hls-plugin-api.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,6 @@ benchmark rangemap-benchmark
142142
, criterion
143143
, deepseq
144144
, hls-plugin-api
145-
, lsp-types
145+
, lsp-test
146146
, random
147147
, random-fu

hls-plugin-api/src/Ide/Plugin/RangeMap.hs

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ module Ide.Plugin.RangeMap
1414
fromList',
1515
filterByRange,
1616
) where
17+
1718
import Development.IDE.Graph.Classes (NFData)
18-
import Language.LSP.Protocol.Types (Range, isSubrangeOf)
1919
#ifdef USE_FINGERTREE
2020
import Data.Bifunctor (first)
2121
import Data.Foldable (foldl')
2222
import qualified HaskellWorks.Data.IntervalMap.FingerTree as IM
2323
import Language.LSP.Protocol.Types (Position,
2424
Range (Range))
25+
#else
26+
import Language.LSP.Protocol.Types (Range, isSubrangeOf)
2527
#endif
2628

2729
-- | A map from code ranges to values.

0 commit comments

Comments
 (0)