From f64aed7c5f36ffd9738bef5986a447d82ed5a93a Mon Sep 17 00:00:00 2001 From: Fred Snyder Date: Fri, 2 Feb 2018 11:13:02 -0500 Subject: [PATCH 1/2] Configurable intellisense method. --- package.json | 6 ++++++ src/ruby.ts | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 560437ea3..bec9d4935 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/ruby.ts b/src/ruby.ts index 59550cb9d..3b464fc20 100644 --- a/src/ruby.ts +++ b/src/ruby.ts @@ -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(); } From 95898c808ca967c633a3e336c7b214342110ce21 Mon Sep 17 00:00:00 2001 From: Fred Snyder Date: Fri, 2 Feb 2018 11:20:04 -0500 Subject: [PATCH 2/2] Updated intellisense documentation in readme. --- readme.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 1bf6cc478..f8c840803 100644 --- a/readme.md +++ b/readme.md @@ -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.