A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/castwide/solargraph/issues/192 below:

Static type checker · Issue #192 · castwide/solargraph · GitHub

Gem version 0.33.0 introduces the first version of the static type checker. You can use it from the command line or add it to your editor's diagnostics.

Command Line

Run it from the command line:

cd /path/to/project
solargraph typecheck

The output will list all methods that have missing or invalid @return and @param tags.

To check a specific file only, use solargraph typecheck ./file.rb. (The type checker will still map the rest of the workspace for better accuracy.)

The optional --strict argument uses static code analysis to ensure that methods and params are tagged with the correct types. This option is highly experimental. You can expect a lot of false positives and potential bugs.

Language Server Diagnostics

You can get typecheck diagnostics from the language server with the typecheck reporter. Enable it by adding it to your workspace's .solargraph.yml:

For strict type checking (warning: expect bugs):

reporters:
- typecheck:strict

This is very much a work in progress. Any feedback is appreciated.

EdgarOrtegaRamirez and cmur2taylorthurlow, eirvandelden, ChrisZou, nitsujri, nickpelone and 11 more


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4