Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build with lsp 1.2.0.1 #2059

Merged
merged 4 commits into from
Aug 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions cabal-ghc901.project
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,6 @@ source-repository-package
subdir: dependent-sum-template
-- https://github.com/obsidiansystems/dependent-sum/pull/57

source-repository-package
type: git
location: https://github.com/anka-213/lsp
tag: tag-ghc-9.0.1-without-pr-326
subdir: lsp-types
subdir: lsp
subdir: lsp-test
-- https://github.com/haskell/lsp/pull/312

-- benchmark dependency
source-repository-package
type: git
Expand All @@ -84,7 +75,7 @@ source-repository-package

write-ghc-environment-files: never

index-state: 2021-07-14T20:31:09Z
index-state: 2021-08-01T00:00:00Z

constraints:
-- These plugins doesn't work on GHC9 yet
Expand Down
19 changes: 1 addition & 18 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ source-repository-package

write-ghc-environment-files: never

index-state: 2021-07-14T20:31:09Z
index-state: 2021-08-01T00:00:00Z

constraints:
-- Diagrams doesn't support optparse-applicative >= 0.16 yet
Expand Down Expand Up @@ -85,20 +85,3 @@ allow-newer:
these:base,
time-compat:base

source-repository-package
type: git
location: https://github.com/haskell/lsp.git
tag: ef59c28b41ed4c5775f0ab0c1e985839359cec96
subdir: lsp-types

source-repository-package
type: git
location: https://github.com/haskell/lsp.git
tag: ef59c28b41ed4c5775f0ab0c1e985839359cec96
subdir: lsp-test

source-repository-package
type: git
location: https://github.com/haskell/lsp.git
tag: ef59c28b41ed4c5775f0ab0c1e985839359cec96
subdir: lsp
5 changes: 4 additions & 1 deletion ghcide/bench/lib/Experiments.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ import Development.Shake (CmdOption (Cwd, FileStdout),
cmd_)
import Experiments.Types
import Language.LSP.Test
import Language.LSP.Types
import Language.LSP.Types hiding
(SemanticTokenAbsolute (length, line),
SemanticTokenRelative (length),
SemanticTokensEdit (_start))
import Language.LSP.Types.Capabilities
import Numeric.Natural
import Options.Applicative
Expand Down
3 changes: 2 additions & 1 deletion ghcide/src/Development/IDE/Core/PositionMapping.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ import Data.Bifunctor
import Data.List
import qualified Data.Text as T
import qualified Data.Vector.Unboxed as V
import Language.LSP.Types
import Language.LSP.Types (Position (Position), Range (Range),
TextDocumentContentChangeEvent (TextDocumentContentChangeEvent))

-- | Either an exact position, or the range of text that was substituted
data PositionResult a
Expand Down
8 changes: 7 additions & 1 deletion ghcide/src/Development/IDE/LSP/Outline.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ import Development.IDE.GHC.Error (rangeToRealSrcSpan,
realSrcSpanToRange)
import Development.IDE.Types.Location
import Language.LSP.Server (LspM)
import Language.LSP.Types
import Language.LSP.Types (DocumentSymbol (..),
DocumentSymbolParams (DocumentSymbolParams, _textDocument),
List (..), ResponseError,
SymbolInformation,
SymbolKind (SkConstructor, SkField, SkFile, SkFunction, SkInterface, SkMethod, SkModule, SkObject, SkStruct, SkTypeParameter, SkUnknown),
TextDocumentIdentifier (TextDocumentIdentifier),
type (|?) (InL), uriToFilePath)
import Outputable (Outputable, ppr,
showSDocUnsafe)

Expand Down
15 changes: 14 additions & 1 deletion ghcide/src/Development/IDE/Plugin/CodeAction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,20 @@ import HscTypes (ImportedMods
import Ide.PluginUtils (subRange)
import Ide.Types
import qualified Language.LSP.Server as LSP
import Language.LSP.Types
import Language.LSP.Types (CodeAction (..),
CodeActionContext (CodeActionContext, _diagnostics),
CodeActionKind (CodeActionQuickFix, CodeActionUnknown),
CodeActionParams (CodeActionParams),
Command,
Diagnostic (..),
List (..),
ResponseError,
SMethod (STextDocumentCodeAction),
TextDocumentIdentifier (TextDocumentIdentifier),
TextEdit (TextEdit),
WorkspaceEdit (WorkspaceEdit, _changeAnnotations, _changes, _documentChanges),
type (|?) (InR),
uriToFilePath)
import Language.LSP.VFS
import Module (moduleEnvElts)
import OccName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ where

import Data.Char
import Data.List
import Language.LSP.Types
import Language.LSP.Types (Position (Position),
Range (Range, _end, _start))

type PositionIndexed a = [(Position, a)]

Expand Down
2 changes: 1 addition & 1 deletion ghcide/src/Development/IDE/Spans/AtPoint.hs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ atPoint IdeOptions{} (HAR _ hf _ _ kind) (DKMap dm km) df pos = listToMaybe $ po
hoverInfo ast = (Just range, prettyNames ++ pTypes)
where
pTypes
| length names == 1 = dropEnd1 $ map wrapHaskell prettyTypes
| Prelude.length names == 1 = dropEnd1 $ map wrapHaskell prettyTypes
| otherwise = map wrapHaskell prettyTypes

range = realSrcSpanToRange $ nodeSpan ast
Expand Down
5 changes: 4 additions & 1 deletion ghcide/test/exe/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ import Development.Shake (getDirectoryFilesIO)
import qualified Experiments as Bench
import Ide.Plugin.Config
import Language.LSP.Test
import Language.LSP.Types hiding (mkRange)
import Language.LSP.Types hiding
(mkRange, SemanticTokenAbsolute (length, line),
SemanticTokenRelative (length),
SemanticTokensEdit (_start))
import Language.LSP.Types.Capabilities
import qualified Language.LSP.Types.Lens as Lsp (diagnostics,
message,
Expand Down
5 changes: 4 additions & 1 deletion ghcide/test/src/Development/IDE/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ import Development.IDE.Plugin.Test (TestRequest (..),
import Development.IDE.Test.Diagnostic
import Language.LSP.Test hiding (message)
import qualified Language.LSP.Test as LspTest
import Language.LSP.Types
import Language.LSP.Types hiding
(SemanticTokenAbsolute (length, line),
SemanticTokenRelative (length),
SemanticTokensEdit (_start))
import Language.LSP.Types.Lens as Lsp
import System.Directory (canonicalizePath)
import System.Time.Extra
Expand Down
2 changes: 1 addition & 1 deletion hls-plugin-api/hls-plugin-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ library
, hls-graph ^>=1.4
, hslogger
, lens
, lsp ^>=1.2
, lsp ^>=1.2.0.1
, opentelemetry
, optparse-applicative
, process
Expand Down
14 changes: 8 additions & 6 deletions hls-plugin-api/src/Ide/PluginUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,19 @@ where

import Data.Algorithm.Diff
import Data.Algorithm.DiffOutput
import Data.Containers.ListUtils (nubOrdOn)
import qualified Data.HashMap.Strict as H
import qualified Data.Text as T
import Ide.Types
import Language.LSP.Types
import qualified Language.LSP.Types as J
import Language.LSP.Types.Capabilities

import Data.Containers.ListUtils (nubOrdOn)
import Ide.Plugin.Config
import Ide.Plugin.Properties
import Ide.Types
import Language.LSP.Server
import Language.LSP.Types hiding
(SemanticTokenAbsolute (length, line),
SemanticTokenRelative (length),
SemanticTokensEdit (_start))
import qualified Language.LSP.Types as J
import Language.LSP.Types.Capabilities

-- ---------------------------------------------------------------------

Expand Down
52 changes: 32 additions & 20 deletions hls-plugin-api/src/Ide/Types.hs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ViewPatterns #-}

module Ide.Types
where
Expand Down Expand Up @@ -46,9 +46,21 @@ import GHC.Generics
import Ide.Plugin.Config
import Ide.Plugin.Properties
import Language.LSP.Server (LspM, getVirtualFile)
import Language.LSP.Types
import Language.LSP.Types.Capabilities
import Language.LSP.Types.Lens as J hiding (id)
import Language.LSP.Types hiding (SemanticTokenAbsolute(length, line), SemanticTokenRelative(length), SemanticTokensEdit(_start))
import Language.LSP.Types.Capabilities (ClientCapabilities (ClientCapabilities),
TextDocumentClientCapabilities (_codeAction, _documentSymbol))
import Language.LSP.Types.Lens as J (HasChildren (children),
HasCommand (command),
HasContents (contents),
HasDeprecated (deprecated),
HasEdit (edit),
HasKind (kind),
HasName (name),
HasOptions (..),
HasRange (range),
HasTextDocument (..),
HasTitle (title),
HasUri (..))
import Language.LSP.VFS
import OpenTelemetry.Eventlog
import Options.Applicative (ParserInfo)
Expand Down Expand Up @@ -467,7 +479,7 @@ instance HasTracing CallHierarchyOutgoingCallsParams
-- ---------------------------------------------------------------------

{-# NOINLINE pROCESS_ID #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
pROCESS_ID :: T.Text
pROCESS_ID = unsafePerformIO getPid
Expand Down
5 changes: 4 additions & 1 deletion hls-test-utils/src/Test/Hls.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ import Ide.Plugin.Config (Config, formattingProvider)
import Ide.PluginUtils (pluginDescToIdePlugins)
import Ide.Types
import Language.LSP.Test
import Language.LSP.Types
import Language.LSP.Types hiding
(SemanticTokenAbsolute (length, line),
SemanticTokenRelative (length),
SemanticTokensEdit (_start))
import Language.LSP.Types.Capabilities (ClientCapabilities)
import System.Directory (getCurrentDirectory,
setCurrentDirectory)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ library
, hiedb
, hls-plugin-api ^>=1.2
, lens
, lsp
, lsp >=1.2.0.1
, sqlite-simple
, text
, unordered-containers
Expand Down
13 changes: 8 additions & 5 deletions plugins/hls-eval-plugin/src/Ide/Plugin/Eval/CodeLens.hs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ import Ide.Plugin.Eval.Util (asS, gStrictTry,
response', timed)
import Ide.Types
import Language.LSP.Server
import Language.LSP.Types
import Language.LSP.Types hiding
(SemanticTokenAbsolute (length, line),
SemanticTokenRelative (length))
import Language.LSP.Types.Lens (end, line)
import Language.LSP.VFS (virtualFileText)
import Outputable (SDoc, empty, hang, nest,
Expand All @@ -153,14 +155,15 @@ import UnliftIO.Temporary (withSystemTempFile)
import Util (OverridingBool (Never))

import IfaceSyn (showToHeader)
import PprTyThing (pprTyThingInContext, pprTypeForUser)
import PprTyThing (pprTyThingInContext,
pprTypeForUser)
#if MIN_VERSION_ghc(9,0,0)
import GHC.Parser.Annotation (ApiAnns (apiAnnRogueComments))
import GHC.Parser.Lexer (mkParserFlags)
import GHC.Driver.Ways (hostFullWays,
wayGeneralFlags,
wayUnsetGeneralFlags)
import GHC.Types.SrcLoc (UnhelpfulSpanReason(UnhelpfulInteractive))
import GHC.Parser.Annotation (ApiAnns (apiAnnRogueComments))
import GHC.Parser.Lexer (mkParserFlags)
import GHC.Types.SrcLoc (UnhelpfulSpanReason (UnhelpfulInteractive))
#else
import GhcPlugins (interpWays, updateWays,
wayGeneralFlags,
Expand Down
5 changes: 4 additions & 1 deletion plugins/hls-hlint-plugin/src/Ide/Plugin/Hlint.hs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ import Language.Haskell.HLint as Hlint hid
import Language.LSP.Server (ProgressCancellable (Cancellable),
sendRequest,
withIndefiniteProgress)
import Language.LSP.Types
import Language.LSP.Types hiding
(SemanticTokenAbsolute (length, line),
SemanticTokenRelative (length),
SemanticTokensEdit (_start))
import qualified Language.LSP.Types as LSP
import qualified Language.LSP.Types.Lens as LSP

Expand Down
5 changes: 4 additions & 1 deletion plugins/hls-module-name-plugin/src/Ide/Plugin/ModuleName.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ import Development.IDE.GHC.Compat (GenLocated (L), getSessionDynFlags,
pm_parsed_source, unLoc)
import Ide.Types
import Language.LSP.Server
import Language.LSP.Types
import Language.LSP.Types hiding
(SemanticTokenAbsolute (length, line),
SemanticTokenRelative (length),
SemanticTokensEdit (_start))
import Language.LSP.VFS (virtualFileText)
import System.Directory (canonicalizePath)
import System.FilePath (dropExtension, splitDirectories,
Expand Down
5 changes: 4 additions & 1 deletion plugins/hls-retrie-plugin/src/Ide/Plugin/Retrie.hs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ import Language.LSP.Server (LspM,
sendNotification,
sendRequest,
withIndefiniteProgress)
import Language.LSP.Types as J
import Language.LSP.Types as J hiding
(SemanticTokenAbsolute (length, line),
SemanticTokenRelative (length),
SemanticTokensEdit (_start))
import Retrie.CPP (CPP (NoCPP), parseCPP)
import Retrie.ExactPrint (fix, relativiseApiAnns,
transformA, unsafeMkA)
Expand Down
5 changes: 4 additions & 1 deletion plugins/hls-tactics-plugin/src/Wingman/LanguageServer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ import Ide.Types (PluginId)
import Language.Haskell.GHC.ExactPrint (Transform)
import Language.Haskell.GHC.ExactPrint (modifyAnnsT, addAnnotationsForPretty)
import Language.LSP.Server (MonadLsp, sendNotification)
import Language.LSP.Types
import Language.LSP.Types hiding
(SemanticTokenAbsolute (length, line),
SemanticTokenRelative (length),
SemanticTokensEdit (_start))
import Language.LSP.Types.Capabilities
import OccName
import Prelude hiding (span)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ import GHC.Generics
import GHC.LanguageExtensions.Type (Extension (LambdaCase))
import Ide.PluginUtils
import Ide.Types
import Language.LSP.Types
import Language.LSP.Types hiding
(SemanticTokenAbsolute (length, line),
SemanticTokenRelative (length),
SemanticTokensEdit (_start))
import OccName
import Prelude hiding (span)
import Wingman.Auto
Expand Down
Loading