Skip to content

Commit e70ddfe

Browse files
chore: update README with recommended editor plugins
1 parent ec15a06 commit e70ddfe

File tree

2 files changed

+16
-25
lines changed

2 files changed

+16
-25
lines changed

CONTRIBUTING.md

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,17 @@ $ bundle exec rake format
9696

9797
## Editor Support
9898

99-
### Solargraph
99+
### Ruby LSP
100100

101-
This library includes [Solargraph](https://solargraph.org) support for both auto-completion and go to definition.
101+
[Ruby LSP](https://github.com/Shopify/ruby-lsp) has quite good support for go to definition, but not auto-completion.
102102

103-
```ruby
104-
gem "solargraph", group: :development
105-
```
103+
This can be installed along side Solargraph.
104+
105+
### Solargraph
106106

107-
Note: if you had installed the gem locally using `git: "..."` or `path: "..."`, you must update your [`.solargraph.yml`](https://solargraph.org/guides/configuration) to include the path to where the gem is located:
107+
[Solargraph](https://solargraph.org) has quite good support for auto-completion, but not go to definition.
108108

109-
```yaml
110-
include:
111-
- '<path-to-repo>/lib/**/*.rb'
112-
```
109+
This can be installed along side Ruby LSP.
113110

114111
### Sorbet
115112

@@ -119,10 +116,6 @@ include:
119116

120117
2. For each generic type in `*.rbi` files, a spurious "Duplicate type member" error is present.
121118

122-
### Ruby LSP
123-
124-
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.
125-
126119
## Documentation Preview
127120

128121
To preview the documentation, run:

README.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -176,19 +176,11 @@ openai.chat.completions.create(
176176
)
177177
```
178178

179-
## Editor support
180-
181-
Some editor language services like [Solargraph](https://github.com/castwide/solargraph?tab=readme-ov-file#gem-support) or [Sorbet](https://sorbet.org/docs/rbi#the-hidden-definitions-rbi) require a manually triggered indexing step before functionalities like auto-completion and go to definition can operate.
182-
183-
Please refer to their respective documentation for details. This library also includes a [short guide](https://github.com/openai/openai-ruby/tree/main/CONTRIBUTING.md#editor-support) on how to set up various editor services for internal development.
184-
185-
## Advanced Concepts
186-
187-
### Model DSL
179+
## Model DSL
188180

189-
This library uses a Model DSL to represent request parameters and response shapes in `lib/openai/models`.
181+
This library uses a simple DSL to represent request parameters and response shapes in `lib/openai/models`.
190182

191-
The model classes service as anchor points for both toolchain readable documentation, and language service assisted navigation links. This information also allows the SDK's internals to perform translation between plain and rich data types; e.g., conversion between a `Time` instance and an ISO8601 `String`, and vice versa.
183+
With the right [editor plugins](https://shopify.github.io/ruby-lsp), you can ctrl-click on elements of the DSL to navigate around and explore the library.
192184

193185
In all places where a `BaseModel` type is specified, vanilla Ruby `Hash` can also be used. For example, the following are interchangeable as arguments:
194186

@@ -206,6 +198,12 @@ params = {
206198
}
207199
```
208200

201+
## Editor support
202+
203+
A combination of [Shopify LSP](https://shopify.github.io/ruby-lsp) and [Solargraph](https://solargraph.org/) is recommended for non-[Sorbet](https://sorbet.org) users. The former is especially good at go to definition, while the latter has much better auto-completion support.
204+
205+
## Advanced concepts
206+
209207
### Making custom/undocumented requests
210208

211209
#### Undocumented request params

0 commit comments

Comments
 (0)