Skip to content

Commit

Permalink
Merge branch 'master' into 4173-extracts-ghcide-tests-and-migrate-it-…
Browse files Browse the repository at this point in the history
…to-use-hls-test-utils
  • Loading branch information
soulomoon authored Apr 17, 2024
2 parents 7e3f119 + e6f7be7 commit 096641a
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 13 deletions.
9 changes: 4 additions & 5 deletions ghcide-bench/src/Experiments.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ import qualified Data.Text as T
import Data.Version
import Development.IDE.Plugin.Test
import Development.IDE.Test.Diagnostic
import Development.Shake (CmdOption (Cwd, FileStdout),
cmd_)
import Development.Shake (CmdOption (Cwd), cmd_)
import Experiments.Types
import Language.LSP.Protocol.Capabilities
import qualified Language.LSP.Protocol.Lens as L
Expand Down Expand Up @@ -128,7 +127,7 @@ experiments =
(\docs -> do
hieYamlUri <- getDocUri "hie.yaml"
liftIO $ appendFile (fromJust $ uriToFilePath hieYamlUri) "##\n"
sendNotification SMethod_WorkspaceDidChangeWatchedFiles $ DidChangeWatchedFilesParams $
sendNotification SMethod_WorkspaceDidChangeWatchedFiles $ DidChangeWatchedFilesParams
[ FileEvent hieYamlUri FileChangeType_Changed ]
flip allWithIdentifierPos docs $ \DocumentPositions{..} -> isJust <$> getHover doc (fromJust identifierP)
),
Expand Down Expand Up @@ -210,7 +209,7 @@ experiments =
( \docs -> do
hieYamlUri <- getDocUri "hie.yaml"
liftIO $ appendFile (fromJust $ uriToFilePath hieYamlUri) "##\n"
sendNotification SMethod_WorkspaceDidChangeWatchedFiles $ DidChangeWatchedFilesParams $
sendNotification SMethod_WorkspaceDidChangeWatchedFiles $ DidChangeWatchedFilesParams
[ FileEvent hieYamlUri FileChangeType_Changed ]
waitForProgressStart
waitForProgressStart
Expand Down Expand Up @@ -777,7 +776,7 @@ setupDocumentContents config =
findEndOfImports :: [DocumentSymbol] -> Maybe Position
findEndOfImports (DocumentSymbol{_kind = SymbolKind_Module, _name = "imports", _range} : _) =
Just $ Position (succ $ _line $ _end _range) 4
findEndOfImports [DocumentSymbol{_kind = SymbolKind_File, _children = Just (cc)}] =
findEndOfImports [DocumentSymbol{_kind = SymbolKind_File, _children = Just cc}] =
findEndOfImports cc
findEndOfImports (DocumentSymbol{_range} : _) =
Just $ _range ^. L.start
Expand Down
1 change: 0 additions & 1 deletion ghcide/src/Development/IDE/Core/Shake.hs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ import Language.LSP.Diagnostics
import qualified Language.LSP.Protocol.Lens as L
import Language.LSP.Protocol.Message
import Language.LSP.Protocol.Types
import Language.LSP.Protocol.Types (SemanticTokens)
import qualified Language.LSP.Protocol.Types as LSP
import qualified Language.LSP.Server as LSP
import Language.LSP.VFS hiding (start)
Expand Down
1 change: 0 additions & 1 deletion hls-graph/src/Development/IDE/Graph/Database.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ module Development.IDE.Graph.Database(
,shakeGetBuildEdges) where
import Control.Concurrent.STM.Stats (readTVarIO)
import Data.Dynamic
import Data.Foldable (fold)
import Data.Maybe
import Development.IDE.Graph.Classes ()
import Development.IDE.Graph.Internal.Action
Expand Down
2 changes: 1 addition & 1 deletion hls-graph/src/Development/IDE/Graph/Internal/Database.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import Control.Monad.Trans.Reader
import qualified Control.Monad.Trans.State.Strict as State
import Data.Dynamic
import Data.Either
import Data.Foldable (fold, for_, traverse_)
import Data.Foldable (for_, traverse_)
import Data.IORef.Extra
import Data.List.NonEmpty (unzip)
import Data.Maybe
Expand Down
1 change: 0 additions & 1 deletion hls-graph/src/Development/IDE/Graph/Internal/Profile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import Data.Bifunctor
import qualified Data.ByteString.Lazy.Char8 as LBS
import Data.Char
import Data.Dynamic (toDyn)
import Data.Foldable (fold)
import qualified Data.HashMap.Strict as Map
import Data.List (dropWhileEnd, foldl',
intercalate,
Expand Down
1 change: 0 additions & 1 deletion hls-plugin-api/src/Ide/Logger.hs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import Data.Foldable (for_)
import Data.Functor.Contravariant (Contravariant (contramap))
import Data.Maybe (fromMaybe)
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text as Text
import qualified Data.Text.IO as Text
import Data.Time (defaultTimeLocale, formatTime,
Expand Down
6 changes: 3 additions & 3 deletions hls-test-utils/src/Test/Hls.hs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ import Data.Proxy (Proxy (Proxy))
import qualified Data.Text as T
import qualified Data.Text.Lazy as TL
import qualified Data.Text.Lazy.Encoding as TL
import Development.IDE (IdeState, LoggingColumn (ThreadIdColumn))
import Development.IDE (IdeState,
LoggingColumn (ThreadIdColumn))
import Development.IDE.Main hiding (Log)
import qualified Development.IDE.Main as Ghcide
import qualified Development.IDE.Main as IDEMain
import Development.IDE.Plugin.Test (TestRequest (GetBuildKeysBuilt, WaitForIdeRule, WaitForShakeQueue),
WaitForIdeRuleResult (ideResultSuccess))
Expand Down Expand Up @@ -622,7 +622,7 @@ runSessionWithServer' plugins conf sconf caps root s = withLock lock $ keepCurr
}

server <- async $
Ghcide.defaultMain (cmapWithPrio LogIDEMain recorder)
IDEMain.defaultMain (cmapWithPrio LogIDEMain recorder)
arguments
{ argsHandleIn = pure inR
, argsHandleOut = pure outW
Expand Down

0 comments on commit 096641a

Please sign in to comment.