profile
viewpoint
rubyide rubyide IDE support for ruby

rubyide/vscode-ruby 949

Provides Ruby language and debugging support for Visual Studio Code

rubyide/docker-ruby-version-managers 0

Docker images preinstalled with one of the Ruby version managers

pull request commentrubyide/vscode-ruby

Fix path to rdebug ide

Codecov Report

Merging #624 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #624   +/-   ##
======================================
  Coverage    5.04%   5.04%           
======================================
  Files          10      10           
  Lines         119     119           
  Branches       20      20           
======================================
  Hits            6       6           
  Misses        113     113           
Flag Coverage Δ
#language_server_ruby 5.04% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 19b8b34...322bdd2. Read the comment docs.

peret

comment created time in 3 days

PR opened rubyide/vscode-ruby

Fix path to rdebug ide

The value of the debugger option "pathToRDebugIDE" was never used in the code. It appears that this issue was introduced with commit 12e95f41aaa53aa2f27f291760f32996a6afedc3, which apparently renamed the field without renaming the option.

This PR should fix that.

  • [X] The build passes
  • [X] TSLint is mostly happy
  • [X] Prettier has been run
+339 -317

0 comment

1 changed file

pr created time in 3 days

startedrubyide/vscode-ruby

started time in 5 days

issue openedrubyide/vscode-ruby

"Go to definition" ignores module chain

Your environment

  • vscode-ruby version: 0.27.0
  • Ruby version: ruby 2.5.7p206 (2019-10-01 revision 67816) [x86_64-darwin19]
  • Ruby version manager (if any): rbenv 1.1.2
  • VS Code version: 1.45.1
  • Operating System: macOS 10.15.4
  • Using language server? (eg useLanguageServer is true in your configuration?) yes

Setup

# app/first.rb
module FirstModule
  class LovelyClass
  end
end
# app/second.rb
module SecondModule
  class LovelyClass
  end
end

Expected behavior

cmd+click on LovelyClass (or right-click "Go to Definition") should go straight to app/first.rb because we're accessing it through FirstModule:

# app/something.rb
def something
  ::FirstModule::LovelyClass.new
  #              ^^^^^^^^^^^
end

Actual behavior

Peek definition is opened with both app/first.rb and app/second.rb highlighting a LovelyClass definition: image

created time in 5 days

issue openedrubyide/vscode-ruby

Javascript in ERB leads to broken highlighting

Your environment

  • vscode-ruby version: 0.27.0
  • Ruby version: 2.6.2
  • Ruby version manager (if any): rbenv
  • VS Code version: 1.45.1
  • Operating System: macOS 10.15.2
  • Using language server? (eg useLanguageServer is true in your configuration?) true

Expected behavior

Correct syntax highlighting should continue in Javascript after using ERB in a <script type='text/javascript> block.

Actual behavior

The following snippet leads to incorrect highlight in the JS in the file:

<div class="page">
  <p>JS syntax highlighting works in the next script block.</p>
  <script type='text/javascript'>
    var thisisastring = "<%= "Highlighting works here." %>";
  </script>

  <p>
    The next js block breaks highlighting in the rest of the file.
    We are trying to echo a JS boolean to the page.
  </p>
  <script type='text/javascript'>
    var jsBoolean = <%= @ivar.present? %>;
  </script>

  <p>And now JS highlighting is broken.</p>
  <script type='text/javascript'>
    var el = document.querySelection('body')
    var anotherstring = "Highlighting is now broken."
  </script>
</div>

Screenshot of broken highlighting: Screen Shot 2020-05-28 at 11 41 36 AM

Cause of Issue

The question mark in @ivar.present? seems to be the character that breaks the highlighting.

created time in 5 days

startedrubyide/vscode-ruby

started time in 6 days

startedrubyide/vscode-ruby

started time in 6 days

issue closedrubyide/vscode-ruby

Running a task spawns two Ruby processes which have high CPU utilisation

Your environment

  • vscode-ruby version: 0.27.0
  • Ruby version: 2.6.5
  • Ruby version manager (if any): rbenv 1.1.2
  • VS Code version: 1.45.1
  • Operating System: MacOS Catalina
  • Using language server? (eg useLanguageServer is true in your configuration?) yes

Expected behavior

I have a task which runs the tests in the current open file. It uses some CPU to run the tests, but then doesn't use any extra resources.

The task is:

{
      "label": "Run Current Test",
      "command": "rails test ${relativeFile}:${lineNumber}",
      "type": "shell",
      "group": "test",
      "presentation": {
        "echo": true,
        "reveal": "always",
        "focus": false,
        "panel": "shared",
        "showReuseMessage": false
      },
      "problemMatcher": []
    }

Actual behavior

After the task is run, two ruby processes are spawned. These take about 20% CPU each, and persist after the task is finished (even after VSCode is completely quit). They are also restarted by a parent ruby process. The only way to quit them is to restart or quit the parent ruby process (which I assume might be the language server?).

I have confirmed this is due to this extension, as with all extensions disabled I do not encounter this issue.

image

closed time in 6 days

joecorkerton

issue commentrubyide/vscode-ruby

Running a task spawns two Ruby processes which have high CPU utilisation

I think this might be related to spring more than the extension, as I have a single process with highish CPU when I run a test from the command line

joecorkerton

comment created time in 6 days

fork elimuhub/vscode-ruby

Provides Ruby language and debugging support for Visual Studio Code

https://marketplace.visualstudio.com/items?itemName=rebornix.Ruby

fork in 7 days

startedrubyide/vscode-ruby

started time in 7 days

startedrubyide/vscode-ruby

started time in 8 days

fork calrrox/vscode-ruby

Provides Ruby language and debugging support for Visual Studio Code

https://marketplace.visualstudio.com/items?itemName=rebornix.Ruby

fork in 8 days

issue commentrubyide/vscode-ruby

Language server does not load gemsets from RVM correctly

Any resolution or workaround to make this work with rvm yet?

peret

comment created time in 11 days

startedrubyide/vscode-ruby

started time in 11 days

issue commentrubyide/vscode-ruby

Ruby version not correctly parsed when using RVM

It worked! Brilliant, thanks @ferdaber

ferdaber

comment created time in 11 days

issue commentrubyide/vscode-ruby

Ruby version not correctly parsed when using RVM

@Yorkshireman a workaround is to open the extension folder, which is usually under ~/.vscode/extensions/rebornix.ruby-xxx (xxx is the current extension version), and change this file: dist/server/shims/env.bin.{shell}.sh (shell will be whatever your default shell is). It'll look something like:

#!/bin/zsh -i
export

You want to add the -l flag in the hashbang header:

#!/bin/zsh -i -l
export
ferdaber

comment created time in 11 days

issue commentrubyide/vscode-ruby

Ruby version not correctly parsed when using RVM

I'm having the same problem.

ferdaber

comment created time in 11 days

issue openedrubyide/vscode-ruby

Running a task spawns two Ruby processes which have high CPU utilisation

Your environment

  • vscode-ruby version: 0.27.0
  • Ruby version: 2.6.5
  • Ruby version manager (if any): rbenv 1.1.2
  • VS Code version: 1.45.1
  • Operating System: MacOS Catalina
  • Using language server? (eg useLanguageServer is true in your configuration?) yes

Expected behavior

I have a task which runs the tests in the current open file. It uses some CPU to run the tests, but then doesn't use any extra resources.

The task is:

{
      "label": "Run Current Test",
      "command": "rails test ${relativeFile}:${lineNumber}",
      "type": "shell",
      "group": "test",
      "presentation": {
        "echo": true,
        "reveal": "always",
        "focus": false,
        "panel": "shared",
        "showReuseMessage": false
      },
      "problemMatcher": []
    }

Actual behavior

After the task is run, two ruby processes are spawned. These take about 20% CPU each, and persist after the task is finished (even after VSCode is completely quit). They are also restarted by a parent ruby process. The only way to quit them is to restart or quit the parent ruby process (which I assume might be the language server?).

I have confirmed this is due to this extension, as with all extensions disabled I do not encounter this issue.

image

created time in 13 days

issue openedrubyide/vscode-ruby

Ruby version not correctly parsed when using RVM

Your environment

  • vscode-ruby version: 0.27.0
  • Ruby version: 2.7.1
  • Ruby version manager (if any): RVM
  • VS Code version: 1.45.1
  • Operating System: MacOS 10.15.4
  • Using language server? (eg useLanguageServer is true in your configuration?) true

Expected behavior

When linting or formatting (like with Rubocop) and using bundler, no errors are outputted and formatting behavior works.

Actual behavior

Workspace settings:

{
  "ruby.useBundler": true,
  "ruby.useLanguageServer": true,
  "ruby.codeCompletion": false,
  "ruby.intellisense": false,
  "ruby.format": "rubocop",
  "ruby.lint": {
    "rubocop": {
      "useBundler": true
    }
  }
}

Directory structure:

|- app.rb
|- Gemfile
|- Gemfile.lock

The following error is logged due to the wrong version of Ruby being loaded:

Lint: executing bundle exec rubocop -s /Users/admin/my-app/app.rb -f json...
/Users/admin/.rvm/gems/ruby-2.6.3/gems/bundler-2.1.4/lib/bundler/definition.rb:495:in `validate_ruby!': Your Ruby version is 2.6.3, but your Gemfile specified 2.7.1 (Bundler::RubyVersionMismatch)
	from /Users/admin/.rvm/gems/ruby-2.6.3/gems/bundler-2.1.4/lib/bundler/definition.rb:470:in `validate_runtime!'
	from /Users/admin/.rvm/gems/ruby-2.6.3/gems/bundler-2.1.4/lib/bundler.rb:143:in `setup'
	from /Users/admin/.rvm/gems/ruby-2.6.3/gems/bundler-2.1.4/lib/bundler/setup.rb:20:in `block in <top (required)>'
	from /Users/admin/.rvm/gems/ruby-2.6.3/gems/bundler-2.1.4/lib/bundler/ui/shell.rb:136:in `with_level'
	from /Users/admin/.rvm/gems/ruby-2.6.3/gems/bundler-2.1.4/lib/bundler/ui/shell.rb:88:in `silence'
	from /Users/admin/.rvm/gems/ruby-2.6.3/gems/bundler-2.1.4/lib/bundler/setup.rb:20:in `<top (required)>'
	from /Users/admin/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	from /Users/admin/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'

The content of app.rb itself is empty, meaning it's not affected by the source code.

Hypothesis

When RVM is loaded, it aliases the rvm command as a function and sets up appropriate environment variables (like RUBY_VERSION) which is usually set at a user's ~/.profile or ~/.bash_profile dotfile. However those dotfiles are only sourced when running a shell with the login flag /bin/bash -l, otherwise RVM isn't loaded at all.

It seems that the fix would be to change this line to also pass the -l flag https://github.com/rubyide/vscode-ruby/blob/master/packages/vscode-ruby-common/src/environment.ts#L44.

I haven't tested it yet but it may also require a cd . statement to trigger RVM's automatic Ruby loading when changing directories.

created time in 15 days

fork ret394/vscode-ruby

Provides Ruby language and debugging support for Visual Studio Code

https://marketplace.visualstudio.com/items?itemName=rebornix.Ruby

fork in 15 days

issue commentrubyide/vscode-ruby

$SAFE will become a normal global variable in Ruby 3.0

Hm... Yes. It's possible.

/usr/bin/gem list | grep debase
debase (0.2.4.1)
debase-ruby_core_source (0.10.9)

Then instructions here are inaccurate:

If you are using Ruby v2.x

gem install ruby-debug-ide
gem install debase (or gem install byebug)

Anyway I've simply installed ruby 2.6.6 through rbenv, changed paths in vscode-ruby configuration and everything works now.

appomsk

comment created time in 16 days

startedrubyide/vscode-ruby

started time in 17 days

issue commentrubyide/vscode-ruby

$SAFE will become a normal global variable in Ruby 3.0

I think that when you installed ruby-debug-ide it probably reinstalled debase and used that and not byebug. ruby-debug-ide is hard coded to debase which is why I was intrigued as to how you got it working.

appomsk

comment created time in 17 days

issue commentrubyide/vscode-ruby

$SAFE will become a normal global variable in Ruby 3.0

I really did not have time to compare. I uninstalled debase (and something like debase-core, I think) but it was not enough. Then I uninstalled ruby_debug_ide and installed again, and then byebug. I do not think I reinstalled vscode-ruby but it's possible. It was something I simply tried - I did not pay a lot of attention what I did. At the same time I googled about $SAFE variable (the warning appeared in ruby 2.7) - and grepped gems. I did not find anything - only in robocop, but it is not the cause.

appomsk

comment created time in 18 days

issue commentrubyide/vscode-ruby

$SAFE will become a normal global variable in Ruby 3.0

This message is really annoying. I spent some time looking into it but couldn't find the source of it. Apparently its output when deprecated calls to taint are made but I searched all the projects and couldn't find any calls, not direct ones anyway. I had look through the ruby codebase too.

On a separate note, how does byebug perform compared to debase? How do you get ruby_debug_ide to use byebug instead of debase?

appomsk

comment created time in 18 days

startedrubyide/vscode-ruby

started time in 18 days

fork NickBenthem/vscode-ruby

Provides Ruby language and debugging support for Visual Studio Code

https://marketplace.visualstudio.com/items?itemName=rebornix.Ruby

fork in 18 days

issue commentrubyide/vscode-ruby

rubocop not using workspace .rubocop.yml

I was getting tunnel vision and did not notice that the file I was trying to lint was outside of the workspace. Gonna go shame myself in the corner for a while.

jneander

comment created time in 18 days

issue closedrubyide/vscode-ruby

rubocop not using workspace .rubocop.yml

Your environment

  • vscode-ruby version: 0.27.0
  • Ruby version: ruby 2.6.5p114
  • Ruby version manager (if any): rbenv 1.1.2
  • VS Code version: 1.41.1
  • Operating System: macOS 10.14.6
  • Using language server? (eg useLanguageServer is true in your configuration?) Tried both ways.

Expected behavior

The rules in the .rubocop.yml file in the workspace root should be honored.

Actual behavior

None of the rules in the .rubocop.yml file in the workspace root are being honored. When that same .rubocop.yml file is located in the user home path, it behaves as expected.

I saw that #578 seems related. But none of the discussion there solved the issue here.

closed time in 18 days

jneander

startedrubyide/vscode-ruby

started time in 18 days

issue openedrubyide/vscode-ruby

rubocop not using workspace .rubocop.yml

Your environment

  • vscode-ruby version: 0.27.0
  • Ruby version: ruby 2.6.5p114
  • Ruby version manager (if any): rbenv 1.1.2
  • VS Code version: 1.41.1
  • Operating System: macOS 10.14.6
  • Using language server? (eg useLanguageServer is true in your configuration?) Tried both ways.

Expected behavior

The rules in the .rubocop.yml file in the workspace root should be honored.

Actual behavior

None of the rules in the .rubocop.yml file in the workspace root are being honored. When that same .rubocop.yml file is located in the user home path, it behaves as expected.

I saw that #578 seems related. But none of the discussion there solved the issue here.

created time in 18 days

issue openedrubyide/vscode-ruby

$SAFE will become a normal global variable in Ruby 3.0

Your environment

  • vscode-ruby version: 0.27.0
  • Ruby version: 2.7.0
  • Ruby version manager (if any):
  • VS Code version: 1.45.1
  • Operating System: Linux Kubuntu 20.04
  • Using language server? (eg useLanguageServer is true in your configuration?) Yes

Expected behavior

No any messages

Actual behavior

After every step in debugger the message appears in debug console: "NAME_OF_SCRIPT: $SAFE will become a normal global variable in Ruby 3.0."

I changed debase to byebug but the behavior is the same. I've found the similar problem was with pry, they somehow fixed it. But I'm a novice and I'm really don't understand where these messages come from and what I can do.

created time in 18 days

issue openedrubyide/vscode-ruby

Can't see variables, only the callstack

Your environment

  • vscode-ruby version: 0.27.0
  • Ruby version: ruby 2.6.5
  • Ruby version manager (if any): rbenv
  • VS Code version: 1.45.0
  • Operating System: linux
  • Using language server? false

Expected behavior

View variables on the Debug section, especially after reaching a breakpoint.

Actual behavior

The debugging itself works, but only on the main file. Any local requireds only show threads in the Callstack, with no variables.

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug Local File",
            "type": "Ruby",
            "request": "launch",
            "cwd": "${workspaceRoot}",
            "program": "${workspaceRoot}/bin/fumimi"

        }
    ]
}

Screenshots: 2020-05-14_180136 2020-05-14_181211

created time in 19 days

startedrubyide/vscode-ruby

started time in 19 days

fork Adamlb/vscode-ruby

Provides Ruby language and debugging support for Visual Studio Code

https://marketplace.visualstudio.com/items?itemName=rebornix.Ruby

fork in 20 days

issue commentrubyide/vscode-ruby

RuboCop 0.72.0 removed -R option, causing Rails linting to fail

@jordanbrock Here's what I did to get linting working with rubocop >0.71

  • Remove "rails": true from settings.json
  • Added require: rubocop-rails to my .rubocop.yml config file as per: https://github.com/rubocop-hq/rubocop-rails#rubocop-configuration-file
SkipKayhil

comment created time in 21 days

fork mihado/vscode-ruby

Provides Ruby language and debugging support for Visual Studio Code

https://marketplace.visualstudio.com/items?itemName=rebornix.Ruby

fork in 21 days

issue commentrubyide/vscode-ruby

RuboCop 0.72.0 removed -R option, causing Rails linting to fail

Actually, got it working with a mix of older gem versions:

  gem "rubocop", "0.71"
  gem "rubocop-rails", git: "https://github.com/rubocop-hq/rubocop-rails", tag: "v2.0.1"

But obviously, support for the latest versions would be preferred. I'm new to VSCode, so I'll have a poke around how extensions work and see if I can muddle a PR together at some point.

SkipKayhil

comment created time in 23 days

issue commentrubyide/vscode-ruby

RuboCop 0.72.0 removed -R option, causing Rails linting to fail

Is there a config file based workaround for this in the meantime?

I've tried downgrading to 0.71 but it throws a few requirement errors for some other gems.

SkipKayhil

comment created time in 23 days

issue commentrubyide/vscode-ruby

Emmet isn't recognised in erb

So -- adding a file association { "*html.erb": "html" } enables snippets but disables erb highlighting and viceversa. A true Catch-22. Sucks.

resting

comment created time in 24 days

startedrubyide/vscode-ruby

started time in a month

startedrubyide/vscode-ruby

started time in a month

issue closedrubyide/vscode-ruby

Bundler different behavior on terminal and language server

Your environment

  • vscode-ruby version: 0.27.0
  • Ruby version: 2.4.4
  • Ruby version manager (if any): rbenv
  • VS Code version: 1.44
  • Operating System: macos Catalina
  • Using language server? yes

Expected behavior

When I want to run linter on my ruby files, it won't work.

Actual behavior

The linter should've worked. The bundler install has already been done in the directory and the command bundle exec rubocop -s ... works in the terminal.

The Ruby language server output is as follows


Bundler::GemNotFound: Could not find activerecord-import-1.0.4 in any of the sources
  /Users/javidhosseini/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/spec_set.rb:87:in `block in materialize'
  /Users/javidhosseini/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/spec_set.rb:81:in `map!'
  /Users/javidhosseini/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/spec_set.rb:81:in `materialize'
  /Users/javidhosseini/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/definition.rb:170:in `specs'
  /Users/javidhosseini/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/definition.rb:237:in `specs_for'
  /Users/javidhosseini/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/definition.rb:226:in `requested_specs'
  /Users/javidhosseini/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:108:in `block in definition_method'
  /Users/javidhosseini/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:20:in `setup'
  /Users/javidhosseini/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler.rb:107:in `setup'
  /Users/javidhosseini/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/bundler-2.0.2/lib/bundler/setup.rb:20:in `<top (required)>'
  /Users/javidhosseini/.rbenv/versions/2.4.4/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  /Users/javidhosseini/.rbenv/versions/2.4.4/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'

closed time in a month

javidh

issue commentrubyide/vscode-ruby

Bundler different behavior on terminal and language server

Turns out the problem was due to an iTerm script I ran. The script just launches a few tmuxinator instances and it messed up GEM_HOME. unset GEM_HOME fixed the problem.

javidh

comment created time in a month

startedrubyide/vscode-ruby

started time in a month

startedrubyide/vscode-ruby

started time in a month

issue commentrubyide/vscode-ruby

`Request textDocument/documentSymbol failed` error when closing ruby file tab.

Looks like cleaning cache & stuff made this disappear. Must have been a temporary glitch.

viktor-evdokimov

comment created time in a month

issue commentrubyide/vscode-ruby

`Request textDocument/documentSymbol failed` error when closing ruby file tab.

Also happens when opening a Gemfile.

viktor-evdokimov

comment created time in a month

issue commentrubyide/vscode-ruby

`Request textDocument/documentSymbol failed` error when closing ruby file tab.

It actually happens a lot throughout different actions, like when typing require '...', switching files sometimes, just writing random codes... Seems to be related to intellisense somehow.

Anybody encountering that too?

viktor-evdokimov

comment created time in a month

issue commentrubyide/vscode-ruby

`Request textDocument/documentSymbol failed` error when closing ruby file tab.

Running into the same error each time I open up config.ru file:

[Error - 14:39:53] Request textDocument/documentSymbol failed.
  Message: [NoMethodError] undefined method `missing_extensions?' for nil:NilClass
  Code: -32603 

Just appeared recently though, so might be linked to a solargraph update. How can I check what part is responsible for the error message? I appears under the "Ruby Language Server" pane, relevant parts of my config:

    "ruby.useLanguageServer": true,
    "ruby.format": "rubocop",
    "ruby.lintDebounceTime": 50,
    "ruby.useBundler": true,
    "[ruby]": {
      "editor.defaultFormatter": "misogi.ruby-rubocop"
    },
viktor-evdokimov

comment created time in a month

startedrubyide/vscode-ruby

started time in a month

issue openedrubyide/vscode-ruby

Redundant end / END suggestions

Does anybody run into this kind of suggestion every single time you have intellisense firing on an end statement? It's both useless and annoying: image

I'm sure it's not there by default and something wrong in my config / extensions leads to this nonsense. But I don't know how to pinpoint the issue.

Anybody?

(cross-posted to SO)

created time in a month

fork vitorbandeira/vscode-ruby

Provides Ruby language and debugging support for Visual Studio Code

https://marketplace.visualstudio.com/items?itemName=rebornix.Ruby

fork in a month

PR closed rubyide/vscode-ruby

use " json-with-comment" in exemple configuration

If you use comments in json, use "json-with-comment" code lexer

+1 -1

1 comment

1 changed file

deronnax

pr closed time in a month

PullRequestEvent

PR closed rubyide/vscode-ruby

use " json-with-comment" in exemple configuration

If you use comments in json, use "json-with-comment" code lexer

+1 -1

1 comment

1 changed file

deronnax

pr closed time in a month

pull request commentrubyide/vscode-ruby

HAML breakpoints

This would be awesome!

hazg

comment created time in a month

issue commentrubyide/vscode-ruby

Ruby language server ignore .ruby-version and .ruby-gemset

More information from me. After upgrading to ruby-2.7.1, applying default gemset and restarting vscode multiple times (or window reload), ruby language server was still using older version of ruby. Restarting my Mac helped.

michal-samluk

comment created time in a month

startedrubyide/vscode-ruby

started time in a month

issue commentrubyide/vscode-ruby

Emmet isn't recognised in erb

thank you

resting

comment created time in a month

issue commentrubyide/vscode-ruby

Rubocop Ignored Files Not Respected

I had a similar issue. After a little digging I found that the forceExclusion option fixes this issue for me (it essentially tells Rubocop to honor Excludes in the config).

You can enable it in VS Code's settings.json as follows:

  "ruby.lint": {
    "rubocop": {
      "forceExclusion": true
    }
  },
ecbrodie

comment created time in a month

issue openedrubyide/vscode-ruby

Rubocop can't be found

Your environment

  • vscode-ruby version:
  • Ruby version: 2.4.2
  • Ruby version manager (if any): rvm
  • VS Code version: 1.44.2
  • Operating System: MacOS
  • Using language server? (eg useLanguageServer is true in your configuration?): yes
  • shell: zsh

Expected behavior

I install rubocop. language server should be able to use it. Use rubocop on the intergrated terminal works ok.

Actual behavior

Rubocop can't be found. Language server output:

[Info  - 10:24:05 PM] Initializing Ruby language server...
Loading Ruby tree-sitter syntax from /Users/linhhoang/.vscode/extensions/rebornix.ruby-0.27.0/dist/server/tree-sitter-ruby.wasm
Lint: executing bundle exec rubocop -s /Users/linhhoang/Documents/gatech/humtum/sc-platform/app/controllers/users_controller.rb -f json...
Lint: Received invalid JSON from rubocop:

bundler: command not found: rubocop
Install missing gem executables with `bundle install`

This and the next section should include screenshots, code samples, console output, etc. The more information we have to reproduce the better! If this is a syntax highlighting report please include a code sample that can be quickly copied and pasted!

created time in a month

startedrubyide/vscode-ruby

started time in a month

startedrubyide/vscode-ruby

started time in a month

issue openedrubyide/vscode-ruby

Question: How do I run the rspec referred to by rbenv in the debugger?

Your environment

  • vscode-ruby version: 0.27.0
  • Ruby version: variable
  • Ruby version manager (if any): rbenv
  • VS Code version: 1.44.2
  • Operating System: macOS 10.15.4
  • Using language server? (eg useLanguageServer is true in your configuration?) Yes: Solargraph

I have a question similar to https://github.com/rubyide/vscode-ruby/issues/344, but I was wondering if there were a different solution.

I can create a launch configuration in my global settings, similar to the following.

  "launch": {
    "version": "0.2.0",
    "configurations": [
      {
        "name": "RSpec (current file)",
        "type": "Ruby",
        "request": "launch",
        "cwd": "${workspaceFolder}",
        "program": "${workspaceFolder}/bin/rspec",
        "args": ["${file}"],
      },
    ]
  }

This works. However, if the binstub for rspec is missing or otherwise not working (such as due to a Bundler issue), it fails. What I'd like to do is replace "program": "${workspaceFolder}/bin/rspec" with something like "program": "$(rbenv which rspec)", which will work in more situations more flexibly. However, Code doesn't support a relative path or command output here.

Is there a solution I've overlooked for this problem?

Would it be out of the question to include a command with this extension such as vscode-ruby.get-rbenv-directory which would output the correct directory (e.g., $HOME/.rbenv/versions/2.6.5/)? That would allow me to put "program": "${command:vscode-ruby.get-rbenv-directory}". I understand this may not be desirable, but it's the only solution I can think of.

created time in a month

fork jm3/vscode-ruby

Provides Ruby language and debugging support for Visual Studio Code

https://marketplace.visualstudio.com/items?itemName=rebornix.Ruby

fork in a month

issue openedrubyide/vscode-ruby

Autocoplete for instance variables doesn't work

Your environment

  • vscode-ruby version: 0.27.0
  • Ruby version: 2.5.5
  • Ruby version manager: chruby
  • VS Code version: 1.44.2
  • Operating System: Manjaro Linux
  • Using language server? yes

Expected behavior

Complete instance variables

Actual behavior

Peek 2020-04-21 15-42

created time in a month

issue commentrubyide/vscode-ruby

.rubocop.yml exclude doesn't work.

I get this issue too. It's wonderful most of the time but in those 1% of files where it's not folloing the .yml it becomes a pain and I can't format on save

@wingrunr21 here's my .rubocop.yml.

ghost

comment created time in a month

startedrubyide/vscode-ruby

started time in a month

issue openedrubyide/vscode-ruby

Rubocop Ignored Files Not Respected

Your environment

  • vscode-ruby version: 0.27.0
  • Ruby version: 2.6.5
  • Ruby version manager (if any): rvm
  • VS Code version: 1.44.2
  • Operating System: Mac OS 10.15.4
  • Using language server? Yes

Expected behavior

Ignored files specified in the AllCops.Exclude list in .rubocop.yml are respected, when Rubocop linting is run by the extension.

Actual behavior

The ignored files list is not being respected. The extension is underlining code due to a Rubocop violation. However, the entire file should have been excluded (and it is indeed excluded when I run rubocop directly on the command line).

In my case, I ignored all DB migration files, as in db/migrate/*. Looks like this isn't getting picked up properly by the extension.

Thank you.

created time in a month

startedrubyide/vscode-ruby

started time in a month

issue commentrubyide/vscode-ruby

Show watch variables as tree when hash?

Adding context info from issue in debase repo: https://github.com/denofevil/debase/issues/87

debase supports this, so the change would on the extension side.

qortex

comment created time in a month

startedrubyide/vscode-ruby

started time in 2 months

startedrubyide/vscode-ruby

started time in 2 months

issue openedrubyide/vscode-ruby

Request: Highlight more files

  • .guardrc (Ruby)
  • .rvmrc (shell)
  • defaults.reek (YAML)

created time in 2 months

startedrubyide/vscode-ruby

started time in 2 months

pull request commentrubyide/vscode-ruby

Bump https-proxy-agent from 2.2.2 to 2.2.4

Codecov Report

Merging #610 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #610   +/-   ##
======================================
  Coverage    5.04%   5.04%           
======================================
  Files          10      10           
  Lines         119     119           
  Branches       20      20           
======================================
  Hits            6       6           
  Misses        113     113           
Flag Coverage Δ
#language_server_ruby 5.04% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 19b8b34...049b971. Read the comment docs.

dependabot[bot]

comment created time in 2 months

PR opened rubyide/vscode-ruby

Bump https-proxy-agent from 2.2.2 to 2.2.4

Bumps https-proxy-agent from 2.2.2 to 2.2.4. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/TooTallNate/node-https-proxy-agent/releases">https-proxy-agent's releases</a>.</em></p> <blockquote> <h2>2.2.4</h2> <h3>Patches</h3> <ul> <li>Add <code>.editorconfig</code> file: a0d4a20458498fc31e5721471bd2b655e992d44b</li> <li>Add <code>.eslintrc.js</code> file: eecea74a1db1c943eaa4f667a561fd47c33da897</li> <li>Use a <code>net.Socket</code> instead of a plain <code>EventEmitter</code> for replaying proxy errors: <a href="https://github-redirect.dependabot.com/TooTallNate/node-https-proxy-agent/issues/83">#83</a></li> <li>Remove unused <code>stream</code> module: 9fdcd47bd813e9979ee57920c69e2ee2e0683cd4</li> </ul> <h3>Credits</h3> <p>Huge thanks to <a href="https://github.com/lpinca">@lpinca</a> for helping!</p> <h2>2.2.3</h2> <h3>Patches</h3> <ul> <li>Update README with actual <code>secureProxy</code> behavior: <a href="https://github-redirect.dependabot.com/TooTallNate/node-https-proxy-agent/issues/65">#65</a></li> <li>Update <code>proxy</code> to v1.0.0: d0e3c18079119057b05582cb72d4fda21dfc2546</li> <li>Remove unreachable code: 46aad0988b471f042856436cf3192b0e09e36fe6</li> <li>Test on Node.js 10 and 12: 3535951e482ea52af4888938f59649ed92e81b2b</li> <li>Fix compatibility with Node.js >= 10.0.0: <a href="https://github-redirect.dependabot.com/TooTallNate/node-https-proxy-agent/issues/73">#73</a></li> <li>Use an <code>EventEmitter</code> to replay failed proxy connect HTTP requests: <a href="https://github-redirect.dependabot.com/TooTallNate/node-https-proxy-agent/issues/77">#77</a></li> </ul> <h3>Credits</h3> <p>Huge thanks to <a href="https://github.com/stoically">@stoically</a>, <a href="https://github.com/lpinca">@lpinca</a>, and <a href="https://github.com/zkochan">@zkochan</a> for helping!</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/TooTallNate/node-https-proxy-agent/commit/4c4cce8cb60fd3ac6171e4428f972698eb49f45a"><code>4c4cce8</code></a> 2.2.4</li> <li><a href="https://github.com/TooTallNate/node-https-proxy-agent/commit/9fdcd47bd813e9979ee57920c69e2ee2e0683cd4"><code>9fdcd47</code></a> Remove unused <code>stream</code> module</li> <li><a href="https://github.com/TooTallNate/node-https-proxy-agent/commit/34ea8841922fb6447563b0521f972ac3a6062303"><code>34ea884</code></a> Use a <code>net.Socket</code> instead of a plain <code>EventEmitter</code> for replaying proxy erro...</li> <li><a href="https://github.com/TooTallNate/node-https-proxy-agent/commit/4296770b6a0e631e3f8e7bd6cfd41ac8e91a3ec4"><code>4296770</code></a> Prettier</li> <li><a href="https://github.com/TooTallNate/node-https-proxy-agent/commit/eecea74a1db1c943eaa4f667a561fd47c33da897"><code>eecea74</code></a> Add <code>.eslintrc.js</code> file</li> <li><a href="https://github.com/TooTallNate/node-https-proxy-agent/commit/a0d4a20458498fc31e5721471bd2b655e992d44b"><code>a0d4a20</code></a> Add <code>.editorconfig</code> file</li> <li><a href="https://github.com/TooTallNate/node-https-proxy-agent/commit/0d8e8bfe8b12e6ffe79a39eb93068cdf64c17e78"><code>0d8e8bf</code></a> 2.2.3</li> <li><a href="https://github.com/TooTallNate/node-https-proxy-agent/commit/850b8359b7d0467d721705106b58f4c7cfb937dd"><code>850b835</code></a> Revert "Use Mocha 5 for Node 4 support"</li> <li><a href="https://github.com/TooTallNate/node-https-proxy-agent/commit/f5f56fa48ea4d2a61c385938e7753f5c1fe049d6"><code>f5f56fa</code></a> Remove Node 4 from Travis</li> <li><a href="https://github.com/TooTallNate/node-https-proxy-agent/commit/bb837b984bd868ad69080812eb8eab01181b21d7"><code>bb837b9</code></a> Revert "Remove Node 4 from Travis"</li> <li>Additional commits viewable in <a href="https://github.com/TooTallNate/node-https-proxy-agent/compare/2.2.2...2.2.4">compare view</a></li> </ul> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

</details>

+3 -3

0 comment

1 changed file

pr created time in 2 months

issue commentrubyide/vscode-ruby

Ruby language server ignore .ruby-version and .ruby-gemset

Me experiencing this as well, even by overriding "command": "$HOME/.rvm/gems/ruby-2.3.8@gemset/bin/rubocop" in vscode config. It seems $PATH doesn't changed and they still look to default ruby version (mine 2.6.5).

[Info  - 11:34:22 AM] Initializing Ruby language server...
Loading Ruby tree-sitter syntax from /Users/***/.vscode/extensions/rebornix.ruby-0.27.0/dist/server/tree-sitter-ruby.wasm
Lint: executing /Users/***/.rvm/gems/ruby-2.3.8@gemset/bin/rubocop -s /Users/***/Documents/ruby/project/test/spec/tasks/tech_support_spec.rb -f json -R...
/Users/***/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems.rb:284:in `find_spec_for_exe': can't find gem rubocop (>= 0.a) with executable rubocop (Gem::GemNotFoundException)
	from /Users/***/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems.rb:303:in `activate_bin_path'
	from /Users/***/.rvm/gems/ruby-2.3.8@gemset/bin/rubocop:23:in `<main>'
	from /Users/***/.rvm/gems/ruby-2.6.5/bin/ruby_executable_hooks:24:in `eval'
	from /Users/***/.rvm/gems/ruby-2.6.5/bin/ruby_executable_hooks:24:in `<main>'
michal-samluk

comment created time in 2 months

issue commentrubyide/vscode-ruby

Add onSave setting for linter runs

This feature would be great. Stripe is currently using the separate rubocop extension for linting because Rubocop is too slow for interactive linting (even with rubocop-daemon, which we are using).

wingrunr21

comment created time in 2 months

issue commentrubyide/vscode-ruby

Debugging not working with ruby on rails

Using rdebug-ide -d I was able to debug my issue with using VSCode <> Dockerized ruby. I hope the answer I found will help others.

It was very simple and didn't have to do with stray leftover breakpoints, or threads, or concurrency.

Most of the tutorials for this tell you to configure your launch.json as:

            "remoteWorkspaceRoot": "${workspaceRoot}",
            "cwd": "${workspaceRoot}",

However, this won't work unless your Docker filesystem has the same shape as the local filesystem. You will see that it used my Mac filesystem:

pete             | Fast Debugger (ruby-debug-ide 0.7.0, debase 0.2.4.1, file filtering is supported) listens on 0.0.0.0:1234
pete             | Connected from 172.20.0.1
pete             | 7: Starting control thread
pete             | 7: Processing in control: break /Users/apinstein/dev/sidx-local-dev/pete/app/controllers/application_controller.rb:10
pete             | 7: <breakpointAdded no="1" location="/Users/apinstein/dev/sidx-local-dev/pete/app/controllers/application_controller.rb:10"/>

cwd is for the local side (with VSCode) remoteWorkspaceRoot needs to be the path to your app in the Docker container.

Once I fixed this, it set the breakpoint on the proper path for what the rails server sees, and then my breakpoints started working.

pete             | Fast Debugger (ruby-debug-ide 0.7.0, debase 0.2.4.1, file filtering is supported) listens on 0.0.0.0:1234
pete             | Connected from 172.20.0.1
pete             | 7: Starting control thread
pete             | 7: Processing in control: break /usr/app/app/controllers/application_controller.rb:10
pete             | 7: <breakpointAdded no="1" location="/usr/app/app/controllers/application_controller.rb:10"/>

Hope this helps!

qortex

comment created time in 2 months

issue commentrubyide/vscode-ruby

Setting a custom path for "ruby.format": "rubocop"

Hi @wingrunr21, sorry I didn't reply until now! I am just setting up rubocop-daemon-wrapper again, and I'm still struggling to set the path for rubocop. This is my settings.json:

  "ruby.lint": {
    "rubocop": {
      "path": "/usr/local/bin/rubocop-daemon-wrapper"
    }
  },
  "ruby.format": "rubocop"

(I'm trying to run the rubocop wrapper at /usr/local/bin/rubocop-daemon-wrapper/rubocop.)

Should this work, or do I need to change my settings?

ndbroadbent

comment created time in 2 months

issue closedrubyide/vscode-ruby

Textmate scopes and syntax highlighting

Your environment

  • vscode-ruby version: 0.27.0
  • Ruby version: 2.4.1
  • Ruby version manager (if any): chruby
  • VS Code version: 1.43.2
  • Operating System: macOS 10.15.4 (Catalina)
  • Using language server? nope

Expected behavior

I had expected user and company (second last line) to get the same syntax highlight treatment. One is classified as a support.function.core.ruby and the other entity.name.function.ruby.

Actual behavior

sh1

sh2

closed time in 2 months

sandstrom

issue commentrubyide/vscode-ruby

Textmate scopes and syntax highlighting

fixed in https://github.com/rubyide/vscode-ruby/commit/73e8e6fbdaa0884a65a6f64f4805bc32d484ff57

sandstrom

comment created time in 2 months

issue commentrubyide/vscode-ruby

Textmate scopes and syntax highlighting

Great news! thanks @smridge for letting me know! 👍

sandstrom

comment created time in 2 months

issue commentrubyide/vscode-ruby

Textmate scopes and syntax highlighting

I had the same issue, it looks like this will be resolved with the next release https://github.com/rubyide/vscode-ruby/commit/73e8e6fbdaa0884a65a6f64f4805bc32d484ff57

sandstrom

comment created time in 2 months

pull request commentrubyide/vscode-ruby

Add Range Operator

Codecov Report

Merging #609 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #609   +/-   ##
======================================
  Coverage    5.04%   5.04%           
======================================
  Files          10      10           
  Lines         119     119           
  Branches       20      20           
======================================
  Hits            6       6           
  Misses        113     113           
Flag Coverage Δ
#language_server_ruby 5.04% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 19b8b34...30a3a28. Read the comment docs.

smridge

comment created time in 2 months

PR opened rubyide/vscode-ruby

Add Range Operator

Inconsistent syntax highlighting for range operators. Sometimes causing a mix of one . to be identified as punctuation.separator.method.ruby and the other unidentified (source.ruby) if followed by a Constant.

Docs: Ruby Range.

  • [] The build passes
  • [] TSLint is mostly happy
  • [] Prettier has been run
+4 -0

0 comment

1 changed file

pr created time in 2 months

pull request commentrubyide/vscode-ruby

Add Ternary Else Operator : to Keywords

Codecov Report

Merging #608 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #608   +/-   ##
======================================
  Coverage    5.04%   5.04%           
======================================
  Files          10      10           
  Lines         119     119           
  Branches       20      20           
======================================
  Hits            6       6           
  Misses        113     113           
Flag Coverage Δ
#language_server_ruby 5.04% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 19b8b34...889b01e. Read the comment docs.

smridge

comment created time in 2 months

PR opened rubyide/vscode-ruby

Add Ternary Else Operator : to Keywords

Description of change and why it was needed here

  • [] The build passes
  • [] TSLint is mostly happy
  • [] Prettier has been run
+4 -0

0 comment

1 changed file

pr created time in 2 months

pull request commentrubyide/vscode-ruby

Fix Block Comment

Codecov Report

Merging #607 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #607   +/-   ##
======================================
  Coverage    5.04%   5.04%           
======================================
  Files          10      10           
  Lines         119     119           
  Branches       20      20           
======================================
  Hits            6       6           
  Misses        113     113           
Flag Coverage Δ
#language_server_ruby 5.04% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 19b8b34...cb9432b. Read the comment docs.

smridge

comment created time in 2 months

PR opened rubyide/vscode-ruby

Fix Block Comment

Block Comments not properly commenting out blocks of .erb code. Setting block comments to traditional html solves issue.

Before: before

After: after

  • [] The build passes
  • [] TSLint is mostly happy
  • [] Prettier has been run
+2 -2

0 comment

1 changed file

pr created time in 2 months

issue openedrubyide/vscode-ruby

Show watch variables as tree when hash?

When variables are added to the watch pane, they are stringified and do not benefit from the "tree" UX that is available in the variables pane for exemple.

Is there a way to get that? Example, the watch variable is a string and not a tree, whereas it is a tree in the variables pane:

image

created time in 2 months

pull request commentrubyide/vscode-ruby

Update Variable Other to Recognize if variable includes ? or !

Codecov Report

Merging #605 into master will not change coverage by %. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #605   +/-   ##
======================================
  Coverage    5.04%   5.04%           
======================================
  Files          10      10           
  Lines         119     119           
  Branches       20      20           
======================================
  Hits            6       6           
  Misses        113     113           
Flag Coverage Δ
#language_server_ruby 5.04% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 19b8b34...d5c10f8. Read the comment docs.

smridge

comment created time in 2 months

PR opened rubyide/vscode-ruby

Update Variable Other to Recognize if variable includes ? or !

Inconsistent syntax highlighting causing word if followed by a ? or ! to not be recognized together.

Ruby allows for method names to include ? & !.

  • [] The build passes
  • [] TSLint is mostly happy
  • [] Prettier has been run
+1 -1

0 comment

1 changed file

pr created time in 2 months

fork smridge/vscode-ruby

Provides Ruby language and debugging support for Visual Studio Code

https://marketplace.visualstudio.com/items?itemName=rebornix.Ruby

fork in 2 months

startedrubyide/vscode-ruby

started time in 2 months

startedrubyide/vscode-ruby

started time in 2 months

more