Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Add ruby.intellisense configuration option #259

Merged
merged 4 commits into from
Feb 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@
"default": "solargraph",
"description": "Method to use for code completion."
},
"ruby.intellisense": {
"type": "string",
"enum": ["solargraph", "rubyLocate", "none"],
"default": "solargraph",
"description": "Method to use for intellisense (go to definition, etc.)."
},
"ruby.rctComplete.commandPath": {
"type": "string",
"default": "rct-complete",
Expand Down
16 changes: 15 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,21 @@ To enable method completion in Ruby, run `gem install solargraph` or `gem instal

For more information about using Solargraph, refer to the [Solargraph extension](https://marketplace.visualstudio.com/items?itemName=castwide.solargraph).

## Go to definition
## Intellisense (Go to/Peek Definition)

Use the `ruby.intellisense` setting to select a `go to/peek definition` method. Valid options are `solargraph`, `rubyLocate`, and `none`.

### Solargraph Intellisense

Make sure the solargraph gem installed:

```
gem install solargraph
```

Solargraph's features now extend to providing go to/peek definition. See the [Solargraph extension](https://marketplace.visualstudio.com/items?itemName=castwide.solargraph) for more information.

### RubyLocate Intellisense

Now includes workspace parsing functionality. Allows VS Code to `go to definition` and `peak definition` for modules, classes, and methods defined within the same workspace. You can set glob patterns to match including and excluding particular files. The exclude match also runs against directories on initial load, to reduce latency.

Expand Down
4 changes: 3 additions & 1 deletion src/ruby.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export function activate(context: ExtensionContext) {
registerCompletionProvider(context);
}
registerFormatter(context);
registerIntellisenseProvider(context);
if (vscode.workspace.getConfiguration('ruby').intellisense == 'rubyLocate') {
registerIntellisenseProvider(context);
}
registerTaskProvider(context);
utils.loadEnv();
}
Expand Down