Merge pull request #275 from alanz/hls-3

Use wz1000/hls-3 ghcide branch
This commit is contained in:
Alan Zimmerman 2020-08-04 12:58:35 +01:00 committed by GitHub
commit b15508a46c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 8 deletions

4
.gitmodules vendored
View File

@ -12,6 +12,6 @@
path = ghcide
# url = https://github.com/digital-asset/ghcide.git
# url = https://github.com/alanz/ghcide.git
# url = https://github.com/wz1000/ghcide.git
url = https://github.com/wz1000/ghcide.git
# url = https://github.com/fendor/ghcide.git
url = https://github.com/bubba/ghcide.git
# url = https://github.com/bubba/ghcide.git

View File

@ -174,15 +174,18 @@ runLspMode lspArgs@LspArguments {..} = do
hPutStrLn stderr $ " with plugins: " <> show (Map.keys $ ipMap idePlugins')
hPutStrLn stderr $ " in directory: " <> dir
hPutStrLn stderr "If you are seeing this in a terminal, you probably should have run ghcide WITHOUT the --lsp option!"
runLanguageServer options (pluginHandler plugins) getInitialConfig getConfigFromNotification $ \getLspId event vfs caps wProg wIndefProg -> do
runLanguageServer options (pluginHandler plugins) getInitialConfig getConfigFromNotification $ \getLspId event vfs caps wProg wIndefProg _getConfig -> do
t <- t
hPutStrLn stderr $ "Started LSP server in " ++ showDuration t
sessionLoader <- loadSession dir
-- config <- fromMaybe defaultLspConfig <$> getConfig
let options = (defaultIdeOptions sessionLoader)
{ optReportProgress = clientSupportsProgress caps
, optShakeProfiling = argsShakeProfiling
, optTesting = IdeTesting argsTesting
, optThreads = argsThreads
-- , optCheckParents = checkParents config
-- , optCheckProject = checkProject config
}
debouncer <- newAsyncDebouncer
initialise caps (mainRule >> pluginRules plugins)

2
ghcide

@ -1 +1 @@
Subproject commit 7e895cfa53260b41996df707baec496a8f2c75dc
Subproject commit b7de7ae89469693b76d92ca433119d91d3a9aac0

View File

@ -49,8 +49,7 @@ import Development.IDE.Core.Shake (IdeRule,
IdeState (shakeExtras),
runIdeAction, use,
useWithStaleFast, use_)
import Development.IDE.GHC.Error (isInsideSrcSpan,
srcSpanToRange)
import Development.IDE.GHC.Error (realSrcSpanToRange, isInsideSrcSpan)
import Development.IDE.GHC.Util (hscEnv, prettyPrint, runGhcEnv)
import Development.IDE.Types.Location
import Development.Shake (RuleResult)
@ -435,9 +434,9 @@ asTextEdits NoChange = []
asTextEdits (Change reps _imports) =
[ (Uri spanLoc, edit)
| Replacement {..} <- nubOrdOn replLocation reps,
s@(RealSrcSpan rspan) <- [replLocation],
(RealSrcSpan rspan) <- [replLocation],
let spanLoc = T.pack $ unpackFS $ srcSpanFile rspan,
let edit = TextEdit (srcSpanToRange s) (T.pack replReplacement)
let edit = TextEdit (realSrcSpanToRange rspan) (T.pack replReplacement)
]
-------------------------------------------------------------------------------