From 4899c87264df930cc9abd3f2e536b5f5bc28a90a Mon Sep 17 00:00:00 2001 From: Nicolas Karolak Date: Tue, 27 Aug 2024 10:06:48 +0200 Subject: [PATCH] feat: add jedi-language-server formula --- Formula/jedi-language-server.rb | 68 +++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Formula/jedi-language-server.rb diff --git a/Formula/jedi-language-server.rb b/Formula/jedi-language-server.rb new file mode 100644 index 0000000..3ac82c9 --- /dev/null +++ b/Formula/jedi-language-server.rb @@ -0,0 +1,68 @@ +# typed: false + +class JediLanguageServer < Formula + include Language::Python::Virtualenv + + desc "Language server for Jedi" + homepage "https://github.com/pappasam/jedi-language-server" + url "https://files.pythonhosted.org/packages/34/f9/c24a60c08624c042600ef3c115ff744829491a0ab5631eba0377c2ca1882/jedi_language_server-0.41.4.tar.gz" + sha256 "af010173f9f62dfcd3b3f4e2ea0ea3020fb4285c9b6b18b481aa978f28b5a36a" + license "MIT" + + depends_on "python" + + resource "attrs" do + url "https://files.pythonhosted.org/packages/fc/0f/aafca9af9315aee06a89ffde799a10a582fe8de76c563ee80bbcdc08b3fb/attrs-24.2.0.tar.gz" + sha256 "5cfb1b9148b5b086569baec03f20d7b6bf3bcacc9a42bebf87ffaaca362f6346" + end + + resource "cattrs" do + url "https://files.pythonhosted.org/packages/1e/57/c6ccd22658c4bcb3beb3f1c262e1f170cf136e913b122763d0ddd328d284/cattrs-23.2.3.tar.gz" + sha256 "a934090d95abaa9e911dac357e3a8699e0b4b14f8529bcc7d2b1ad9d51672b9f" + end + + resource "docstring-to-markdown" do + url "https://files.pythonhosted.org/packages/7a/ad/6a66abd14676619bd56f6b924c96321a2e2d7d86558841d94a30023eec53/docstring-to-markdown-0.15.tar.gz" + sha256 "e146114d9c50c181b1d25505054a8d0f7a476837f0da2c19f07e06eaed52b73d" + end + + resource "jedi" do + url "https://files.pythonhosted.org/packages/d6/99/99b493cec4bf43176b678de30f81ed003fd6a647a301b9c927280c600f0a/jedi-0.19.1.tar.gz" + sha256 "cf0496f3651bc65d7174ac1b7d043eff454892c708a87d1b683e57b569927ffd" + end + + resource "lsprotocol" do + url "https://files.pythonhosted.org/packages/9d/f6/6e80484ec078d0b50699ceb1833597b792a6c695f90c645fbaf54b947e6f/lsprotocol-2023.0.1.tar.gz" + sha256 "cc5c15130d2403c18b734304339e51242d3018a05c4f7d0f198ad6e0cd21861d" + end + + resource "parso" do + url "https://files.pythonhosted.org/packages/66/94/68e2e17afaa9169cf6412ab0f28623903be73d1b32e208d9e8e541bb086d/parso-0.8.4.tar.gz" + sha256 "eb3a7b58240fb99099a345571deecc0f9540ea5f4dd2fe14c2a99d6b281ab92d" + end + + resource "pygls" do + url "https://files.pythonhosted.org/packages/86/b9/41d173dad9eaa9db9c785a85671fc3d68961f08d67706dc2e79011e10b5c/pygls-1.3.1.tar.gz" + sha256 "140edceefa0da0e9b3c533547c892a42a7d2fd9217ae848c330c53d266a55018" + end + + def install + virtualenv_install_with_resources + end + + test do + json = <<~JSON + { + "jsonrpc": "2.0", + "id": 1, + "method": "initialize", + "params": { + "rootUri": null, + "capabilities": {} + } + } + JSON + input = "Content-Length: #{json.size}\r\n\r\n#{json}" + pipe_output(bin/"jedi-language-server", input) + end +end