简体   繁体   中英

Are Ruby keyword arguments supported by Eclipse's dynamic languages toolkit?

I have Ruby code that uses "keyword arguments" like so:

def run_cmd(command, arg1: true, arg2: nil)
  ...
end

When I run the code, it works as expected, but my IDE doesn't seem to know how to interpret this. It renders the formatting of my entire file incorrectly because of these keyword arguments. Are keyword arguments not supported by Eclipse's Dynamic Languages Toolkit? (I'm using DLTK version 2.0.0) If not, is there a different Eclipse plug-in I should be using for Ruby?

You don't even need to know anything about Ruby or DLTK to answer this question, just common sense is enough:

Keyword arguments were added in Ruby 2.0, which was released in honor of Ruby's 20th anniversary on February, 24th 2013 . Eclipse DLTK 2.0.0 was released on June, 24th 2010 , over ten years ago and almost three years before Ruby 2.0.

So, by the simple laws of phyics and some common sense, it is immediately clear that DLTK 2.0.0 cannot possibly support Ruby 2.0 keyword arguments, because they simply did not exist back then.

As a general rule, you should expect some breakage and limitations when using ten year old IDEs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM