Skip to content

Commit 1b8a2fa

Browse files
committed
delete commented code, update documentation
1 parent 09af6a4 commit 1b8a2fa

File tree

5 files changed

+11
-16
lines changed

5 files changed

+11
-16
lines changed

plugins/hls-cabal-project-plugin/src/Ide/Plugin/CabalProject.hs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ descriptor recorder plId =
140140
whenUriFile :: Uri -> (NormalizedFilePath -> IO ()) -> IO ()
141141
whenUriFile uri act = whenJust (uriToFilePath uri) $ act . toNormalizedFilePath'
142142

143-
{- | Helper function to restart the shake session, specifically for modifying .cabal files.
143+
{- | Helper function to restart the shake session, specifically for modifying cabal.project files.
144144
No special logic, just group up a bunch of functions you need for the base
145145
Notification Handlers.
146146
@@ -158,9 +158,9 @@ restartCabalShakeSession shakeExtras vfs file actionMsg actionBetweenSession = d
158158

159159
cabalRules :: Recorder (WithPriority Log) -> PluginId -> Rules ()
160160
cabalRules recorder plId = do
161-
-- Make sure we initialise the cabal files-of-interest.
161+
-- Make sure we initialise the cabal project files-of-interest.
162162
ofInterestRules recorder
163-
-- Rule to produce diagnostics for cabal files.
163+
-- Rule to produce diagnostics for cabal project files.
164164
define (cmapWithPrio LogShake recorder) $ \ParseCabalProjectFields file -> do
165165
config <- getPluginConfigAction plId
166166
if not (plcGlobalOn config && plcDiagnosticsOn config)
@@ -210,29 +210,28 @@ cabalRules recorder plId = do
210210
pure (warnDiags, Just projCfg)
211211

212212
action $ do
213-
-- Run the cabal kick. This code always runs when 'shakeRestart' is run.
213+
-- Run the cabal project kick. This code always runs when 'shakeRestart' is run.
214214
-- Must be careful to not impede the performance too much. Crucial to
215215
-- a snappy IDE experience.
216216
kick
217217
where
218218
log' = logWith recorder
219219

220-
{- | This is the kick function for the cabal plugin.
220+
{- | This is the kick function for the cabal project plugin.
221221
We run this action, whenever we shake session us run/restarted, which triggers
222-
actions to produce diagnostics for cabal files.
222+
actions to produce diagnostics for cabal project files.
223223
224224
It is paramount that this kick-function can be run quickly, since it is a blocking
225225
function invocation.
226226
-}
227227
kick :: Action ()
228228
kick = do
229229
files <- HashMap.keys <$> getCabalFilesOfInterestUntracked
230-
-- let keys = map Types.ParseCabalProjectFile files
231230
Shake.runWithSignal (Proxy @"kick/start/cabal-project") (Proxy @"kick/done/cabal-project") files Types.ParseCabalProjectFile
232231

233232

234233
-- ----------------------------------------------------------------
235-
-- Cabal file of Interest rules and global variable
234+
-- Cabal project file of Interest rules and global variable
236235
-- ----------------------------------------------------------------
237236

238237
{- | Cabal files that are currently open in the lsp-client.

plugins/hls-cabal-project-plugin/src/Ide/Plugin/CabalProject/Diagnostics.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ import Language.LSP.Protocol.Types (Diagnostic (..),
3030
Range (Range),
3131
fromNormalizedFilePath)
3232

33-
-- | Produce a diagnostic for a fatal Cabal parser error.
33+
-- | Produce a diagnostic for a fatal Cabal Project parser error.
3434
fatalParseErrorDiagnostic :: NormalizedFilePath -> T.Text -> FileDiagnostic
3535
fatalParseErrorDiagnostic fp msg =
3636
mkDiag fp "cabal-project" DiagnosticSeverity_Error (toBeginningOfNextLine Syntax.zeroPos) msg
3737

38-
-- | Produce a diagnostic from a Cabal parser error
38+
-- | Produce a diagnostic from a Cabal Project parser error
3939
errorDiagnostic :: NormalizedFilePath -> Syntax.PError -> FileDiagnostic
4040
errorDiagnostic fp err@(Syntax.PError pos _) =
4141
mkDiag fp "cabal-project" DiagnosticSeverity_Error (toBeginningOfNextLine pos) msg
4242
where
4343
msg = T.pack $ showPError (fromNormalizedFilePath fp) err
4444

45-
-- | Produce a diagnostic from a Cabal parser warning
45+
-- | Produce a diagnostic from a Cabal Project parser warning
4646
warningDiagnostic :: NormalizedFilePath -> Syntax.PWarning -> FileDiagnostic
4747
warningDiagnostic fp warning@(Syntax.PWarning _ pos _) =
4848
mkDiag fp "cabal-project" DiagnosticSeverity_Warning (toBeginningOfNextLine pos) msg

plugins/hls-cabal-project-plugin/src/Ide/Plugin/CabalProject/Parse.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ parseCabalProjectFileContents
4040
, Either (Maybe Version, NonEmpty PError) ProjectConfigSkeleton)
4141
parseCabalProjectFileContents fp bytes = do
4242
cacheDir <- getCabalProjectCacheDir fp
43-
-- bytes <- BS.readFile fp
4443
let toParse = ProjectConfigToParse bytes
45-
-- rootDir = takeDirectory fp
4644
verb = normal
4745
httpTransport <- configureTransport verb [fp] Nothing
4846

plugins/hls-cabal-project-plugin/src/Ide/Plugin/CabalProject/Types.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import Distribution.Client.ProjectConfig.Parsec (ProjectConfigSkeleton
1010
import qualified Distribution.Fields as Syntax
1111
import qualified Distribution.Parsec.Position as Syntax
1212
import GHC.Generics (Generic)
13-
-- import Ide.Plugin.Cabal.Completion.Types
14-
1513

1614
type instance RuleResult ParseCabalProjectFile = ProjectConfigSkeleton
1715

vendor/cabal

Submodule cabal updated from 447964a to e8e48a6

0 commit comments

Comments
 (0)