<commit_before># Visual Studio Code Ruby Extension

 [![Build Status](https://api.travis-ci.org/rubyide/vscode-ruby.svg?branch=master)](https://travis-ci.org/rubyide/vscode-ruby) [![Build status](https://ci.appveyor.com/api/projects/status/vlgs2y7tsc4xpj4c?svg=true)](https://ci.appveyor.com/project/rebornix/vscode-ruby)

This extension provides Ruby language and debugging support for VS Code.

## Table of Contents

<!---
markdown-toc --no-firsth1 --maxdepth 1 readme.md
-->
- [Install](#install)
- [Language Server](#language-server)
- [Debugger](#debugger)
- [Linters](#linters)
- [Formatting](#formatting)
- [Autocomplete](#autocomplete)
- [Intellisense (Go to/Peek Definition/Symbols)](#intellisense-go-topeek-definitionsymbols)
- [Contributing](#contributing)
- [License](#license)

Also see the [CHANGELOG](CHANGELOG.md).

## Install

Press `F1`, type `ext install` then search for `ruby`.

### Gem Dependencies

Depending on your setup, you may need to manually install gem dependencies like
`rubocop`, `ruby-debug-ide` or `solargraph`. This can be complicated because
there are many different ways to use Ruby itself - system ruby, rbenv, chruby,
rvm, bundler, etc. Your results may also vary depending on how you start VS Code
and the environment variables present at that time.

The important thing is that if VS Code can't find `rubocop`, our extension can't
either. One way to debug these problems is to investigate within VS Code's
Integrated Terminal. (View > Integrated Terminal). Try `ruby -v`, `gem env
gemdir`, `gem list | grep rubocop`, `which rubocop` and then `rubocop -v`. This
might shed some light on why a gem dependency isn't working.

## Language Server
As of version v0.22.0, a new language server has been introduced into the extension. This server provides the following features:

* Multi-root support
* Balanced pairs (eg `def-end`, `if-end`, etc) highlighting
* Syntax aware code folding
* Diagnostics support (eg lint) with [rubocop](https://github.com/rubocop-hq/rubocop), [reek](https://github.com/troessner/reek), and [standard](https://github.com/testdouble/standard)
* Document/selection formatting support for [rubocop](https://github.com/rubocop-hq/rubocop), [standard](https://github.com/testdouble/standard), and [rufo](https://github.com/ruby-formatter/rufo)
* `DocumentSymbol` support which enables features line the Outline view

The server is designed to slowly replace existing extension functionality. Users can choose to replace that functionality with that of the language server's via the `useLanguageServer` configuration option (set it to `true`). You can verify the server is running via the "Output" tab in VSCode (next to the Terminal).

### Feature Requests
The language server is under active development. You can check [Issue 317](https://github.com/rubyide/vscode-ruby/issues/317) to see the currently proposed feature list. Please do not open GitHub issues for unimplemented features that are already on that list!

## Debugger
### Install Ruby Dependencies
In this extension, we implement [ruby debug ide protocol](http://debug-commons.rubyforge.org/protocol-spec.html) to allow VS Code to communicate with ruby debug, it requires `ruby-debug-ide` to be installed on your machine. This is also how RubyMine/NetBeans does by default.<commit_msg>README update for viewing language server output<commit_after># Visual Studio Code Ruby Extension

 [![Build Status](https://api.travis-ci.org/rubyide/vscode-ruby.svg?branch=master)](https://travis-ci.org/rubyide/vscode-ruby) [![Build status](https://ci.appveyor.com/api/projects/status/vlgs2y7tsc4xpj4c?svg=true)](https://ci.appveyor.com/project/rebornix/vscode-ruby)

This extension provides Ruby language and debugging support for VS Code.

## Table of Contents

<!---
markdown-toc --no-firsth1 --maxdepth 1 readme.md
-->
- [Install](#install)
- [Language Server](#language-server)
- [Debugger](#debugger)
- [Linters](#linters)
- [Formatting](#formatting)
- [Autocomplete](#autocomplete)
- [Intellisense (Go to/Peek Definition/Symbols)](#intellisense-go-topeek-definitionsymbols)
- [Contributing](#contributing)
- [License](#license)

Also see the [CHANGELOG](CHANGELOG.md).

## Install

Press `F1`, type `ext install` then search for `ruby`.

### Gem Dependencies

Depending on your setup, you may need to manually install gem dependencies like
`rubocop`, `ruby-debug-ide` or `solargraph`. This can be complicated because
there are many different ways to use Ruby itself - system ruby, rbenv, chruby,
rvm, bundler, etc. Your results may also vary depending on how you start VS Code
and the environment variables present at that time.

The important thing is that if VS Code can't find `rubocop`, our extension can't
either. One way to debug these problems is to investigate within VS Code's
Integrated Terminal. (View > Integrated Terminal). Try `ruby -v`, `gem env
gemdir`, `gem list | grep rubocop`, `which rubocop` and then `rubocop -v`. This
might shed some light on why a gem dependency isn't working.

## Language Server
As of version v0.22.0, a new language server has been introduced into the extension. This server provides the following features:

* Multi-root support
* Balanced pairs (eg `def-end`, `if-end`, etc) highlighting
* Syntax aware code folding
* Diagnostics support (eg lint) with [rubocop](https://github.com/rubocop-hq/rubocop), [reek](https://github.com/troessner/reek), and [standard](https://github.com/testdouble/standard)
* Document/selection formatting support for [rubocop](https://github.com/rubocop-hq/rubocop), [standard](https://github.com/testdouble/standard), and [rufo](https://github.com/ruby-formatter/rufo)
* `DocumentSymbol` support which enables features line the Outline view

The server is designed to slowly replace existing extension functionality. Users can choose to replace that functionality with that of the language server's via the `useLanguageServer` configuration option (set it to `true`). You can verify the server is running via the "Output" tab in VSCode (next to the Terminal) and selecting "Ruby Language Server" from the dropdown to the right.

### Feature Requests
The language server is under active development. You can check [Issue 317](https://github.com/rubyide/vscode-ruby/issues/317) to see the currently proposed feature list. Please do not open GitHub issues for unimplemented features that are already on that list!

## Debugger
### Install Ruby Dependencies
In this extension, we implement [ruby debug ide protocol](http://debug-commons.rubyforge.org/protocol-spec.html) to allow VS Code to communicate with ruby debug, it requires `ruby-debug-ide` to be installed on your machine. This is also how RubyMine/NetBeans does by default.
{'fraction_non_alphanumeric': 0.10947493678417373, 'fraction_numerical': 0.0050572661014428085, 'mean_word_length': 5.068592057761733, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 22, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5335598', 'n_tokens_mistral': 2032, 'n_tokens_neox': 1894, 'n_words': 738}