rubyide / vscode-ruby Goto Github PK
View Code? Open in Web Editor NEWProvides Ruby language and debugging support for Visual Studio Code
Home Page: https://marketplace.visualstudio.com/items?itemName=rebornix.Ruby
License: MIT License
Provides Ruby language and debugging support for Visual Studio Code
Home Page: https://marketplace.visualstudio.com/items?itemName=rebornix.Ruby
License: MIT License
vscode-ruby
version: 0.6.0I'm trying to run my rails app from VScode using the extension but I just can't.
I have this in my lauch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Rails server",
"type": "Ruby",
"request": "launch",
"cwd": "/home/AMER/ggrasso/src/unisporkal/account",
"program": "/home/AMER/ggrasso/.rvm/gems/ruby-2.3.1@unisporkal/bin/rails",
"args": [
"server"
]
}
]}
Rails server starts and I can browse my app.
I'm only seeing the status bar blink in red once and this message in the Output console: "waiting for debug protocol on stdin/stdout"
Nothing else happens.
The program path seems to be correct because if I change it then there is an error in the debugger console because it can't find rails.
Is there a log that I can look at to see what's the underlying error?
Thanks,
German
vscode-ruby
version: 0.3.4vscode-ruby
, is it taking the system installed one?Make sure you have ruby
, ruby-debug-ide
and ruby-debug-basex19
installed before submitting your issue -- thank you !
It should show syntax highlighting correctly for string literals with % notation
It doesn't recognise at all the syntax %q(...)
or %w(...)
; it wrongly assumes that the string will terminate at the first }
, with %Q(})
and %r(})
(this one is actually a literal regex, but anyway).
Just type the following valid ruby code:
a = %Q({}z')
b = 4
This should highlight the string {}z'
.
It will instead highlight two strings, %Q({}
and ')
till the next '
.
a = %q(33)
Here, it should highlight the string %q(33)
; instead, it doesn't recognise %q
as a prefix for string literals.
vscode-ruby
version: 0.9.0vscode-ruby configuration:
"ruby.lint": {
"rubocop": true,
"debride": true,
"ruby": true,
"reek": true,
"fasterer": true
}
Linters are called during file opening/saving only. If linters are called during the file modification, they should be throttled to avoid linters call 20 times for 20 characters.
Assumption: linters are called for each file modification. If I type something pretty fast, I run into a huge system load and have to wait a bit for a cooldown :)
vscode-ruby
version: 0.6.0Hello there, a few months ago I created an extension that declared the filetype "Dangerfile" to be a Ruby source file:
"contributes": {
"languages": [{
"id": "ruby",
"aliases": ["Ruby", "ruby"],
"filenamePatterns": [
"Dangerfile"
]
}]
},
Which has broken at some point in the last month, maybe on 1.5.0 or this extension being updated? Do you know if I've done something wrong? The official docker package uses this syntax but I guess it's not trying to use someone else's language implementation
Issue reported by @ronen-burin
OS: Mac
Reproduce steps:
rdebug-ide --host 127.0.0.1 --port 1234 ~/.rvm/gems/ruby-2.2.3/gems/thin-1.5.0/lib/thin start
Listen to rdebug-ide
configuration as below{
"name": "Listen for rdebug-ide",
"type": "Ruby",
"request": "attach",
"cwd": "${workspaceRoot}",
"remoteHost": "127.0.0.1",
"remotePort": "1234",
"remoteWorkspaceRoot": "${workspaceRoot}"
}
But VS Code doesn't connect to rdebug-ide.
vscode-ruby
version: 0.5.2Verified ruby
, ruby-debug-ide
and ruby-debug-basex19
installed
Should be able to run ruby scripts that use the gem 'xcodeproj' using VS Code
When executing the script from visual studio code using ruby extension I get the following error:
Uncaught exception: invalid byte sequence in US-ASCII
/usr/local/lib/ruby/gems/2.3.0/gems/xcodeproj-1.2.0/lib/xcodeproj/plist.rb:86:in `match'
/usr/local/lib/ruby/gems/2.3.0/gems/xcodeproj-1.2.0/lib/xcodeproj/plist.rb:86:in `match'
/usr/local/lib/ruby/gems/2.3.0/gems/xcodeproj-1.2.0/lib/xcodeproj/plist.rb:86:in `file_in_conflict?'
/usr/local/lib/ruby/gems/2.3.0/gems/xcodeproj-1.2.0/lib/xcodeproj/plist.rb:19:in `read_from_path'
/usr/local/lib/ruby/gems/2.3.0/gems/xcodeproj-1.2.0/lib/xcodeproj/project.rb:200:in `initialize_from_file'
/usr/local/lib/ruby/gems/2.3.0/gems/xcodeproj-1.2.0/lib/xcodeproj/project.rb:102:in `open'
/Users/XXXXXX/script.rb:4:in `<top (required)>'
/usr/local/bin/rdebug-ide:23:in `load'
/usr/local/bin/rdebug-ide:23:in `<main>'
/usr/local/lib/ruby/gems/2.3.0/gems/xcodeproj-1.2.0/lib/xcodeproj/plist.rb:86:in `match': invalid byte sequence in US-ASCII (ArgumentError)
from /usr/local/lib/ruby/gems/2.3.0/gems/xcodeproj-1.2.0/lib/xcodeproj/plist.rb:86:in `match'
from /usr/local/lib/ruby/gems/2.3.0/gems/xcodeproj-1.2.0/lib/xcodeproj/plist.rb:86:in `file_in_conflict?'
from /usr/local/lib/ruby/gems/2.3.0/gems/xcodeproj-1.2.0/lib/xcodeproj/plist.rb:19:in `read_from_path'
from /usr/local/lib/ruby/gems/2.3.0/gems/xcodeproj-1.2.0/lib/xcodeproj/project.rb:200:in `initialize_from_file'
from /usr/local/lib/ruby/gems/2.3.0/gems/xcodeproj-1.2.0/lib/xcodeproj/project.rb:102:in `open'
from /Users/XXXXXXX/script.rb:4:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.3.0/gems/ruby-debug-ide-0.6.0/lib/ruby-debug-ide.rb:88:in `debug_load'
from /usr/local/lib/ruby/gems/2.3.0/gems/ruby-debug-ide-0.6.0/lib/ruby-debug-ide.rb:88:in `debug_program'
A ruby script that use 'xcodeproj' gem:
#!/usr/bin/env ruby
require 'xcodeproj'
project = Xcodeproj::Project.open("/Users/ido/projects/sample/sample.xcodeproj")
I had a similar issue on a jenkins slave and managed to solve it by running the following commands before running the ruby script:
export LANG=en_US.UTF-8
export LC_COLLATE=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8
export LC_MESSAGES=en_US.UTF-8
export LC_MONETARY=en_US.UTF-8
export LC_NUMERIC=en_US.UTF-8
export LC_TIME=en_US.UTF-8
export LC_ALL=en_US.UTF-8
I didn't find any way to set the environment variable in VS Code before executing the ruby script
vscode-ruby
version: 1.4 not installingMake sure you have ruby
, ruby-debug-ide
and ruby-debug-basex19
installed before submitting your issue -- thank you !
Linting has stopped working for me in version 0.10.0
my settings.json and setup are unchanged.
"ruby.lint": {
"reek": false,
"rubocop": true,
"ruby": true,
"fasterer": false,
"debride": false,
"ruby-lint": false
}
These are the errors I get in the console not sure if they are related or not.
threadService.ts:222 [Extension Host] Uncaught Exception: Error: write EPIPE(anonymous function) @ threadService.ts:222emitTwo @ events.js:106emit @ events.js:191process.nextTick @ internal/child_process.js:744_combinedTickCallback @ internal/process/next_tick.js:67_tickCallback @ internal/process/next_tick.js:98
threadService.ts:222 [Extension Host] Error: write EPIPE
at exports._errnoException (util.js:1026:11)
at WriteWrap.afterWrite (net.js:795:14)(anonymous function) @ threadService.ts:222emitTwo @ events.js:106emit @ events.js:191process.nextTick @ internal/child_process.js:744_combinedTickCallback @ internal/process/next_tick.js:67_tickCallback @ internal/process/next_tick.js:98
shell.ts:441 write EPIPE: Error: write EPIPE
at exports._errnoException (util.js:1026:11)
at WriteWrap.afterWrite (net.js:795:14)
vscode-ruby
version: 0.10.1Brackets (parantheses, etc.) should match inside strings. For example:
s = "hello, #{name}"
s = "hello, #{get_name(name)}"
s = "hello, #{[name].join}"
None of these do bracket matching — neither highlight nor editor.action.jumpToBracket
.
I expected bracket matching to work. Both highlighting of matching brackets, and jumping via editor.action.jumpToBracket
.
vscode-ruby
version: 0.3.1Make sure you have ruby
, ruby-debug-ide
and ruby-debug-basex19
installed before submitting your issue -- thank you !
Debugging a local script to work
Uncaught exception: cannot load such file -- some_gem/version
/Users/d/.rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/Users/d/.rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/Users/d/work/some_gem/lib/some_gem.rb:1:in `<top (required)>'
/Users/d/.rbenv/versions/2.3.0/bin/rdebug-ide:23:in `load'
/Users/d/.rbenv/versions/2.3.0/bin/rdebug-ide:23:in `<main>'
/Users/d/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- some_gem/version (LoadError)
Looks like this debugger extension has no concept of bundler? 'some_gem' is a gem that is installed in the current directory. Bundler output:
Using some_gem 0.1.0 from source at``.
The correct thing would be to run "bundle exec ", not just "" in order for gems to be resolved.
vscode-ruby
version: 0.3.1I have some objects setup with a custom implementation of inspect. When I refer to these objects in the VSCode console during a debug session, I expect to see something like this:
-------------------
| Custom | Output |
-------------------
The line breaks are not evaluated and instead I get this:
-------------------\n| Custom | Output |\n-------------------
I can get it to print properly in the console by typing "puts obj.inspect", but it should really display the right thing if I just type "obj", just like it would in an IRB session for example.
From this issue it sounds like VSCode internally has an API to produce multi-line output, and there doesn't seem to be anyway for me to influence this by changing the formatting of my inspect string.
So I was wondering if vscode-ruby could/should be splitting inspect output by newlines and presenting these to the console API as multiple lines?
Thanks again for vscode-ruby btw, its really great and has come on a lot in such a short time!
vscode-ruby
version: 0.6.0Install Ruby
Open VS code
Install Ruby extension
write simple main.rb
file:
def hi(name)
puts "Hello #{name}"
end
hi("there")
Press F5 to create a launch.json
Choose the 'debug local file' option
Press F5 again
Result: Nothing happens
Expected: Prompt that says "ruby-debug-ide" is not installed
Better yet, can we install this on first activation of the extension?
vscode-ruby
version: 0.5.6No spaces around equal sign should keep correct syntax highlighting for the rest of the code:
When having no spaces around equal sign I see the rest of the highlighting broken:
Type in a few lines of code according to the ones seen in above screenshots.
From @AlminCode on July 12, 2016 7:57
Steps to Reproduce:
Copied from original issue: microsoft/vscode#9117
vscode-ruby
version: 0.5.2config looks like:
{
"name": "Listen for rdebug-ide",
"type": "Ruby",
"request": "attach",
"cwd": "${workspaceRoot}",
"remoteHost": "127.0.0.1",
"remotePort": "1234",
"remoteWorkspaceRoot": "${workspaceRoot}"
}
Make sure you have ruby
, ruby-debug-ide
and ruby-debug-basex19
installed before submitting your issue -- thank you !
on remote server I:
$ rdebug-ide try.rb
Fast Debugger (ruby-debug-ide 0.6.0, debase 0.2.1, file filtering is supported) listens on 127.0.0.1:1234
I have ssh tunnel to remote host on same port.
I set a breakpoint in the code.
I click run in debugger.
expect debugger to stop at breakpoint, It doesn't it runs the program to completion.
doesn't stop at breakpoint.
vscode-ruby
version: 0.5.2No warning when I add:
# rubocop: disable MethodLength
Unnecessary disabling of 'Metrics\MethodLength'. (Lint/UnneededDisable)
Use the following block of code. Run RuboCop from the command prompt command line. Notice there are 17 lines (8 of which are blank), so it triggers the MethodLength warning.
def a
puts '1'
puts '2'
puts '3'
puts '4'
puts '5'
puts '6'
puts '7'
puts '8'
puts '9'
end
Adding the disable for MethodLength:
# rubocop: disable MethodLength
removes the warning from the command-prompt window, but VS Code then gives the following warning (and highlights the line above):
Unnecessary disabling of 'Metrics\MethodLength'. (Lint/UnneededDisable)
It seems to be an issue caused by the empty lines in the method. If I put 17 lines of actual code, neither VS Code or the command-line report an error.
Christoph
GE Healthcare
Sorry, may be I am too early while this extension seems like in test phase, I am getting error as below (Ruby 1.9.3 p551), on windows 7 x64 ent.
spawn rdebug-ide ENOENT
Debugger client error, Error: This socket is closed.
also tried with Ruby 2.0 or 2.2 with x64, cannot install ruby-debug-base19x
Thanks for the help.
vscode-ruby
version: 0.3.1Make sure you have ruby
, ruby-debug-ide
and ruby-debug-basex19
installed before submitting your issue -- thank you !
I have the following, ruby-debug-basex19
is maybe a typo or something? It doesn't seem to be a published gem.
*** LOCAL GEMS ***
ap (0.1.1)
bigdecimal (1.2.6)
debase (0.2.1)
debase-ruby_core_source (0.8.4)
httparty (0.13.7)
io-console (0.4.3)
json (1.8.1)
minitest (5.4.3)
multi_xml (0.5.5)
power_assert (0.2.2)
psych (2.0.8)
rake (10.4.2)
rdoc (4.2.0)
ruby-debug-ide (0.4.32)
test-unit (3.0.8)
For this script, with a breakpoint on line 2, I expect that step out (shift-f11
) would put move forward the current line to line 6. Basically, you can see the expected behavior if you also put a breakpoint on line 6, and step out of line 2.
def hello what
"hello #{what}" # breakpoint here, then shift-f11
end
pp hello("world")
pp "whatever" # expected control to move here
Script prints both lines of output and exits
With the ruby 2 setup from the readme, paste this script in, put in the breakpoint on line 2, start debugging, hit shift f11, observe.
The code runs perfectly in extension mode or test pipeline, but if you try to develop in server mode, in which case you can set breakpoints to the debugger adapter, it breaks as below
seems currently server mode doesn't have a good support for ES7 methods.
BTW, even if I convert these methods to ES5 style, Variables are missing, it's likely a bug.
Mac OSX
vscode-ruby
version: plugin version 0.3.0Make sure you have ruby
, ruby-debug-ide
and ruby-debug-basex19
installed before submitting your issue -- thank you !
start debugger
Debugger error: Client: Error: getaddrinfo ENOTFOUND localhost undefined:1234
Is there a way to support shotgun for plain sinatra rack apps?
vscode-ruby
version: 0.10.0Make sure you have ruby
, ruby-debug-ide
and ruby-debug-basex19
installed before submitting your issue -- thank you !
Press F12 (or choose 'Go to definition' on right click menu) when cursor is on a method/module name, then editor jump to the definition of this method/module. (vscode-ruby v0.9.0 works like this.)
(After upgraded vscode-ruby to v0.10.0) Nothing happens after press F12. And there is no 'Go to definition' in right click menu.
vscode-ruby
version: 0.5.1Make sure you have
ruby
,ruby-debug-ide
andruby-debug-basex19
installed before submitting your issue -- thank you !
Well I don't have ruby-debug-base installed, as it seems to be relevant for 1.9 versions only
Possible to debug sinatra based app.
Fails while launching the debug with err:
/usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/specification.rb:2158:in `method_missing': undefined method `this' for #<Gem::Specification:0x75be58 debase-0.2.1> (NoMethodError)
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/specification.rb:1057:in `find_active_stub_by_path'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:64:in `require'
from /usr/local/rvm/gems/ruby-2.3.0/gems/debase-0.2.1/lib/debase.rb:4:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from /usr/local/rvm/gems/ruby-2.3.0/gems/ruby-debug-ide-0.6.0/lib/ruby-debug-ide.rb:8:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.3.0/gems/ruby-debug-ide-0.6.0/bin/rdebug-ide:8:in `require_relative'
from /usr/local/rvm/gems/ruby-2.3.0/gems/ruby-debug-ide-0.6.0/bin/rdebug-ide:8:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.3.0/bin/rdebug-ide:23:in `load'
from /usr/local/rvm/gems/ruby-2.3.0/bin/rdebug-ide:23:in `<main>'
from /usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
from /usr/local/rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
cloned project:
clone https://github.com/datarator/datarator.git
cd datarator
code .
opened in vstudio and created launch config with contents:
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Local File",
"type": "Ruby",
"request": "launch",
"program": "${workspaceRoot}/config.ru"
}
]
}
Tried to debug, resulting in error above.
I'm prototyping with rsense
but for now it lacks support for Windows platform. Will drop more info here later on.
vscode-ruby
version: 0.10.3I am getting an error while trying to start the rails server from the debug view.
Here's the relevant part of launch.json
:
{
"version": "0.2.0",
"configurations": [
...
{
"name": "Rails server",
"type": "Ruby",
"request": "launch",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}/bin/rails",
"args": [
"server"
]
}
...
]
}
The rails server to start.
Uncaught exception: invalid byte sequence in US-ASCII
/Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/yaml_serializer.rb:55:in `split'
/Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/yaml_serializer.rb:55:in `load'
/Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/settings.rb:287:in `block in load_config'
/Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/shared_helpers.rb:105:in `filesystem_access'
/Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/settings.rb:283:in `load_config'
/Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/settings.rb:43:in `initialize'
/Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler.rb:209:in `new'
/Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler.rb:209:in `settings'
/Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler.rb:438:in `configure_gem_path'
/Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler.rb:433:in `configure_gem_home_and_path'
/Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler.rb:62:in `configure'
/Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler.rb:126:in `definition'
/Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler.rb:93:in `setup'
/Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/setup.rb:20:in `<top (required)>'
/Users/username/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:133:in `require'
/Users/username/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:133:in `rescue in require'
/Users/username/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
/Users/username/work/sso/bin/rake:15:in `<top (required)>'
/Users/username/.rbenv/versions/2.3.1/bin/rdebug-ide:22:in `load'
/Users/username/.rbenv/versions/2.3.1/bin/rdebug-ide:22:in `<main>'
/Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/yaml_serializer.rb:55:in `split': invalid byte sequence in US-ASCII (ArgumentError)
from /Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/yaml_serializer.rb:55:in `load'
from /Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/settings.rb:287:in `block in load_config'
from /Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/shared_helpers.rb:105:in `filesystem_access'
from /Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/settings.rb:283:in `load_config'
from /Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/settings.rb:43:in `initialize'
from /Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler.rb:209:in `new'
from /Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler.rb:209:in `settings'
from /Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler.rb:438:in `configure_gem_path'
from /Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler.rb:433:in `configure_gem_home_and_path'
from /Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler.rb:62:in `configure'
from /Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler.rb:126:in `definition'
from /Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler.rb:93:in `setup'
from /Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/setup.rb:20:in `<top (required)>'
from /Users/username/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:133:in `require'
from /Users/username/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:133:in `rescue in require'
from /Users/username/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from /Users/username/work/sso/bin/rake:15:in `<top (required)>'
from /Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/ruby-debug-ide-0.6.0/lib/ruby-debug-ide.rb:88:in `debug_load'
from /Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/ruby-debug-ide-0.6.0/lib/ruby-debug-ide.rb:88:in `debug_program'
from /Users/username/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/ruby-debug-ide-0.6.0/bin/rdebug-ide:130:in `<top (required)>'
from /Users/username/.rbenv/versions/2.3.1/bin/rdebug-ide:22:in `load'
from /Users/username/.rbenv/versions/2.3.1/bin/rdebug-ide:22:in `<main>'
Rails server
from the dropdownvscode-ruby
version: 0.8.0Make sure you have ruby
, ruby-debug-ide
and ruby-debug-basex19
installed before submitting your issue -- thank you !
editors should show rubocop lint output
after latest update and restart of VS Code, editing 'user settings' or 'workspace settings' produces a single item in the warnings pane reading 'Value is not an accepted value. Valid values: ["rubocop"](767, 20)'
The default settings can't be edited, so this error can't be fixed.
vscode-ruby
version: 0.5.6It'd be great to have some formatting/beautifying functionality in the vscode-ruby plugin.
As for now, there is no way to format/beautify .rb and .erb files inside vscode in a proper way.
I worked around this by:
htmlbeautifier
and rbeautify
gems.Tasks
file as follows:{
"version": "0.1.0",
"command": "sh",
"args": ["-c"],
"isShellCommand": false,
"showOutput": "never",
"suppressTaskName": true,
"tasks": [
{
"taskName": "Ruby format",
"args": ["rbeautify ${file}"]
},
{
"taskName": "ERB format",
"args": ["htmlbeautifier ${file}"]
}
]
}
Hi,
Wonderful repo you have. Been reading over source and docs to understand what's going and it's been easy to understand.
I'm a fairly new user to WSL (Windows Subsystem for Linux) and wanted to get VSCode (installed in Windows) playing nicely with ruby installation in Bash on Windows. I feel like I could follow https://github.com/rubyide/vscode-ruby/wiki/3.-Attaching-to-a-debugger but I'm not 100% sure how to translate the steps.
Would you consider adding a specific tutorial, instructions, or example config for using WSL ruby installation and VS Code (installed on windows)?
Thanks
vscode-ruby
version: 0.5.2Syntax highlighting should continue to work.
Highlighting broken when using the symbol index
with a division sign \
Create a new ruby file with the following code:
test = index / 1
puts 'I should be syntax highlighted! (But I am not).'
vscode-ruby
version: latest (as of July 12th)Make sure you have ruby
, ruby-debug-ide
and ruby-debug-basex19
installed before submitting your issue -- thank you !
Open a ruby file, press cmd-shift-O and see a list of symbols from the file to go to
Open a ruby file, press cmd-shift-O and see "Unfortunately we have no symbol information for the file"
Open a ruby file, press cmd-shift-O and see "Unfortunately we have no symbol information for the file"
vscode-ruby
version: 0.5.2Make sure you have ruby
, ruby-debug-ide
and ruby-debug-basex19
installed before submitting your issue -- thank you !
the debugger doesn't stop on the line after removing the breakpoint
the debugger does stop on the line
click to the left of a line in main.rb to set a breakpoint, line 12 below for example
debug the local ruby script,
after the debugger stops at the line, click to the left of the line to remove the breakpoint
continue the script and then the debugger still stops as if there were a breakpoint
main.rb
file = File.read("test.txt")
words = {}
file.split.each {|aword|
count = words[aword]
if count
count = count + 1
else
count = 1
end
words = words.merge aword=>count
}
words.each { |key, value|
puts "The word #{key} accours #{value} times"
}
vscode-ruby
version: 0.10.3Make sure you have ruby
, ruby-debug-ide
and ruby-debug-basex19
installed before submitting your issue -- thank you !
ruby-debug-basex19
Rails runs
Rails starts (perhaps) and stops. See here:
Use this launch.json setting, hit run:
{
"name": "Rails server",
"type": "Ruby",
"request": "launch",
"showDebuggerOutput": true,
"useBundler": true,
"cwd": "${workspaceRoot}",
"program": "/home/rje/.rvm/gems/ruby-2.3.0/bin/bundle",
"args": [ "exec", "rails", "s" ]
}
vscode-ruby
version: 0.5.2When coding in Ruby, there seems to be an issue with the auto-indent. What I expect to have
def test_foo
if cond == true
p 'hello'
end
end
This is the code that I get
def test_foo
if cond == true
p 'hello'
end
end
vscode-ruby
version: 0.8.0Make sure you have ruby
, ruby-debug-ide
and ruby-debug-basex19
installed before submitting your issue -- thank you !
when i use a variable and call autocomplete it should list all methods of this variable
autocomplete work only if the variable is outside the method
[1, 2, 3].e => inside a method does nothing
[1, 2, 3].e => outside methods autocomplete works as expected
vscode-ruby
version: 0.6.0I'm trying to debug a basic Hello World app that requires basic console input (e.g. gets.chomp) via VSCode. The integrated Debug Console does not support user input so I'd like to launch an external console (this is supported in the Python and Node debuggers, for instance), but this does not seem to be currently supported. This would be a very nice feature for those getting started with Ruby who want to use VSCode.
launch.json has a "externalConsole": true option in the configuration that launches an the console as an external window. This matches the Node debugger behavior.
This option is not available so anything that uses gets will be blocked forever waiting for user input.
Would it be possible to add indentation support?
That would be really great!
vscode-ruby
version: 0.10.0Extension should be loaded and work
Extension does not work. In the vscode log I see following:
threadService.ts:222[Extension Host] Activating extension `rebornix.Ruby` failed: Cannot find module './lint/LintCollection'(anonymous function) @ threadService.ts:222
threadService.ts:222[Extension Host] Here is the error stack: Error: Cannot find module './lint/LintCollection'
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Function.N.n._load (/opt/vscode/resources/app/out/vs/workbench/node/extensionHostProcess.js:13:19970)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/artem/.vscode/extensions/rebornix.Ruby-0.10.0/ruby.js:8:22)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
vscode-ruby
version: 0.3.3Make sure you have ruby
, ruby-debug-ide
and ruby-debug-basex19
installed before submitting your issue -- thank you !
given this code
indexName = ARGV[0] || 'indexName'
typeName = ARGV[1] || 'typeName'
sourceFilename = ARGV[2] || 'sourceFileName'
puts " indexName: #{indexName}"
puts " typeName: #{typeName}"
puts "sourceFilename: #{sourceFilename}"
indexName: indexName
typeName: typeName
sourceFilename: sourceFileName
indexName: undefined
typeName: typeName
sourceFilename: sourceFileName
running included code through the commandline: ruby filename.rb works as expected
running debugging code through visualstudiocode ARGV[0] returns 'undefined' instead of nil.
to reproduce add ARGV[0], ARGV[1], ARGV[2] to watches...
vscode-ruby
version: 0.9.0Debug a rails app using foreman
I can't execute debug using foreman start
Cheers
vscode-ruby
version: 0.3.1Make sure you have ruby
, ruby-debug-ide
and ruby-debug-basex19
installed before submitting your issue -- thank you !
When I try to debug a rb file I receive following message
Debugger terminal error: Process failed: spawn rdebug-ide ENOENT
I'm receiving also this warning while I'm trying to install gems
WARNING: You don't have /root/.gem/ruby/2.3.0/bin in your PATH,
gem executables will not run.
vscode-ruby
version: 0.3.4Make sure you have ruby
, ruby-debug-ide
and ruby-debug-basex19
installed before submitting your issue -- thank you !
I am trying to pass arguments to my script when running main.rb in debug mode and having trouble getting anything.
I am trying to capture them with ARGV array but it keeps coming in as empty. I thought at first to use the args array in the launch.json file, but realised this was passing parameters to the debugger.
I have tried using the reuntimeArgs: node to read in my runtime parameters, but the array read by ARGV is always empty.
It's more about how to pass runtime script parameters into the ruby script to be picked up by ARGV?
{ "name": "Debug Local File", "type": "Ruby", "request": "launch", "program": "${workspaceRoot}/main.rb",
I have tried
"runtimeArgs": [ "--MyParam1 testvalue1", "--MyParam2 testvalue2" ]
I have tried
"runtimeArgs": [ "--MyParam1 testvalue1 --MyParam2 testvalue2" ]
And I have tried
"runtimeArgs": [ "--MyParam1", "testvalue1", "--MyParam2", "testvalue2" ]
Can you please give me an indication of how to pass these parameters to the main.rb
Thanks
Brett
vscode-ruby
version: 0.8Make sure you have ruby
, ruby-debug-ide
and ruby-debug-basex19
installed before submitting your issue -- thank you !
I'm trying to install ruby-debug-ide but it does not work:
~ gem install ruby-debug-ide -v 0.4.32
Building native extensions. This could take a while...
ERROR: Error installing ruby-debug-ide:
ERROR: Failed to build gem native extension.
current directory: /home/c0m3tx/.gem/ruby/2.3.0/gems/ruby-debug-ide-0.4.32/ext
/usr/bin/ruby mkrf_conf.rb
Installing base gem
You don't have write permissions for the /usr/lib/ruby/gems/2.3.0 directory.
/usr/lib/ruby/2.3.0/rubygems/installer.rb:685:in `verify_gem_home'
/usr/lib/ruby/2.3.0/rubygems/installer.rb:805:in `pre_install_checks'
/usr/lib/ruby/2.3.0/rubygems/installer.rb:272:in `install'
/usr/lib/ruby/2.3.0/rubygems/request_set.rb:167:in `block in install'
/usr/lib/ruby/2.3.0/rubygems/request_set.rb:151:in `each'
/usr/lib/ruby/2.3.0/rubygems/request_set.rb:151:in `install'
/usr/lib/ruby/2.3.0/rubygems/dependency_installer.rb:405:in `install'
mkrf_conf.rb:35:in `rescue in <main>'
mkrf_conf.rb:28:in `<main>'
I tried installing it as root but then I can't access the binary (which is located in /root/.gem/ruby/2.3.0/bin).
I tried putting the gem in my Gemfile but does not work (same error)
Why does it try to write in /usr/lib? Any way to bypass this behavior?
Thanks in advance
vscode-ruby
version: 0.5.3Make sure you have ruby
, ruby-debug-ide
and ruby-debug-basex19
installed before submitting your issue -- thank you !
execute rspec test
executed everythiing except 'it'
rspec test code :
describe 'Utils' do
puts 1111
describe '#time_condition' do
puts 2221
it do
puts 'aaa'
end
puts 2223
end
end
launch.json :
...
{
"name": "RSpec - all",
"type": "Ruby",
"request": "launch",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}/spec/*_rspec.rb",
"args": [
"--require",
"spec_helper",
"--require",
"rails_helper",
"--format",
"documentation"
]
},
...
When I run test on vscode, got
1111
2221
2223
when I run test by command, got
>rspec spec --pattern *_rspec.rb
1111
2221
2223
aaa
.
Finished in 0.003 seconds (files took 0.23602 seconds to load)
1 example, 0 failures
by the way, spec config files (generated by rspec --init) :
.rspec
--color
--require spec_helper
spec\spec_helper.rb
RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
config.profile_examples = 10
config.order = :random
Kernel.srand config.seed
end
VSCode Version: 0.10.12-alpha
•OS Version: Windows10 -Ruby Version: rubyinstaller-2.2.4-x64 (install location : http://rubyinstaller.org/downloads/)
Steps to Reproduce:
Actual: Getting Error like : Debugger terminal error: Process failed: spawn rdebug-ide.bat ENOENT
vscode-ruby
version: 0.9.0Make sure you have ruby
, ruby-debug-ide
and ruby-debug-basex19
installed before submitting your issue -- thank you !
When I type [1, 2, 3].e
inside a Rails model/controller is expected to trigger autocomplete.
Actually nothing happens in editor. In dev degub console show the following error:
shell.ts:441 /Users/guiloyins/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rcodetools-0.8.5.0/lib/rcodetools/completion.rb:166:in `runtime_data_with_class': -:1:in `<main>': uninitialized constant ActiveRecord (NameError) (Rcodetools::ProcessParticularLine::NewCodeError)
from /Users/guiloyins/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rcodetools-0.8.5.0/lib/rcodetools/completion.rb:287:in `candidates_with_class'
from /Users/guiloyins/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rcodetools-0.8.5.0/lib/rcodetools/completion.rb:295:in `candidates'
from /Users/guiloyins/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rcodetools-0.8.5.0/lib/rcodetools/completion.rb:313:in `completion_code'
from /Users/guiloyins/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rcodetools-0.8.5.0/lib/rcodetools/completion.rb:206:in `run'
from /Users/guiloyins/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rcodetools-0.8.5.0/bin/rct-complete:45:in `<top (required)>'
from /Users/guiloyins/.rbenv/versions/2.3.1/bin/rct-complete:22:in `load'
from /Users/guiloyins/.rbenv/versions/2.3.1/bin/rct-complete:22:in `<main>'
If the file edited is a regular ruby file the autocomplete works as expected.
Setup a rails project with rbenv. Inside a controller, model and etc, and follow the steps on docs.
I don't know if I am doing something wrong and there is so little information about rcodetools and rails/rbenv on internet.
vscode-ruby
version: 0.9.0Using the files below I hit F12 to goto definition - I'm execting the cursor to jump 2 lines up, but instead I'm taken to a different file that has a function with a name clash
I've created a project with two files: hest.rb/horse.rb. One is not included in the other and there is a variable name that has a name clash.
hest.rb
module Hest
# something
class MyClass
def self.hest(filename, opts = {})
content_hash = opts['content_hash']
puts filename
puts content_hash
end
end
end
horse.rb
def content_hash
'asdf'
end
vscode-ruby
version: 0.10Make sure you have ruby
, ruby-debug-ide
and ruby-debug-basex19
installed before submitting your issue -- thank you !
Right clicking on a function will show "goto definition" and "peek definition"
Right clicking on a function shows "Change all occurences", "cut", "copy", and "paste" only.
Upgrade from Ruby 0.9x to Ruby 0.10x
No configuration was changed between the upgrade
vscode-ruby
version: 0.6.0I installed rcodetools per the extension readme.
Assume the following code:
x = "hello"
x.
I expect the IntelliSense list to appear when i press .
I have to type in a character that matches something in the IntelliSense list (for example c
for capitalize
, but x
doesn't do anything) or press Ctrl+Space to get IntelliSense to appear. Languages such as JavaScript and TypeScript show the list on .
vscode-ruby
version: 0.5.3Make sure you have ruby
, ruby-debug-ide
and ruby-debug-basex19
installed before submitting your issue -- thank you !
Autocomplete
After install the latest vscode-ruby, autocomplete doesn't show any result, and get a error info:
Run VS Code with admin privileges so the changes can be applied.
After restarting VSCode or reinstall the extension, the problem still remains.
When I use sudo code
to run VSCode, the autocomplete works, but VSCode itself warns me not to run it in root mode.
It would be great to have brackets ( and def .. end
) highlighting.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.