summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2021-06-18 17:11:39 +0900
committerYusuke Endoh <mame@ruby-lang.org>2021-06-29 23:45:49 +0900
commite94604966572bb43fc887856d54aa54b8e9f7719 (patch)
tree789d92c232f671c6620af5c4bfd1a3fc0d9d26b3 /ruby.c
parent03dc66449326ce0945c1ccad7f51e57125b2b854 (diff)
[WIP] add error_squiggle gem
``` $ ./local/bin/ruby -e '1.time {}' -e:1:in `<main>': undefined method `time' for 1:Integer (NoMethodError) 1.time {} ^^^^^ Did you mean? times ``` https://bugs.ruby-lang.org/issues/17930
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4586
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ruby.c b/ruby.c
index baa2f251c2..c8b3964c39 100644
--- a/ruby.c
+++ b/ruby.c
@@ -94,6 +94,8 @@ void rb_warning_category_update(unsigned int mask, unsigned int bits);
#define EACH_FEATURES(X, SEP) \
X(gems) \
SEP \
+ X(error_squiggle) \
+ SEP \
X(did_you_mean) \
SEP \
X(rubyopt) \
@@ -320,6 +322,7 @@ usage(const char *name, int help, int highlight, int columns)
};
static const struct message features[] = {
M("gems", "", "rubygems (only for debugging, default: "DEFAULT_RUBYGEMS_ENABLED")"),
+ M("error_squiggle", "", "error_squiggle (default: "DEFAULT_RUBYGEMS_ENABLED")"),
M("did_you_mean", "", "did_you_mean (default: "DEFAULT_RUBYGEMS_ENABLED")"),
M("rubyopt", "", "RUBYOPT environment variable (default: enabled)"),
M("frozen-string-literal", "", "freeze all string literals (default: disabled)"),
@@ -1508,6 +1511,9 @@ ruby_opt_init(ruby_cmdline_options_t *opt)
if (opt->features.set & FEATURE_BIT(gems)) {
rb_define_module("Gem");
+ if (opt->features.set & FEATURE_BIT(error_squiggle)) {
+ rb_define_module("ErrorSquiggle");
+ }
if (opt->features.set & FEATURE_BIT(did_you_mean)) {
rb_define_module("DidYouMean");
}