Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Commit

Permalink
Fix progress reporting (#153)
Browse files Browse the repository at this point in the history
* Fix progress reporting

* Bump haskell-lsp and lsp-test revisions

* Change client name

* Fix typo

* Bump revisions
  • Loading branch information
cocreature authored Oct 17, 2019
1 parent 3d34065 commit 5febbcb
Show file tree
Hide file tree
Showing 16 changed files with 197 additions and 131 deletions.
7 changes: 4 additions & 3 deletions exe/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import Development.IDE.GHC.Util
import qualified Data.Text as T
import qualified Data.Text.IO as T
import Language.Haskell.LSP.Messages
import Language.Haskell.LSP.Types (LspId(IdInt))
import Linker
import Data.Version
import Development.IDE.LSP.LanguageServer
Expand Down Expand Up @@ -76,14 +77,14 @@ main = do
t <- offsetTime
hPutStrLn stderr "Starting LSP server..."
hPutStrLn stderr "If you are seeing this in a terminal, you probably should have run ghcidie WITHOUT the --lsp option!"
runLanguageServer def def $ \event vfs caps -> do
runLanguageServer def def $ \getLspId event vfs caps -> do
t <- t
hPutStrLn stderr $ "Started LSP server in " ++ showDuration t
-- very important we only call loadSession once, and it's fast, so just do it before starting
session <- loadSession dir
let options = (defaultIdeOptions $ return session)
{ optReportProgress = clientSupportsProgress caps }
initialise (mainRule >> action kick) event (logger minBound) options vfs
initialise (mainRule >> action kick) getLspId event (logger minBound) options vfs
else do
putStrLn $ "Ghcide setup tester in " ++ dir ++ "."
putStrLn "Report bugs at https://github.com/digital-asset/ghcide/issues"
Expand Down Expand Up @@ -112,7 +113,7 @@ main = do
let grab file = fromMaybe (head sessions) $ do
cradle <- Map.lookup file filesToCradles
Map.lookup cradle cradlesToSessions
ide <- initialise mainRule (showEvent lock) (logger Info) (defaultIdeOptions $ return $ return . grab) vfs
ide <- initialise mainRule (pure $ IdInt 0) (showEvent lock) (logger Info) (defaultIdeOptions $ return $ return . grab) vfs

putStrLn "\nStep 6/6: Type checking the files"
setFilesOfInterest ide $ Set.fromList $ map toNormalizedFilePath files
Expand Down
150 changes: 86 additions & 64 deletions extension/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 21 additions & 19 deletions extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,34 @@
"displayName": "ghcide",
"publisher": "DigitalAssetHoldingsLLC",
"repository": {
"type" : "git",
"url" : "https://github.com/digitalasset/daml.git"
"type": "git",
"url": "https://github.com/digitalasset/daml.git"
},
"description": "A simple extension to test out haskell ide core",
"version": "0.0.1",
"license": "Apache-2.0",
"license": "Apache-2.0",
"engines": {
"vscode": "^1.35.0"
},
"categories": [
"Other"
],
"activationEvents": [
"onLanguage:haskell"
"onLanguage:haskell"
],
"main": "./out/extension.js",
"contributes": {
"languages": [{
"id": "haskell",
"extensions": [
"hs",
"hs-boot",
"lhs-boot",
"lhs"
]
}],
"languages": [
{
"id": "haskell",
"extensions": [
"hs",
"hs-boot",
"lhs-boot",
"lhs"
]
}
],
"configuration": {
"type": "object",
"title": "Haskell IDE Core Configuration",
Expand All @@ -53,18 +55,18 @@
"test": "npm run compile && node ./node_modules/vscode/bin/test",
"vscepackage": "vsce package"
},
"extensionDependencies": [
"justusadam.language-haskell"
"extensionDependencies": [
"justusadam.language-haskell"
],
"dependencies": {
"vscode-languageclient": "^4.1.4"
"vscode-languageclient": "^6.0.0-next.1"
},
"devDependencies": {
"@types/mocha": "^2.2.42",
"@types/node": "^10.12.21",
"@types/mocha": "^5.2.7",
"@types/node": "^12.7.11",
"@types/vscode": "1.35.0",
"tslint": "^5.12.1",
"typescript": "^3.3.1",
"typescript": "^3.6.3",
"vsce": "^1.66.0"
}
}
Loading

0 comments on commit 5febbcb

Please sign in to comment.