Skip to content

Commit

Permalink
Documentation updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
castwide committed Jul 5, 2018
1 parent 809cfa5 commit 1fc140c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
28 changes: 23 additions & 5 deletions LANGUAGE_SERVER.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Solargraph supports the language server protocol as of gem version 0.18.0. The V

## Using the Language Server

Run `solargraph socket` to use the language server over a TCP socket. The default port is 7658.
Run `solargraph stdio` to use the language server via stdio.

Run `solargraph socket` to use the language server via TCP socket. The default port is 7658.

## Supported Capabilities

Expand All @@ -14,9 +16,15 @@ Run `solargraph socket` to use the language server over a TCP socket. The defaul
* Definition
* Document symbols
* Workspace symbols
* Rename symbols
* References
* Formatting
* Diagnostics (linting)

## Work in Progress

* On type formatting

## Custom Features

Solargraph's language server extends the protocol with additional methods for inline document pages.
Expand All @@ -25,8 +33,18 @@ Solargraph's language server extends the protocol with additional methods for in

Solargraph uses RuboCop for linting and formatting.

## Work in Progress
## Diagnostics Reporters

* On type formatting
* References
* Rename symbols
A .solargraph.yml file can be used to select which diagnostics reporters Solargraph should use. The currently supported reporters are
`rubocop` and `require_not_found`. Example:

```
reporters:
- rubocop
- require_not_found
```

`rubocop` enables RuboCop linting. Its rules can be configured in a .rubocop.yml file.

`require_not_found` highlights `require` calls where Solargraph could not resolve a required path. Note that this error does not
necessarily mean that the path is incorrect; only that Solargraph was unable to recognize it.
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,19 @@ Solargraph uses [parser](https://github.com/whitequark/parser) for code analysis

## Using the `solargraph` Executable

The gem includes an executable that provides access to the library's features. For code completion, IDEs will typically integrate using `solargraph socket` or `solargraph suggest`.
The gem includes an executable that provides access to the library's features. For code completion, IDEs will typically integrate using `solargraph stdio` or `solargraph socket`.

### Language Server Protocol

The language server protocol is the recommended way for integrating Solargraph into editors and IDEs. Run `solargraph socket` to start a language server using
a TCP transport. The default port is 7658.
The language server protocol is the recommended way for integrating Solargraph into editors and IDEs. Clients can connect using either stdio or TCP.
See [LANUAGE_SERVER.md](LANGUAGE_SERVER.md) for more information.

### Standalone Suggest

The suggest subcommand provides an interface to request suggestions without the need for a server. When executed, it accepts the parameters for a suggestion request, returns the suggestions in JSON format, and exits.

**Warning:** The suggest subcommand is a candidate for deprecation. It will either change drastically or not exist in a future version.

## Integrating Solargraph into Other IDEs

Documentation for Solargraph integration is forthcoming. In the meantime, refer to the [VS Code extension](https://github.com/castwide/vscode-solargraph) source for an example.

## Updating the Core Documentation

The Solargraph gem ships with documentation for Ruby 2.2.2. As of gem version 0.15.0, there's an option to download additional documentation for other Ruby versions from the command line.
Expand Down Expand Up @@ -98,8 +94,8 @@ Unable to load the EventMachine C extension; To use the pure-ruby reactor, requi
This is due to a problem compiling the native EventMachine extension on Windows. The workaround is to install the pure Ruby version:

```
> gem uninstall eventmachine
> gem install eventmachine --platform ruby -- --use-system-libraries
$ gem uninstall eventmachine
$ gem install eventmachine --platform ruby -- --use-system-libraries
```

More information: https://github.com/eventmachine/eventmachine/issues/820#issuecomment-368267506
2 changes: 1 addition & 1 deletion SERVER.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Solargraph Server Documentation

**NOTE: The legacy web server is deprecated and no longer available as of gem version 0.18.0. It is highly recommended that client implementors use the [language server protocol](LANGUAGE_SERVER.md) if possible.**
**NOTE: The legacy web server is deprecated and no longer available as of gem version 0.21.0. This document is archived for the benefit of extensions and plugins that still use it. Client implementors should use the [language server protocol](LANGUAGE_SERVER.md) instead.**

## Running the Server

Expand Down

0 comments on commit 1fc140c

Please sign in to comment.