From 8f595468206c6f0ac28951bfec28dea0be297a97 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 4 Apr 2025 21:16:27 +0000 Subject: [PATCH] chore: document LSP support in read me --- README.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 76732571..5c71b3e6 100644 --- a/README.md +++ b/README.md @@ -164,9 +164,23 @@ openai.chat.completions.create( ## LSP Support -### Sorbet +### Solargraph + +This library includes [Solargraph](https://solargraph.org) support for both auto completion and go to definition. + +```ruby +gem "solargraph", group: :development +``` + +After Solargraph is installed, **you must populate its index** either via the provided editor command, or by running the following in your terminal: + +```sh +bundle exec solargraph gems +``` -**This library emits an intentional warning under the [`tapioca` toolchain](https://github.com/Shopify/tapioca)**. This is normal, and does not impact functionality. +Otherwise Solargraph will not be able to provide type information or auto-completion for any non-indexed libraries. + +### Sorbet This library is written with [Sorbet type definitions](https://sorbet.org/docs/rbi). However, there is no runtime dependency on the `sorbet-runtime`. @@ -188,6 +202,12 @@ params = OpenAI::Models::Chat::CompletionCreateParams.new( openai.chat.completions.create(**params) ``` +Note: **This library emits an intentional warning under the [`tapioca` toolchain](https://github.com/Shopify/tapioca)**. This is normal, and does not impact functionality. + +### Ruby LSP + +The Ruby LSP has [best effort support](https://shopify.github.io/ruby-lsp/#guessed-types) for inferring type information from Ruby code, and as such it may not always be able to provide accurate type information. + ## Advanced ### Making custom/undocumented requests