54 lines
2.2 KiB
Ruby
54 lines
2.2 KiB
Ruby
class DhallLspServer < Formula
|
|
desc "Language Server Protocol (LSP) server for Dhall"
|
|
homepage "https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-lsp-server"
|
|
url "https://hackage.haskell.org/package/dhall-lsp-server-1.0.9/dhall-lsp-server-1.0.9.tar.gz"
|
|
sha256 "b683f9a535c02c5e76a9bad417b60721096edd23e06e976aab57f58cd81dc57d"
|
|
license "BSD-3-Clause"
|
|
head "https://github.com/dhall-lang/dhall-haskell.git"
|
|
|
|
livecheck do
|
|
url :stable
|
|
end
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "6cf4d2f560c153897f3ee816780872144da6322cc1f94c29137cea536681d8b3" => :catalina
|
|
sha256 "bc7b944814dcb66916cd2bc100fba37a64cb9c7f9c842296c0a604d0f02cb56d" => :mojave
|
|
sha256 "07d2226dd5c707d203d590e86a29c9f1f15b2591b4d336a46b0c870abde87448" => :high_sierra
|
|
end
|
|
|
|
depends_on "cabal-install" => :build
|
|
depends_on "ghc" => :build
|
|
|
|
def install
|
|
system "cabal", "v2-update"
|
|
system "cabal", "v2-install", *std_cabal_v2_args
|
|
end
|
|
|
|
test do
|
|
input =
|
|
"Content-Length: 152\r\n" \
|
|
"\r\n" \
|
|
"{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"" \
|
|
"processId\":88075,\"rootUri\":null,\"capabilities\":{},\"trace\":\"ver" \
|
|
"bose\",\"workspaceFolders\":null}}\r\n"
|
|
|
|
output =
|
|
"Content-Length: 683\r\n" \
|
|
"\r\n" \
|
|
"{\"result\":{\"capabilities\":{\"typeDefinitionProvider\":false,\"fold" \
|
|
"ingRangeProvider\":false,\"textDocumentSync\":{\"openClose\":true,\"ch" \
|
|
"ange\":2,\"willSave\":false,\"willSaveWaitUntil\":false,\"save\":{\"in" \
|
|
"cludeText\":false}},\"workspace\":{},\"implementationProvider\":false," \
|
|
"\"executeCommandProvider\":{\"commands\":[\"dhall.server.lint\",\"dhal" \
|
|
"l.server.annotateLet\",\"dhall.server.freezeImport\",\"dhall.server.fr" \
|
|
"eezeAllImports\"]},\"renameProvider\":false,\"colorProvider\":false,\"" \
|
|
"hoverProvider\":true,\"codeActionProvider\":false,\"completionProvider" \
|
|
"\":{\"triggerCharacters\":[\":\",\".\",\"/\"],\"resolveProvider\":fals" \
|
|
"e},\"documentLinkProvider\":{\"resolveProvider\":false},\"documentForm" \
|
|
"attingProvider\":true}},\"jsonrpc\":\"2.0\",\"id\":1}"
|
|
|
|
assert_match output, pipe_output("#{bin}/dhall-lsp-server", input, 0)
|
|
end
|
|
end
|