homebrew-core/Formula/dhall-lsp-server.rb

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.10/dhall-lsp-server-1.0.10.tar.gz"
sha256 "4b7341d9102734cfd5eb54aaeac454625192beb07865be14f35d4687b01fcb7c"
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 "ebb726df36e8e41ead67f64249971c1e5a6890ad336dcf337377849fd08cc4dc" => :catalina
sha256 "7858fb6d18a2004a680fb69d9ee0716b0106ee403e65d0c7a0b6b55de78fddc3" => :mojave
sha256 "8136a1c1dd57bb53f9acc20f5a3fd948b7957073b520ff7dd15d773ccc6103f8" => :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