mirror of
https://github.com/haskell/ghcide.git
synced 2024-09-11 05:36:09 +03:00
Fix progress reporting (#153)
* Fix progress reporting * Bump haskell-lsp and lsp-test revisions * Change client name * Fix typo * Bump revisions
This commit is contained in:
parent
3d34065ad4
commit
5febbcbc48
@ -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
|
||||
@ -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"
|
||||
@ -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
|
||||
|
150
extension/package-lock.json
generated
150
extension/package-lock.json
generated
@ -5,18 +5,18 @@
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@babel/code-frame": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz",
|
||||
"integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==",
|
||||
"version": "7.5.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz",
|
||||
"integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/highlight": "^7.0.0"
|
||||
}
|
||||
},
|
||||
"@babel/highlight": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz",
|
||||
"integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==",
|
||||
"version": "7.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz",
|
||||
"integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chalk": "^2.0.0",
|
||||
@ -25,15 +25,15 @@
|
||||
}
|
||||
},
|
||||
"@types/mocha": {
|
||||
"version": "2.2.48",
|
||||
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.48.tgz",
|
||||
"integrity": "sha512-nlK/iyETgafGli8Zh9zJVCTicvU3iajSkRwOh3Hhiva598CMqNJ4NcVCGMTGKpGpTYj/9R8RLzS9NAykSSCqGw==",
|
||||
"version": "5.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz",
|
||||
"integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "10.14.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.6.tgz",
|
||||
"integrity": "sha512-Fvm24+u85lGmV4hT5G++aht2C5I4Z4dYlWZIh62FAfFO/TfzXtPpoLI6I7AuBWkIFqZCnhFOoTT7RjjaIL5Fjg==",
|
||||
"version": "12.7.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.11.tgz",
|
||||
"integrity": "sha512-Otxmr2rrZLKRYIybtdG/sgeO+tHY20GxeDjcGmUnmmlCWyEnv2a2x1ZXBo3BTec4OiTXMQCiazB8NMBf0iRlFw==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/vscode": {
|
||||
@ -147,9 +147,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"commander": {
|
||||
"version": "2.20.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz",
|
||||
"integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==",
|
||||
"version": "2.20.1",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.1.tgz",
|
||||
"integrity": "sha512-cCuLsMhJeWQ/ZpsFTbE765kvVfoeSddc4nU3up4fV+fDBcfUXnbITJ+JzhkdjzOqhURjZgujxaioam4RM9yGUg==",
|
||||
"dev": true
|
||||
},
|
||||
"concat-map": {
|
||||
@ -189,9 +189,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"diff": {
|
||||
"version": "3.5.0",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
|
||||
"integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz",
|
||||
"integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==",
|
||||
"dev": true
|
||||
},
|
||||
"dom-serializer": {
|
||||
@ -248,9 +248,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"esutils": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
|
||||
"integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
|
||||
"integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
|
||||
"dev": true
|
||||
},
|
||||
"fd-slicer": {
|
||||
@ -313,9 +313,9 @@
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
||||
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||
"dev": true
|
||||
},
|
||||
"js-tokens": {
|
||||
@ -457,6 +457,14 @@
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"semver": "^5.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"semver": {
|
||||
"version": "5.7.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
|
||||
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"parse5": {
|
||||
@ -507,20 +515,25 @@
|
||||
}
|
||||
},
|
||||
"resolve": {
|
||||
"version": "1.11.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.0.tgz",
|
||||
"integrity": "sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==",
|
||||
"version": "1.12.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz",
|
||||
"integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"path-parse": "^1.0.6"
|
||||
}
|
||||
},
|
||||
"semver": {
|
||||
"version": "5.7.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz",
|
||||
"integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==",
|
||||
"safe-buffer": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz",
|
||||
"integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==",
|
||||
"dev": true
|
||||
},
|
||||
"semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw=="
|
||||
},
|
||||
"sprintf-js": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
||||
@ -534,14 +547,6 @@
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"safe-buffer": "~5.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"safe-buffer": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz",
|
||||
"integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"supports-color": {
|
||||
@ -569,16 +574,16 @@
|
||||
"dev": true
|
||||
},
|
||||
"tslint": {
|
||||
"version": "5.17.0",
|
||||
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.17.0.tgz",
|
||||
"integrity": "sha512-pflx87WfVoYepTet3xLfDOLDm9Jqi61UXIKePOuca0qoAZyrGWonDG9VTbji58Fy+8gciUn8Bt7y69+KEVjc/w==",
|
||||
"version": "5.20.0",
|
||||
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.0.tgz",
|
||||
"integrity": "sha512-2vqIvkMHbnx8acMogAERQ/IuINOq6DFqgF8/VDvhEkBqQh/x6SP0Y+OHnKth9/ZcHQSroOZwUQSN18v8KKF0/g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/code-frame": "^7.0.0",
|
||||
"builtin-modules": "^1.1.1",
|
||||
"chalk": "^2.3.0",
|
||||
"commander": "^2.12.1",
|
||||
"diff": "^3.2.0",
|
||||
"diff": "^4.0.1",
|
||||
"glob": "^7.1.1",
|
||||
"js-yaml": "^3.13.1",
|
||||
"minimatch": "^3.0.4",
|
||||
@ -587,6 +592,14 @@
|
||||
"semver": "^5.3.0",
|
||||
"tslib": "^1.8.0",
|
||||
"tsutils": "^2.29.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"semver": {
|
||||
"version": "5.7.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
|
||||
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"tsutils": {
|
||||
@ -615,9 +628,9 @@
|
||||
}
|
||||
},
|
||||
"typescript": {
|
||||
"version": "3.4.5",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.5.tgz",
|
||||
"integrity": "sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw==",
|
||||
"version": "3.6.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.3.tgz",
|
||||
"integrity": "sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw==",
|
||||
"dev": true
|
||||
},
|
||||
"uc.micro": {
|
||||
@ -645,9 +658,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"vsce": {
|
||||
"version": "1.66.0",
|
||||
"resolved": "https://registry.npmjs.org/vsce/-/vsce-1.66.0.tgz",
|
||||
"integrity": "sha512-Zf4+WD4PhEcOr7jkU08SI9lwFqDhmhk73YOCGQ/tNLaBy+PnnX4eSdqj9LdzDLuI2dsyomJLXzDSNgxuaInxCQ==",
|
||||
"version": "1.67.1",
|
||||
"resolved": "https://registry.npmjs.org/vsce/-/vsce-1.67.1.tgz",
|
||||
"integrity": "sha512-Y/0fnfaLs2cCfytTGmy4Cp1bf9BaxHO7020YePdUwxjAlPlZ9+lm74M9yEFEWXTIug0L0sMax1WMz0TnozIqxg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"azure-devops-node-api": "^7.2.0",
|
||||
@ -670,34 +683,43 @@
|
||||
"url-join": "^1.1.0",
|
||||
"yauzl": "^2.3.1",
|
||||
"yazl": "^2.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"semver": {
|
||||
"version": "5.7.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
|
||||
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"vscode-jsonrpc": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-4.0.0.tgz",
|
||||
"integrity": "sha512-perEnXQdQOJMTDFNv+UF3h1Y0z4iSiaN9jIlb0OqIYgosPCZGYh/MCUlkFtV2668PL69lRDO32hmvL2yiidUYg=="
|
||||
"version": "5.0.0-next.2",
|
||||
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-5.0.0-next.2.tgz",
|
||||
"integrity": "sha512-Q3/jabZUNviCG9hhF6hHWjhrABevPF9mv0aiE2j8BYCAP2k+aHTpjMyk+04MzaAqWYwXdQuZkLSbcYCCqbzJLg=="
|
||||
},
|
||||
"vscode-languageclient": {
|
||||
"version": "4.4.2",
|
||||
"resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-4.4.2.tgz",
|
||||
"integrity": "sha512-9TUzsg1UM6n1UEyPlWbDf7tK1wJAK7UGFRmGDN8sz4KmbbDiVRh6YicaB/5oRSVTpuV47PdJpYlOl3SJ0RiK1Q==",
|
||||
"version": "6.0.0-next.1",
|
||||
"resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-6.0.0-next.1.tgz",
|
||||
"integrity": "sha512-eJ9VjLFNINArgRzLbQ11YlWry7dM93GEODkQBXTRfrSypksiO9qSGr4SHhWgxxP26p4FRSpzc/17+N+Egnnchg==",
|
||||
"requires": {
|
||||
"vscode-languageserver-protocol": "^3.10.3"
|
||||
"semver": "^6.3.0",
|
||||
"vscode-languageserver-protocol": "^3.15.0-next.9"
|
||||
}
|
||||
},
|
||||
"vscode-languageserver-protocol": {
|
||||
"version": "3.14.1",
|
||||
"resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.14.1.tgz",
|
||||
"integrity": "sha512-IL66BLb2g20uIKog5Y2dQ0IiigW0XKrvmWiOvc0yXw80z3tMEzEnHjaGAb3ENuU7MnQqgnYJ1Cl2l9RvNgDi4g==",
|
||||
"version": "3.15.0-next.9",
|
||||
"resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.15.0-next.9.tgz",
|
||||
"integrity": "sha512-b9PAxouMmtsLEe8ZjbIMPb7wRWPhckGfgjwZLmp/dWnaAuRPYtY3lGO0/rNbLc3jKIqCVlnEyYVFKalzDAzj0g==",
|
||||
"requires": {
|
||||
"vscode-jsonrpc": "^4.0.0",
|
||||
"vscode-languageserver-types": "3.14.0"
|
||||
"vscode-jsonrpc": "^5.0.0-next.2",
|
||||
"vscode-languageserver-types": "^3.15.0-next.5"
|
||||
}
|
||||
},
|
||||
"vscode-languageserver-types": {
|
||||
"version": "3.14.0",
|
||||
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.14.0.tgz",
|
||||
"integrity": "sha512-lTmS6AlAlMHOvPQemVwo3CezxBp0sNB95KNPkqp3Nxd5VFEnuG1ByM0zlRWos0zjO3ZWtkvhal0COgiV1xIA4A=="
|
||||
"version": "3.15.0-next.5",
|
||||
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.15.0-next.5.tgz",
|
||||
"integrity": "sha512-7hrELhTeWieUgex3+6692KjCkcmO/+V/bFItM5MHGcBotzwmjEuXjapLLYTYhIspuJ1ibRSik5MhX5YwLpsPiw=="
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
|
@ -3,12 +3,12 @@
|
||||
"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"
|
||||
},
|
||||
@ -16,19 +16,21 @@
|
||||
"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",
|
||||
@ -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"
|
||||
}
|
||||
}
|
||||
|
@ -28,12 +28,13 @@ export function activate(context: ExtensionContext) {
|
||||
// Register the server for plain text documents
|
||||
documentSelector: ["haskell"]
|
||||
};
|
||||
let client2 = new LanguageClient(
|
||||
client = new LanguageClient(
|
||||
'haskell',
|
||||
'Haskell IDE Core',
|
||||
'ghcide',
|
||||
{ args: args, command: cPath, options: {cwd: workspace.rootPath }}, clientOptions, true);
|
||||
client.registerProposedFeatures();
|
||||
|
||||
client2.start();
|
||||
client.start();
|
||||
}
|
||||
|
||||
export function deactivate(): Thenable<void> | undefined {
|
||||
|
@ -57,7 +57,8 @@ library
|
||||
time,
|
||||
transformers,
|
||||
unordered-containers,
|
||||
utf8-string
|
||||
utf8-string,
|
||||
hslogger
|
||||
if flag(ghc-lib)
|
||||
build-depends:
|
||||
ghc-lib >= 8.8,
|
||||
@ -138,6 +139,7 @@ executable ghcide
|
||||
ghc-options: -threaded -Wall -Wno-name-shadowing
|
||||
main-is: Main.hs
|
||||
build-depends:
|
||||
hslogger,
|
||||
base == 4.*,
|
||||
containers,
|
||||
data-default,
|
||||
|
@ -28,6 +28,7 @@ import Development.IDE.Types.Logger
|
||||
import Development.Shake
|
||||
import Data.Either.Extra
|
||||
import qualified Language.Haskell.LSP.Messages as LSP
|
||||
import qualified Language.Haskell.LSP.Types as LSP
|
||||
|
||||
import Development.IDE.Core.Shake
|
||||
|
||||
@ -41,13 +42,15 @@ instance IsIdeGlobal GlobalIdeOptions
|
||||
|
||||
-- | Initialise the Compiler Service.
|
||||
initialise :: Rules ()
|
||||
-> IO LSP.LspId
|
||||
-> (LSP.FromServerMessage -> IO ())
|
||||
-> Logger
|
||||
-> IdeOptions
|
||||
-> VFSHandle
|
||||
-> IO IdeState
|
||||
initialise mainRule toDiags logger options vfs =
|
||||
initialise mainRule getLspId toDiags logger options vfs =
|
||||
shakeOpen
|
||||
getLspId
|
||||
toDiags
|
||||
logger
|
||||
(optShakeProfiling options)
|
||||
|
@ -275,14 +275,15 @@ seqValue v b = case v of
|
||||
Failed -> b
|
||||
|
||||
-- | Open a 'IdeState', should be shut using 'shakeShut'.
|
||||
shakeOpen :: (LSP.FromServerMessage -> IO ()) -- ^ diagnostic handler
|
||||
shakeOpen :: IO LSP.LspId
|
||||
-> (LSP.FromServerMessage -> IO ()) -- ^ diagnostic handler
|
||||
-> Logger
|
||||
-> Maybe FilePath
|
||||
-> IdeReportProgress
|
||||
-> ShakeOptions
|
||||
-> Rules ()
|
||||
-> IO IdeState
|
||||
shakeOpen eventer logger shakeProfileDir (IdeReportProgress reportProgress) opts rules = do
|
||||
shakeOpen getLspId eventer logger shakeProfileDir (IdeReportProgress reportProgress) opts rules = do
|
||||
shakeExtras <- do
|
||||
globals <- newVar HMap.empty
|
||||
state <- newVar HMap.empty
|
||||
@ -295,29 +296,38 @@ shakeOpen eventer logger shakeProfileDir (IdeReportProgress reportProgress) opts
|
||||
shakeOpenDatabase
|
||||
opts
|
||||
{ shakeExtra = addShakeExtra shakeExtras $ shakeExtra opts
|
||||
, shakeProgress = if reportProgress then lspShakeProgress eventer else const (pure ())
|
||||
, shakeProgress = if reportProgress then lspShakeProgress getLspId eventer else const (pure ())
|
||||
}
|
||||
rules
|
||||
shakeAbort <- newMVar $ return ()
|
||||
shakeDb <- shakeDb
|
||||
return IdeState{..}
|
||||
|
||||
lspShakeProgress :: (LSP.FromServerMessage -> IO ()) -> IO Progress -> IO ()
|
||||
lspShakeProgress sendMsg prog = do
|
||||
u <- T.pack . show . hashUnique <$> newUnique
|
||||
lspShakeProgress :: IO LSP.LspId -> (LSP.FromServerMessage -> IO ()) -> IO Progress -> IO ()
|
||||
lspShakeProgress getLspId sendMsg prog = do
|
||||
lspId <- getLspId
|
||||
u <- ProgressTextToken . T.pack . show . hashUnique <$> newUnique
|
||||
sendMsg $ LSP.ReqWorkDoneProgressCreate $ LSP.fmServerWorkDoneProgressCreateRequest
|
||||
lspId $ LSP.WorkDoneProgressCreateParams
|
||||
{ _token = u }
|
||||
bracket_ (start u) (stop u) (loop u)
|
||||
where
|
||||
start id = sendMsg $ LSP.NotProgressStart $ LSP.fmServerProgressStartNotification
|
||||
ProgressStartParams
|
||||
{ _id = id
|
||||
, _title = "Processing"
|
||||
, _cancellable = Nothing
|
||||
, _message = Nothing
|
||||
, _percentage = Nothing
|
||||
start id = sendMsg $ LSP.NotWorkDoneProgressBegin $ LSP.fmServerWorkDoneProgressBeginNotification
|
||||
LSP.ProgressParams
|
||||
{ _token = id
|
||||
, _value = WorkDoneProgressBeginParams
|
||||
{ _title = "Processing"
|
||||
, _cancellable = Nothing
|
||||
, _message = Nothing
|
||||
, _percentage = Nothing
|
||||
}
|
||||
}
|
||||
stop id = sendMsg $ LSP.NotProgressDone $ LSP.fmServerProgressDoneNotification
|
||||
ProgressDoneParams
|
||||
{ _id = id
|
||||
stop id = sendMsg $ LSP.NotWorkDoneProgressEnd $ LSP.fmServerWorkDoneProgressEndNotification
|
||||
LSP.ProgressParams
|
||||
{ _token = id
|
||||
, _value = WorkDoneProgressEndParams
|
||||
{ _message = Nothing
|
||||
}
|
||||
}
|
||||
sample = 0.1
|
||||
loop id = forever $ do
|
||||
@ -325,11 +335,14 @@ lspShakeProgress sendMsg prog = do
|
||||
p <- prog
|
||||
let done = countSkipped p + countBuilt p
|
||||
let todo = done + countUnknown p + countTodo p
|
||||
sendMsg $ LSP.NotProgressReport $ LSP.fmServerProgressReportNotification
|
||||
ProgressReportParams
|
||||
{ _id = id
|
||||
, _message = Just $ T.pack $ show done <> "/" <> show todo
|
||||
, _percentage = Nothing
|
||||
sendMsg $ LSP.NotWorkDoneProgressReport $ LSP.fmServerWorkDoneProgressReportNotification
|
||||
LSP.ProgressParams
|
||||
{ _token = id
|
||||
, _value = LSP.WorkDoneProgressReportParams
|
||||
{ _cancellable = Nothing
|
||||
, _message = Just $ T.pack $ show done <> "/" <> show todo
|
||||
, _percentage = Nothing
|
||||
}
|
||||
}
|
||||
|
||||
shakeProfile :: IdeState -> FilePath -> IO ()
|
||||
|
@ -24,7 +24,7 @@ gotoDefinition
|
||||
:: IdeState
|
||||
-> TextDocumentPositionParams
|
||||
-> IO LocationResponseParams
|
||||
gotoDefinition ide (TextDocumentPositionParams (TextDocumentIdentifier uri) pos) = do
|
||||
gotoDefinition ide (TextDocumentPositionParams (TextDocumentIdentifier uri) pos _) = do
|
||||
mbResult <- case uriToFilePath' uri of
|
||||
Just path -> do
|
||||
logInfo (ideLogger ide) $
|
||||
|
@ -24,7 +24,7 @@ onHover
|
||||
:: IdeState
|
||||
-> TextDocumentPositionParams
|
||||
-> IO (Maybe Hover)
|
||||
onHover ide (TextDocumentPositionParams (TextDocumentIdentifier uri) pos) = do
|
||||
onHover ide (TextDocumentPositionParams (TextDocumentIdentifier uri) pos _) = do
|
||||
mbResult <- case uriToFilePath' uri of
|
||||
Just (toNormalizedFilePath -> filePath) -> do
|
||||
logInfo (ideLogger ide) $
|
||||
|
@ -41,7 +41,7 @@ import Language.Haskell.LSP.Messages
|
||||
runLanguageServer
|
||||
:: LSP.Options
|
||||
-> PartialHandlers
|
||||
-> ((FromServerMessage -> IO ()) -> VFSHandle -> ClientCapabilities -> IO IdeState)
|
||||
-> (IO LspId -> (FromServerMessage -> IO ()) -> VFSHandle -> ClientCapabilities -> IO IdeState)
|
||||
-> IO ()
|
||||
runLanguageServer options userHandlers getIdeState = do
|
||||
-- Move stdout to another file descriptor and duplicate stderr
|
||||
@ -120,7 +120,7 @@ runLanguageServer options userHandlers getIdeState = do
|
||||
where
|
||||
handleInit :: IO () -> (LspId -> IO ()) -> (LspId -> IO ()) -> Chan Message -> LSP.LspFuncs () -> IO (Maybe err)
|
||||
handleInit exitClientMsg clearReqId waitForCancel clientMsgChan lspFuncs@LSP.LspFuncs{..} = do
|
||||
ide <- getIdeState sendFunc (makeLSPVFSHandle lspFuncs) clientCapabilities
|
||||
ide <- getIdeState getNextReqId sendFunc (makeLSPVFSHandle lspFuncs) clientCapabilities
|
||||
_ <- flip forkFinally (const exitClientMsg) $ forever $ do
|
||||
msg <- readChan clientMsgChan
|
||||
case msg of
|
||||
@ -161,6 +161,7 @@ runLanguageServer options userHandlers getIdeState = do
|
||||
setHandlersIgnore :: PartialHandlers
|
||||
setHandlersIgnore = PartialHandlers $ \_ x -> return x
|
||||
{LSP.initializedHandler = none
|
||||
,LSP.responseHandler = none
|
||||
}
|
||||
where none = Just $ const $ return ()
|
||||
|
||||
|
@ -58,7 +58,7 @@ newtype IdeDefer = IdeDefer Bool
|
||||
|
||||
clientSupportsProgress :: LSP.ClientCapabilities -> IdeReportProgress
|
||||
clientSupportsProgress caps = IdeReportProgress $ fromMaybe False $
|
||||
LSP._progress =<< LSP._window (caps :: LSP.ClientCapabilities)
|
||||
LSP._workDoneProgress =<< LSP._window (caps :: LSP.ClientCapabilities)
|
||||
|
||||
defaultIdeOptions :: IO (FilePath -> Action HscEnvEq) -> IdeOptions
|
||||
defaultIdeOptions session = IdeOptions
|
||||
|
@ -2,9 +2,13 @@ resolver: nightly-2019-09-16
|
||||
packages:
|
||||
- .
|
||||
extra-deps:
|
||||
- haskell-lsp-0.16.0.0
|
||||
- haskell-lsp-types-0.16.0.0
|
||||
- lsp-test-0.7.0.0
|
||||
- github: alanz/haskell-lsp
|
||||
commit: fefcae8b44aaf7658e0f90d5530832efe0b32053
|
||||
subdirs:
|
||||
- .
|
||||
- haskell-lsp-types
|
||||
- github: cocreature/lsp-test
|
||||
commit: 40da0529edb687864acf2716dff310d38b0641c6
|
||||
- hie-bios-0.2.0
|
||||
- ghc-lib-parser-8.8.1
|
||||
- ghc-lib-8.8.1
|
||||
|
10
stack.yaml
10
stack.yaml
@ -2,9 +2,13 @@ resolver: nightly-2019-09-16
|
||||
packages:
|
||||
- .
|
||||
extra-deps:
|
||||
- haskell-lsp-0.16.0.0
|
||||
- haskell-lsp-types-0.16.0.0
|
||||
- lsp-test-0.7.0.0
|
||||
- github: alanz/haskell-lsp
|
||||
commit: fefcae8b44aaf7658e0f90d5530832efe0b32053
|
||||
subdirs:
|
||||
- .
|
||||
- haskell-lsp-types
|
||||
- github: cocreature/lsp-test
|
||||
commit: 40da0529edb687864acf2716dff310d38b0641c6
|
||||
- hie-bios-0.2.1
|
||||
nix:
|
||||
packages: [zlib]
|
||||
|
10
stack84.yaml
10
stack84.yaml
@ -3,13 +3,17 @@ packages:
|
||||
- .
|
||||
|
||||
extra-deps:
|
||||
- github: alanz/haskell-lsp
|
||||
commit: fefcae8b44aaf7658e0f90d5530832efe0b32053
|
||||
subdirs:
|
||||
- .
|
||||
- haskell-lsp-types
|
||||
- github: cocreature/lsp-test
|
||||
commit: 40da0529edb687864acf2716dff310d38b0641c6
|
||||
- rope-utf16-splay-0.3.1.0
|
||||
- shake-0.18.3
|
||||
- filepattern-0.1.1
|
||||
- js-dgtable-0.5.2
|
||||
- haskell-lsp-0.16.0.0
|
||||
- haskell-lsp-types-0.16.0.0
|
||||
- lsp-test-0.7.0.0
|
||||
- hie-bios-0.2.1
|
||||
nix:
|
||||
packages: [zlib]
|
||||
|
11
stack88.yaml
11
stack88.yaml
@ -2,9 +2,16 @@ resolver: nightly-2019-10-10
|
||||
packages:
|
||||
- .
|
||||
extra-deps:
|
||||
- haskell-lsp-0.16.0.0
|
||||
- github: alanz/haskell-lsp
|
||||
commit: fefcae8b44aaf7658e0f90d5530832efe0b32053
|
||||
subdirs:
|
||||
- .
|
||||
- haskell-lsp-types
|
||||
- github: cocreature/lsp-test
|
||||
commit: 40da0529edb687864acf2716dff310d38b0641c6
|
||||
- prettyprinter-1.3.0
|
||||
- prettyprinter-ansi-terminal-1.1.1.2
|
||||
- hslogger-1.3.0.0
|
||||
- lsp-test-0.7.0.0
|
||||
- network-bsd-2.8.1.0
|
||||
allow-newer: true
|
||||
nix:
|
||||
|
@ -31,9 +31,10 @@ main :: IO ()
|
||||
main = defaultMain $ testGroup "HIE"
|
||||
[ testSession "open close" $ do
|
||||
doc <- openDoc' "Testing.hs" "haskell" ""
|
||||
void (message :: Session ProgressStartNotification)
|
||||
void (message :: Session WorkDoneProgressCreateRequest)
|
||||
void (message :: Session WorkDoneProgressBeginNotification)
|
||||
closeDoc doc
|
||||
void (message :: Session ProgressDoneNotification)
|
||||
void (message :: Session WorkDoneProgressEndNotification)
|
||||
, initializeResponseTests
|
||||
, diagnosticTests
|
||||
, codeActionTests
|
||||
@ -118,7 +119,8 @@ diagnosticTests = testGroup "diagnostics"
|
||||
, testSessionWait "introduce syntax error" $ do
|
||||
let content = T.unlines [ "module Testing where" ]
|
||||
doc <- openDoc' "Testing.hs" "haskell" content
|
||||
void (message :: Session ProgressStartNotification)
|
||||
void (message :: Session WorkDoneProgressCreateRequest)
|
||||
void (message :: Session WorkDoneProgressBeginNotification)
|
||||
let change = TextDocumentContentChangeEvent
|
||||
{ _range = Just (Range (Position 0 15) (Position 0 18))
|
||||
, _rangeLength = Nothing
|
||||
|
Loading…
Reference in New Issue
Block a user