Skip to content

Commit 5d56aa7

Browse files
fix typos (#3325)
Co-authored-by: Michael Peyton Jones <[email protected]>
1 parent 7c0201b commit 5d56aa7

File tree

50 files changed

+126
-126
lines changed

Some content is hidden

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

50 files changed

+126
-126
lines changed

docs/troubleshooting.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,5 +206,5 @@ This returns an error in HLS if `tasty-discover` is not in the path: `could not
206206

207207
Due to some limitations in the interaction between HLS and `stack`, there are [issues](https://github.com/haskell/haskell-language-server/issues/366) in projects with multiple components (i.e. a main library and executables, test suites or benchmarks):
208208

209-
- The project has to be built succesfully *before* loading it with HLS to get components other than the library work.
209+
- The project has to be built successfully *before* loading it with HLS to get components other than the library work.
210210
- Changes in the library are not automatically propagated to other components, especially in the presence of errors in the library. So you have to restart HLS in order for those components to be loaded correctly. The usual symptom is the editor showing errors like `Could not load module ...` or `Cannot satisfy -package ...`.

ghcide-bench/exe/Main.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
number of iterations. There is ample room for improvement:
2121
- Statistical analysis to detect outliers and auto infer the number of iterations needed
2222
- GC stats analysis (currently -S is printed as part of the experiment)
23-
- Analyisis of performance over the commit history of the project
23+
- Analysis of performance over the commit history of the project
2424
2525
How to run:
2626
1. `cabal exec cabal run ghcide-bench -- -- ghcide-bench-options`

ghcide/CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* Progress reporting improvements (#1784) - Pepe Iborra
44
* Unify session loading using implicit-hie (#1783) - fendor
55
* Fix remove constraint (#1578) - Kostas Dermentzis
6-
* Fix wrong extend import while type constuctor and data constructor have the same name (#1775) - Lei Zhu
7-
* Imporve vscode extension schema generation (#1742) - Potato Hatsue
6+
* Fix wrong extend import while type constructor and data constructor have the same name (#1775) - Lei Zhu
7+
* Improve vscode extension schema generation (#1742) - Potato Hatsue
88
* Add hls-graph abstracting over shake (#1748) - Neil Mitchell
99
* Tease apart the custom SYB from ExactPrint (#1746) - Sandy Maguire
1010
* fix class method completion (#1741) - Lei Zhu

ghcide/session-loader/Development/IDE/Session.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ runWithDb recorder fp k = do
362362

363363
withHieDb fp $ \writedb -> do
364364
-- the type signature is necessary to avoid concretizing the tyvar
365-
-- e.g. `withWriteDbRetrable initConn` without type signature will
365+
-- e.g. `withWriteDbRetryable initConn` without type signature will
366366
-- instantiate tyvar `a` to `()`
367367
let withWriteDbRetryable :: WithHieDb
368368
withWriteDbRetryable = makeWithHieDbRetryable recorder rng writedb

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

+13-13
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@ typecheckModule (IdeDefer defer) hsc tc_helpers pm = do
187187
tcRnModule session tc_helpers $ demoteIfDefer pm{pm_mod_summary = mod_summary''}
188188
let errorPipeline = unDefer . hideDiag dflags . tagDiag
189189
diags = map errorPipeline warnings
190-
deferedError = any fst diags
190+
deferredError = any fst diags
191191
case etcm of
192192
Left errs -> return (map snd diags ++ errs, Nothing)
193-
Right tcm -> return (map snd diags, Just $ tcm{tmrDeferedError = deferedError})
193+
Right tcm -> return (map snd diags, Just $ tcm{tmrDeferredError = deferredError})
194194
where
195195
demoteIfDefer = if defer then demoteTypeErrorsToWarnings else id
196196

@@ -494,7 +494,7 @@ mkHiFileResultCompile se session' tcm simplified_guts = catchErrs $ do
494494
writeBinCoreFile fp core_file
495495
-- We want to drop references to guts and read in a serialized, compact version
496496
-- of the core file from disk (as it is deserialised lazily)
497-
-- This is because we don't want to keep the guts in memeory for every file in
497+
-- This is because we don't want to keep the guts in memory for every file in
498498
-- the project as it becomes prohibitively expensive
499499
-- The serialized file however is much more compact and only requires a few
500500
-- hundred megabytes of memory total even in a large project with 1000s of
@@ -503,7 +503,7 @@ mkHiFileResultCompile se session' tcm simplified_guts = catchErrs $ do
503503
pure $ assert (core_hash1 == core_hash2)
504504
$ Just (core_file, fingerprintToBS core_hash2)
505505

506-
-- Verify core file by rountrip testing and comparison
506+
-- Verify core file by roundtrip testing and comparison
507507
IdeOptions{optVerifyCoreFile} <- getIdeOptionsIO se
508508
case core_file of
509509
Just (core, _) | optVerifyCoreFile -> do
@@ -773,7 +773,7 @@ generateHieAsts hscEnv tcm =
773773
-- These varBinds use unitDataConId but it could be anything as the id name is not used
774774
-- during the hie file generation process. It's a workaround for the fact that the hie modules
775775
-- don't export an interface which allows for additional information to be added to hie files.
776-
let fake_splice_binds = Util.listToBag (map (mkVarBind unitDataConId) (spliceExpresions $ tmrTopLevelSplices tcm))
776+
let fake_splice_binds = Util.listToBag (map (mkVarBind unitDataConId) (spliceExpressions $ tmrTopLevelSplices tcm))
777777
real_binds = tcg_binds $ tmrTypechecked tcm
778778
#if MIN_VERSION_ghc(9,0,1)
779779
ts = tmrTypechecked tcm :: TcGblEnv
@@ -801,8 +801,8 @@ generateHieAsts hscEnv tcm =
801801
#endif
802802
#endif
803803

804-
spliceExpresions :: Splices -> [LHsExpr GhcTc]
805-
spliceExpresions Splices{..} =
804+
spliceExpressions :: Splices -> [LHsExpr GhcTc]
805+
spliceExpressions Splices{..} =
806806
DL.toList $ mconcat
807807
[ DL.fromList $ map fst exprSplices
808808
, DL.fromList $ map fst patSplices
@@ -812,7 +812,7 @@ spliceExpresions Splices{..} =
812812
]
813813

814814
-- | In addition to indexing the `.hie` file, this function is responsible for
815-
-- maintaining the 'IndexQueue' state and notfiying the user about indexing
815+
-- maintaining the 'IndexQueue' state and notifying the user about indexing
816816
-- progress.
817817
--
818818
-- We maintain a record of all pending index operations in the 'indexPending'
@@ -1409,7 +1409,7 @@ instance NFData IdeLinkable where
14091409
ml_core_file :: ModLocation -> FilePath
14101410
ml_core_file ml = ml_hi_file ml <.> "core"
14111411

1412-
-- | Retuns an up-to-date module interface, regenerating if needed.
1412+
-- | Returns an up-to-date module interface, regenerating if needed.
14131413
-- Assumes file exists.
14141414
-- Requires the 'HscEnv' to be set up with dependencies
14151415
-- See Note [Recompilation avoidance in the presence of TH]
@@ -1437,7 +1437,7 @@ loadInterface session ms linkableNeeded RecompilationInfo{..} = do
14371437
-- The source is modified if it is newer than the destination (iface file)
14381438
-- A more precise check for the core file is performed later
14391439
let sourceMod = case mb_dest_version of
1440-
Nothing -> SourceModified -- desitination file doesn't exist, assume modified source
1440+
Nothing -> SourceModified -- destination file doesn't exist, assume modified source
14411441
Just dest_version
14421442
| source_version <= dest_version -> SourceUnmodified
14431443
| otherwise -> SourceModified
@@ -1466,7 +1466,7 @@ loadInterface session ms linkableNeeded RecompilationInfo{..} = do
14661466
Just (old_hir, _)
14671467
| isNothing linkableNeeded || isJust (hirCoreFp old_hir)
14681468
-> do
1469-
-- Peform the fine grained recompilation check for TH
1469+
-- Perform the fine grained recompilation check for TH
14701470
maybe_recomp <- checkLinkableDependencies get_linkable_hashes (hsc_mod_graph sessionWithMsDynFlags) (hirRuntimeModules old_hir)
14711471
case maybe_recomp of
14721472
Just msg -> do_regenerate msg
@@ -1478,7 +1478,7 @@ loadInterface session ms linkableNeeded RecompilationInfo{..} = do
14781478
let runtime_deps
14791479
| not (mi_used_th iface) = emptyModuleEnv
14801480
| otherwise = parseRuntimeDeps (md_anns details)
1481-
-- Peform the fine grained recompilation check for TH
1481+
-- Perform the fine grained recompilation check for TH
14821482
maybe_recomp <- checkLinkableDependencies get_linkable_hashes (hsc_mod_graph sessionWithMsDynFlags) runtime_deps
14831483
case maybe_recomp of
14841484
Just msg -> do_regenerate msg
@@ -1598,7 +1598,7 @@ coreFileToLinkable linkableType session ms iface details core_file t = do
15981598
--- and leads to fun errors like "Cannot continue after interface file error".
15991599
getDocsBatch
16001600
:: HscEnv
1601-
-> Module -- ^ a moudle where the names are in scope
1601+
-> Module -- ^ a module where the names are in scope
16021602
-> [Name]
16031603
#if MIN_VERSION_ghc(9,3,0)
16041604
-> IO [Either String (Maybe [HsDoc GhcRn], IntMap (HsDoc GhcRn))]

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ data TcModuleResult = TcModuleResult
155155
, tmrTypechecked :: TcGblEnv
156156
, tmrTopLevelSplices :: Splices
157157
-- ^ Typechecked splice information
158-
, tmrDeferedError :: !Bool
158+
, tmrDeferredError :: !Bool
159159
-- ^ Did we defer any type errors for this module?
160160
, tmrRuntimeModules :: !(ModuleEnv ByteString)
161161
-- ^ Which modules did we need at runtime while compiling this file?

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ ghcSessionDepsDefinition fullModSummary GhcSessionDepsConfig{..} env file = do
782782
let inLoadOrder = map (\HiFileResult{..} -> HomeModInfo hirModIface hirModDetails Nothing) ifaces
783783
#if MIN_VERSION_ghc(9,3,0)
784784
-- On GHC 9.4+, the module graph contains not only ModSummary's but each `ModuleNode` in the graph
785-
-- also points to all the direct descendents of the current module. To get the keys for the descendents
785+
-- also points to all the direct descendants of the current module. To get the keys for the descendants
786786
-- we must get their `ModSummary`s
787787
!final_deps <- do
788788
dep_mss <- map msrModSummary <$> uses_ GetModSummaryWithoutTimestamps deps
@@ -950,7 +950,7 @@ getModIfaceRule recorder = defineEarlyCutoff (cmapWithPrio LogShake recorder) $
950950
hiDiags <- case hiFile of
951951
Just hiFile
952952
| OnDisk <- status
953-
, not (tmrDeferedError tmr) -> liftIO $ writeHiFile se hsc hiFile
953+
, not (tmrDeferredError tmr) -> liftIO $ writeHiFile se hsc hiFile
954954
_ -> pure []
955955
return (fp, (diags++hiDiags, hiFile))
956956
NotFOI -> do
@@ -1022,9 +1022,9 @@ regenerateHiFile sess f ms compNeeded = do
10221022
wDiags <- forM masts $ \asts ->
10231023
liftIO $ writeAndIndexHieFile hsc se (tmrModSummary tmr) f (tcg_exports $ tmrTypechecked tmr) asts source
10241024

1025-
-- We don't write the `.hi` file if there are defered errors, since we won't get
1025+
-- We don't write the `.hi` file if there are deferred errors, since we won't get
10261026
-- accurate diagnostics next time if we do
1027-
hiDiags <- if not $ tmrDeferedError tmr
1027+
hiDiags <- if not $ tmrDeferredError tmr
10281028
then liftIO $ writeHiFile se hsc hiFile
10291029
else pure []
10301030

@@ -1057,7 +1057,7 @@ getClientSettingsRule recorder = defineEarlyCutOffNoFile (cmapWithPrio LogShake
10571057
settings <- clientSettings <$> getIdeConfiguration
10581058
return (LBS.toStrict $ B.encode $ hash settings, settings)
10591059

1060-
-- | Returns the client configurarion stored in the IdeState.
1060+
-- | Returns the client configuration stored in the IdeState.
10611061
-- You can use this function to access it from shake Rules
10621062
getClientConfigAction :: Config -- ^ default value
10631063
-> Action Config

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ data ShakeExtras = ShakeExtras
256256
-- ^ Map from a text document version to a PositionMapping that describes how to map
257257
-- positions in a version of that document to positions in the latest version
258258
-- First mapping is delta from previous version and second one is an
259-
-- accumlation of all previous mappings.
259+
-- accumulation of all previous mappings.
260260
,progress :: ProgressReporting
261261
,ideTesting :: IdeTesting
262262
-- ^ Whether to enable additional lsp messages used by the test suite for checking invariants
@@ -280,12 +280,12 @@ data ShakeExtras = ShakeExtras
280280
, withHieDb :: WithHieDb -- ^ Use only to read.
281281
, hiedbWriter :: HieDbWriter -- ^ use to write
282282
, persistentKeys :: TVar (KeyMap GetStalePersistent)
283-
-- ^ Registery for functions that compute/get "stale" results for the rule
283+
-- ^ Registry for functions that compute/get "stale" results for the rule
284284
-- (possibly from disk)
285285
, vfsVar :: TVar VFS
286286
-- ^ A snapshot of the current state of the virtual file system. Updated on shakeRestart
287287
-- VFS state is managed by LSP. However, the state according to the lsp library may be newer than the state of the current session,
288-
-- leaving us vulnerable to suble race conditions. To avoid this, we take a snapshot of the state of the VFS on every
288+
-- leaving us vulnerable to subtle race conditions. To avoid this, we take a snapshot of the state of the VFS on every
289289
-- restart, so that the whole session sees a single consistent view of the VFS.
290290
-- We don't need a STM.Map because we never update individual keys ourselves.
291291
, defaultConfig :: Config
@@ -662,7 +662,7 @@ getStateKeys = (fmap.fmap) fst . atomically . ListT.toList . STM.listT . state
662662
-- | Must be called in the 'Initialized' handler and only once
663663
shakeSessionInit :: Recorder (WithPriority Log) -> IdeState -> IO ()
664664
shakeSessionInit recorder ide@IdeState{..} = do
665-
-- Take a snapshot of the VFS - it should be empty as we've recieved no notifications
665+
-- Take a snapshot of the VFS - it should be empty as we've received no notifications
666666
-- till now, but it can't hurt to be in sync with the `lsp` library.
667667
vfs <- vfsSnapshot (lspEnv shakeExtras)
668668
initSession <- newSession recorder shakeExtras (VFSModified vfs) shakeDb [] "shakeSessionInit"
@@ -831,7 +831,7 @@ instantiateDelayedAction (DelayedAction _ s p a) = do
831831
b <- newBarrier
832832
let a' = do
833833
-- work gets reenqueued when the Shake session is restarted
834-
-- it can happen that a work item finished just as it was reenqueud
834+
-- it can happen that a work item finished just as it was reenqueued
835835
-- in that case, skipping the work is fine
836836
alreadyDone <- liftIO $ isJust <$> waitBarrierMaybe b
837837
unless alreadyDone $ do

ghcide/src/Development/IDE/GHC/Compat/CPP.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
-- Copied from https://github.com/ghc/ghc/blob/master/compiler/main/DriverPipeline.hs on 14 May 2019
55
-- Requested to be exposed at https://gitlab.haskell.org/ghc/ghc/merge_requests/944.
6-
-- Update the above MR got merged to master on 31 May 2019. When it becomes avialable to ghc-lib, this file can be removed.
6+
-- Update the above MR got merged to master on 31 May 2019. When it becomes available to ghc-lib, this file can be removed.
77

88
{- HLINT ignore -} -- since copied from upstream
99

ghcide/src/Development/IDE/GHC/Compat/Parser.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{-# LANGUAGE PatternSynonyms #-}
33
{-# HLINT ignore "Unused LANGUAGE pragma" #-}
44

5-
-- | Parser compaibility module.
5+
-- | Parser compatibility module.
66
module Development.IDE.GHC.Compat.Parser (
77
initParserOpts,
88
initParserState,

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ notFoundErr env modName reason =
183183
mkError' = diagFromString "not found" DsError (Compat.getLoc modName)
184184
modName0 = unLoc modName
185185
ppr' = showSDoc dfs
186-
-- We convert the lookup result to a find result to reuse GHC's cannotFindMoudle pretty printer.
186+
-- We convert the lookup result to a find result to reuse GHC's cannotFindModule pretty printer.
187187
lookupToFindResult =
188188
\case
189189
LookupFound _m _pkgConfig ->

ghcide/src/Development/IDE/Main/HeapStats.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ heapStatsThread l = forever $ do
5959
threadDelay heapStatsInterval
6060
logHeapStats l
6161

62-
-- | A helper function which lauches the 'heapStatsThread' and kills it
63-
-- appropiately when the inner action finishes. It also checks to see
62+
-- | A helper function which launches the 'heapStatsThread' and kills it
63+
-- appropriately when the inner action finishes. It also checks to see
6464
-- if `-T` is enabled.
6565
withHeapStats :: Recorder (WithPriority Log) -> IO r -> IO r
6666
withHeapStats l k = do

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ produceCompletions recorder = do
8080
_ -> return ([], Nothing)
8181
define (cmapWithPrio LogShake recorder) $ \NonLocalCompletions file -> do
8282
-- For non local completions we avoid depending on the parsed module,
83-
-- synthetizing a fake module with an empty body from the buffer
83+
-- synthesizing a fake module with an empty body from the buffer
8484
-- in the ModSummary, which preserves all the imports
8585
ms <- fmap fst <$> useWithStale GetModSummaryWithoutTimestamps file
8686
sess <- fmap fst <$> useWithStale GhcSessionDeps file

ghcide/src/Development/IDE/Plugin/Completions/Logic.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -366,11 +366,11 @@ cacheDataProducer uri env curMod globalEnv inScopeEnv limports = do
366366
asNamespace :: ImportDecl GhcPs -> ModuleName
367367
asNamespace imp = maybe (iDeclToModName imp) GHC.unLoc (ideclAs imp)
368368
-- Full canonical names of imported modules
369-
importDeclerations = map unLoc limports
369+
importDeclarations = map unLoc limports
370370

371371

372372
-- The given namespaces for the imported modules (ie. full name, or alias if used)
373-
allModNamesAsNS = map (showModName . asNamespace) importDeclerations
373+
allModNamesAsNS = map (showModName . asNamespace) importDeclarations
374374

375375
rdrElts = globalRdrEnvElts globalEnv
376376

ghcide/src/Development/IDE/Spans/Documentation.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ getDocumentation
128128
-- TODO : Build a version of GHC exactprint to extract this information
129129
-- more accurately.
130130
-- TODO : Implement this for GHC 9.2 with in-tree annotations
131-
-- (alternatively, just remove it and rely soley on GHC's parsing)
131+
-- (alternatively, just remove it and rely solely on GHC's parsing)
132132
getDocumentation sources targetName = fromMaybe [] $ do
133133
#if MIN_VERSION_ghc(9,2,0)
134134
Nothing
@@ -137,7 +137,7 @@ getDocumentation sources targetName = fromMaybe [] $ do
137137
targetNameSpan <- realSpan $ getLoc targetName
138138
tc <-
139139
find ((==) (Just $ srcSpanFile targetNameSpan) . annotationFileName)
140-
$ reverse sources -- TODO : Is reversing the list here really neccessary?
140+
$ reverse sources -- TODO : Is reversing the list here really necessary?
141141

142142
-- Top level names bound by the module
143143
let bs = [ n | let L _ HsModule{hsmodDecls} = pm_parsed_source tc

ghcide/test/exe/Main.hs

+5-5
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ diagnosticTests = testGroup "diagnostics"
593593
[ ( "Foo.hs"
594594
-- The test is to make sure that warnings contain unqualified names
595595
-- where appropriate. The warning should use an unqualified name 'Ord', not
596-
-- sometihng like 'GHC.Classes.Ord'. The choice of redundant-constraints to
596+
-- something like 'GHC.Classes.Ord'. The choice of redundant-constraints to
597597
-- test this is fairly arbitrary.
598598
, [(DsWarning, (2, if ghcVersion >= GHC94 then 7 else 0), "Redundant constraint: Ord a")
599599
]
@@ -2593,7 +2593,7 @@ simpleMultiTest3 =
25932593
checkDefs locs (pure [fooL])
25942594
expectNoMoreDiagnostics 0.5
25952595

2596-
-- Like simpleMultiTest but open the files in component 'a' in a seperate session
2596+
-- Like simpleMultiTest but open the files in component 'a' in a separate session
25972597
simpleMultiDefTest :: TestTree
25982598
simpleMultiDefTest = testCase "simple-multi-def-test" $ runWithExtraFiles "multi" $ \dir -> do
25992599
let aPath = dir </> "a/A.hs"
@@ -2670,7 +2670,7 @@ ifaceTHTest = testCase "iface-th-test" $ runWithExtraFiles "TH" $ \dir -> do
26702670
-- Change [TH]a from () to Bool
26712671
liftIO $ writeFileUTF8 aPath (unlines $ init (lines $ T.unpack aSource) ++ ["th_a = [d| a = False|]"])
26722672

2673-
-- Check that the change propogates to C
2673+
-- Check that the change propagates to C
26742674
changeDoc cdoc [TextDocumentContentChangeEvent Nothing Nothing cSource]
26752675
expectDiagnostics
26762676
[("THC.hs", [(DsError, (4, 4), "Couldn't match expected type '()' with actual type 'Bool'")])
@@ -2694,11 +2694,11 @@ ifaceErrorTest = testCase "iface-error-test-1" $ runWithExtraFiles "recomp" $ \d
26942694

26952695
-- Change y from Int to B
26962696
changeDoc bdoc [TextDocumentContentChangeEvent Nothing Nothing $ T.unlines ["module B where", "y :: Bool", "y = undefined"]]
2697-
-- save so that we can that the error propogates to A
2697+
-- save so that we can that the error propagates to A
26982698
sendNotification STextDocumentDidSave (DidSaveTextDocumentParams bdoc Nothing)
26992699

27002700

2701-
-- Check that the error propogates to A
2701+
-- Check that the error propagates to A
27022702
expectDiagnostics
27032703
[("A.hs", [(DsError, (5, 4), "Couldn't match expected type 'Int' with actual type 'Bool'")])]
27042704

0 commit comments

Comments
 (0)