Skip to content

Commit 5aa2569

Browse files
authored
Merge branch 'master' into custom-unit-id
2 parents 76ea473 + 2749371 commit 5aa2569

File tree

78 files changed

+239
-142
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+239
-142
lines changed

ChangeLog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ Among others,
2020

2121
### Pull requests merged for 1.0.0
2222

23+
- Correctly split non-varpats in tactics
24+
([#1427](https://github.com/haskell/haskell-language-server/pull/1427)) by @isovector
25+
- Move tactics tests to be standalone
26+
([#1425](https://github.com/haskell/haskell-language-server/pull/1425)) by @isovector
2327
- Fix the handling of default HLS config again
2428
([#1419](https://github.com/haskell/haskell-language-server/pull/1419)) by @pepeiborra
2529
- Patch pre-commit-hook to work with GHCIDE/hls-plugin-api codes
@@ -38,6 +42,8 @@ Among others,
3842
([#1406](https://github.com/haskell/haskell-language-server/pull/1406)) by @fendor
3943
- Update to hie-bios 0.7.4
4044
([#1405](https://github.com/haskell/haskell-language-server/pull/1405)) by @fendor
45+
- Prepare 1.0.0 release
46+
([#1402](https://github.com/haskell/haskell-language-server/pull/1402)) by @Ailrun
4147
- Fix install script after hlint fixes
4248
([#1400](https://github.com/haskell/haskell-language-server/pull/1400)) by @jhrcek
4349
- Use last with-utf8 to fix #1372

ghcide/src/Development/IDE/Core/RuleTypes.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ type instance RuleResult GetModIfaceWithoutLinkable = HiFileResult
250250
type instance RuleResult GetFileContents = (FileVersion, Maybe Text)
251251

252252
-- The Shake key type for getModificationTime queries
253-
data GetModificationTime = GetModificationTime_
253+
newtype GetModificationTime = GetModificationTime_
254254
{ missingFileDiagnostics :: Bool
255255
-- ^ If false, missing file diagnostics are not reported
256256
}

ghcide/src/Development/IDE/Import/DependencyInformation.hs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,25 +76,29 @@ type FilePathIdSet = IntSet
7676
data PathIdMap = PathIdMap
7777
{ idToPathMap :: !(FilePathIdMap ArtifactsLocation)
7878
, pathToIdMap :: !(HashMap NormalizedFilePath FilePathId)
79+
, nextFreshId :: !Int
7980
}
8081
deriving (Show, Generic)
8182

8283
instance NFData PathIdMap
8384

8485
emptyPathIdMap :: PathIdMap
85-
emptyPathIdMap = PathIdMap IntMap.empty HMS.empty
86+
emptyPathIdMap = PathIdMap IntMap.empty HMS.empty 0
8687

8788
getPathId :: ArtifactsLocation -> PathIdMap -> (FilePathId, PathIdMap)
8889
getPathId path m@PathIdMap{..} =
8990
case HMS.lookup (artifactFilePath path) pathToIdMap of
9091
Nothing ->
91-
let !newId = FilePathId $ HMS.size pathToIdMap
92+
let !newId = FilePathId nextFreshId
9293
in (newId, insertPathId path newId m)
9394
Just id -> (id, m)
94-
95-
insertPathId :: ArtifactsLocation -> FilePathId -> PathIdMap -> PathIdMap
96-
insertPathId path id PathIdMap{..} =
97-
PathIdMap (IntMap.insert (getFilePathId id) path idToPathMap) (HMS.insert (artifactFilePath path) id pathToIdMap)
95+
where
96+
insertPathId :: ArtifactsLocation -> FilePathId -> PathIdMap -> PathIdMap
97+
insertPathId path id PathIdMap{..} =
98+
PathIdMap
99+
(IntMap.insert (getFilePathId id) path idToPathMap)
100+
(HMS.insert (artifactFilePath path) id pathToIdMap)
101+
(succ nextFreshId)
98102

99103
insertImport :: FilePathId -> Either ModuleParseError ModuleImports -> RawDependencyInformation -> RawDependencyInformation
100104
insertImport (FilePathId k) v rawDepInfo = rawDepInfo { rawImports = IntMap.insert k v (rawImports rawDepInfo) }

haskell-language-server.cabal

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,12 +458,9 @@ test-suite func-test
458458
Rename
459459
Symbol
460460
TypeDefinition
461-
Tactic
462461
Splice
463462
HaddockComments
464463
Ide.Plugin.Splice.Types
465-
Ide.Plugin.Tactic.FeatureSet
466-
Ide.Plugin.Tactic.TestTypes
467464
Ide.Plugin.Eval.Types
468465

469466
default-extensions: OverloadedStrings

plugins/hls-tactics-plugin/hls-tactics-plugin.cabal

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,26 +78,64 @@ library
7878
default-language: Haskell2010
7979
default-extensions: DataKinds, TypeOperators
8080

81+
82+
executable test-server
83+
default-language: Haskell2010
84+
build-depends:
85+
, base
86+
, data-default
87+
, ghcide
88+
, hls-tactics-plugin
89+
, hls-plugin-api
90+
, shake
91+
main-is: Server.hs
92+
hs-source-dirs: test
93+
ghc-options:
94+
"-with-rtsopts=-I0 -A128M"
95+
-threaded -Wall -Wno-name-shadowing -Wredundant-constraints
96+
8197
test-suite tests
8298
type: exitcode-stdio-1.0
8399
main-is: Main.hs
84100
other-modules:
85101
AutoTupleSpec
102+
GoldenSpec
86103
UnificationSpec
87104
hs-source-dirs:
88105
test
89106
ghc-options: -Wall -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N
90107
build-depends:
91108
QuickCheck
109+
, aeson
92110
, base
111+
, bytestring
93112
, checkers
113+
, containers
114+
, data-default
115+
, deepseq
116+
, directory
117+
, filepath
118+
, ghc
119+
, ghcide >= 0.7.5.0
120+
, hie-bios
121+
, hls-plugin-api
122+
, hls-tactics-plugin
94123
, hspec
124+
, hspec-expectations
125+
, lens
126+
, lsp-test
127+
, lsp-types
128+
, megaparsec
95129
, mtl
96-
, hls-tactics-plugin
97-
, hls-plugin-api
98-
, hie-bios
99-
, ghc
100-
, containers
101-
build-tool-depends: hspec-discover:hspec-discover
130+
, tasty
131+
, tasty-ant-xml >=1.1.6
132+
, tasty-expected-failure
133+
, tasty-golden
134+
, tasty-hunit
135+
, tasty-rerun
136+
, text
137+
build-tool-depends:
138+
hspec-discover:hspec-discover
139+
, hls-tactics-plugin:test-server -any
102140
default-language: Haskell2010
103141

plugins/hls-tactics-plugin/test/AutoTupleSpec.hs

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,17 @@
22

33
module AutoTupleSpec where
44

5-
import Data.Either (isRight)
6-
import qualified Data.Map as M
7-
import Ide.Plugin.Tactic.Debug
8-
import Ide.Plugin.Tactic.Judgements (mkFirstJudgement)
9-
import Ide.Plugin.Tactic.Machinery
10-
import Ide.Plugin.Tactic.Tactics (auto')
11-
import Ide.Plugin.Tactic.Types
12-
import OccName (mkVarOcc)
13-
import Test.Hspec
14-
import Test.QuickCheck
15-
import Type (mkTyVarTy)
16-
import TysPrim (alphaTyVars)
17-
import TysWiredIn (mkBoxedTupleTy)
18-
19-
20-
instance Show Type where
21-
show = unsafeRender
5+
import Data.Either (isRight)
6+
import Ide.Plugin.Tactic.Judgements (mkFirstJudgement)
7+
import Ide.Plugin.Tactic.Machinery
8+
import Ide.Plugin.Tactic.Tactics (auto')
9+
import Ide.Plugin.Tactic.Types
10+
import OccName (mkVarOcc)
11+
import Test.Hspec
12+
import Test.QuickCheck
13+
import Type (mkTyVarTy)
14+
import TysPrim (alphaTyVars)
15+
import TysWiredIn (mkBoxedTupleTy)
2216

2317

2418
spec :: Spec

0 commit comments

Comments
 (0)