Age | Commit message (Collapse) | Author |
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12624
|
|
launch
(https://github.com/ruby/irb/pull/1040)
* Quickly show inspect preview even if pretty_print takes too much time
* Show a message "Inspecting..." while generating pretty_print content
* Update inspecting message
Co-authored-by: Stan Lo <[email protected]>
* Update rendering test for preparing inspect message
* Don't show preview if pretty_print does not take time
---------
https://github.com/ruby/irb/commit/03c36586e6
Co-authored-by: Stan Lo <[email protected]>
Notes:
Merged: https://github.com/ruby/ruby/pull/12612
|
|
Closes https://github.com/ruby/irb/pull/753
https://github.com/ruby/irb/commit/a24ac53d48
Notes:
Merged: https://github.com/ruby/ruby/pull/12612
|
|
(https://github.com/ruby/irb/pull/1064)
This makes them easier to find and matches the convention of the codebase.
https://github.com/ruby/irb/commit/ce8fa6857c
|
|
(https://github.com/ruby/irb/pull/1059)
* Gracefully handle incorrect command aliases
Even if the aliased target is a helper method or does not exist, IRB
should not crash.
This commit warns users in such cases and treat the input as normal expression.
* Streamline command parsing and introduce warnings for incorrect command aliases
https://github.com/ruby/irb/commit/9fc14eb74b
|
|
(https://github.com/ruby/irb/pull/1033)
It probably won't speed up things significantly, but these are hot paths
and we can save a few method calls per completion/input call.
https://github.com/ruby/irb/commit/f1e25ec7ae
|
|
(https://github.com/ruby/irb/pull/1034)
https://github.com/ruby/irb/commit/9750fa23cc
|
|
TypeCompletor and fallback to RegexpCompletor.
(https://github.com/ruby/irb/pull/1010)
https://github.com/ruby/irb/commit/bb6a99d815
|
|
(https://github.com/ruby/irb/pull/1006)
* Fix debug command in nomultiline mode
* context.colorize_code -> context.colorize_input
https://github.com/ruby/irb/commit/71f4d6bfb5
|
|
of irb_break irb_catch and irb_next command
(https://github.com/ruby/irb/pull/1004)
* Remove KEYWORD_ALIASES which handled special alias name of irb_break irb_catch and irb_next command
* Remove unused instance variable user_aliases
Co-authored-by: Stan Lo <[email protected]>
---------
https://github.com/ruby/irb/commit/f256d7899f
Co-authored-by: Stan Lo <[email protected]>
|
|
(https://github.com/ruby/irb/pull/993)
Since Context dictates whether a line is a command or an expression,
moving the parse_command method to Context makes the relationship
more explicit.
https://github.com/ruby/irb/commit/9a4487af61
|
|
(https://github.com/ruby/irb/pull/972)
In #934, we changed command calls to return nil only. This PR improves
the behaviour even further by:
- Not echoing the `nil` returned by command calls
- Not overriding previous return value stored in `_` with the
`nil` from commands
https://github.com/ruby/irb/commit/c844176842
|
|
values
(https://github.com/ruby/irb/pull/953)
Currently, users can only find out that they have set a wrong value
for IRB configs when the value is used, with opaque error messages like
"comparison of Integer with true failed (TypeError)".
This commit adds a new initialization step to validate the values of
some IRB configs, so that users can find out about the wrong values
during the initialization of IRB.
https://github.com/ruby/irb/commit/af8ef2948b
|
|
check
(https://github.com/ruby/irb/pull/947)
https://github.com/ruby/irb/commit/4a4d7a4279
|
|
|
|
(https://github.com/ruby/irb/pull/934)
Since commands can't be chained with methods, their return values are
not intended to be used. But if IRB keeps storing command return values
as the last value, and print them, users may rely on such implicit
behaviour.
So to avoid such confusion, this commit suppresses command's
return values. It also updates some commands that currently rely on
this implicit behaviour.
https://github.com/ruby/irb/commit/fa96bea76f
|
|
(https://github.com/ruby/irb/pull/920)
This has a few benefits:
- We can keep hiding the evaluation logic inside the Context level, which
has always been the convention until #824 was merged recently.
- Although not an official API, gems like `debug` and `mission_control-jobs`
patch `Context#evaluate` to wrap their own logic around it. This implicit
contract was broken after #824, and this change restores it.
In addition to the refactor, I also converted some context-level evaluation
tests into integration tests, which are more robust and easier to maintain.
https://github.com/ruby/irb/commit/b32aee4068
|
|
(https://github.com/ruby/irb/pull/824)
* Command is not a method
* Fix command test
* Implement non-method command name completion
* Add test for ExtendCommandBundle.def_extend_command
* Add helper method install test
* Remove spaces in command input parse
* Remove command arg unquote in help command
* Simplify Statement and handle execution in IRB::Irb
* Tweak require, const name
* Always install CommandBundle module to main object
* Remove considering local variable in command or expression check
* Remove unused method, tweak
* Remove outdated comment for help command arg
Co-authored-by: Stan Lo <[email protected]>
---------
https://github.com/ruby/irb/commit/8fb776e379
Co-authored-by: Stan Lo <[email protected]>
|
|
(https://github.com/ruby/irb/pull/888)
* Remove dead irb_level method
* Restructure workspace management
Currently, workspace is an attribute of IRB::Context in most use cases.
But when some workspace commands are used, like `pushws` or `popws`, a
workspace will be created and used along side with the original workspace
attribute.
This complexity is not necessary and will prevent us from expanding
multi-workspace support in the future.
So this commit introduces a @workspace_stack ivar to IRB::Context so IRB
can have a more natural way to manage workspaces.
* Fix pushws without args
* Always display workspace stack after related commands are used
https://github.com/ruby/irb/commit/61560b99b3
|
|
(https://github.com/ruby/irb/pull/889)
https://github.com/ruby/irb/commit/7b323ee514
|
|
(https://github.com/ruby/irb/pull/881)
https://github.com/ruby/irb/commit/83d90550c2
|
|
(https://github.com/ruby/irb/pull/882)
* Unroll extension method generation
Given we only have 2 remaining extension setter methods, both of which
only take 1 argument and don't have any alias, the current method generation
logic is overly complicated.
This commit simplifies the method generation logic by simply defining
the methods directly in the `IRB::Context` class.
* Fix use_loader extension
https://github.com/ruby/irb/commit/67eba5401b
|
|
(https://github.com/ruby/irb/pull/870)
* Assign `@eval_path` through `irb_path=` method
This simplifies the original caching logic for the `eval_path` method
and makes it easier to understand.
* Refactor SourceFinder::Source
https://github.com/ruby/irb/commit/c63e4c4035
|
|
(https://github.com/ruby/irb/pull/862)
* Powerup show_source by enabling RubyVM.keep_script_lines
* Add file_content field to avoid reading file twice while show_source
* Change path passed to eval, don't change irb_path.
* Encapsulate source coloring logic and binary file check insode class Source
* Add edit command testcase when irb_path does not exist
* Memoize irb_path existence to reduce file existence check calculating eval_path
https://github.com/ruby/irb/commit/239683a937
|
|
(https://github.com/ruby/irb/pull/864)
* Remove useless ivar
* Simplify tracer test setup
* Treat tracer like a normal development dependency
* Only require ext/tracer when value is truthy
* Make tracer integration skip IRB traces
https://github.com/ruby/irb/commit/a97a4129a7
|
|
(https://github.com/ruby/irb/pull/857)
The new tests are skipped when ruby below 3.1, as it was a default gem on it, and in a version we do not support.
This also move definition of `use_tracer` to module Context instead of monkey patch.
https://github.com/ruby/irb/commit/08834fbd5f
|
|
https://github.com/ruby/irb/commit/2ffacaa031
|
|
(https://github.com/ruby/irb/pull/835)
* Remove unnecessary code from the exit command's implementation
1. The parameters of `IRB.irb_exit` were never used. But there are some
libraries seem to call it with arguments + it's declared on the top-level
IRB constant. So I changed the params to anonymous splat instead of removing them.
2. `Context#exit` was completely unnecessary as `IRB.irb_exit` doesn't use
the `@irb` instance it passes. And since it's (or should be treated as)
a private method, I simply removed it.
3. The `exit` command doesn't use the status argument it receives at all.
But to avoid raising errors on usages like `exit 1`, I changed the argument to
anonymous splat instead removing it.
* Make exit an actual command
* Update readme
https://github.com/ruby/irb/commit/452b543a65
|
|
(https://github.com/ruby/irb/pull/738)
[DOC] RDoc for module IRB
https://github.com/ruby/irb/commit/f3a0626298
|
|
implementation
(https://github.com/ruby/irb/pull/772)
https://github.com/ruby/irb/commit/a4868a5373
|
|
(https://github.com/ruby/irb/pull/788)
Similar to Pry, it displays user-defined aliases in the help message with
a dedicated section. With the current default aliases, it looks like:
```
...other sections...
Aliases
$ Alias for `show_source`
@ Alias for `whereami`
```
https://github.com/ruby/irb/commit/2a0eacc891
|
|
CaseMatchNode)
(https://github.com/ruby/irb/pull/778)
https://github.com/ruby/irb/commit/943c14b12e
|
|
(https://github.com/ruby/irb/pull/708)
* Add completor using prism and rbs
* Add TypeCompletion test
* Switchable completors: RegexpCompletor and TypeCompletion::Completor
* Add completion info to irb_info
* Complete reserved words
* Fix [*] (*) {**} and prism's change of KeywordParameterNode
* Fix require, frozen_string_literal
* Drop prism<=0.16.0 support
* Add Completor.last_completion_error for debug report
* Retrieve `self` and `Module.nesting` in more safe way
* Support BasicObject
* Handle lvar and ivar get exception correctly
* Skip ivar reference test of non-self object in ruby < 3.2
* BaseScope to RootScope, move method objects constant under Methods
* Remove unused Splat struct
* Drop deeply nested array/hash type calculation from actual object. Now, calculation depth is 1
* Refactor loading rbs in test, change preload_in_thread not to cache Thread object
* Use new option added in prism 0.17.1 to parse code with localvars
* Add Prism version check and warn when :type completor cannot be enabled
* build_type_completor should skip truffleruby (because endless method definition is not supported)
https://github.com/ruby/irb/commit/1048c7ed7a
|
|
(https://github.com/ruby/irb/pull/691)
They were removed in #685, but we should still keep them to avoid breaking
changes to tools like Chef.
https://github.com/chef/chef/blob/533ff089479763f29045e4e6ddf388b73fc99338/lib/chef/shell.rb#L138
https://github.com/ruby/irb/commit/b585e0c835
|
|
(https://github.com/ruby/irb/pull/685)
https://github.com/ruby/irb/commit/66e69fa0dc
|
|
(https://github.com/ruby/irb/pull/575)
* Support native integration with ruby/debug
* Prevent using multi-irb and activating debugger at the same time
Multi-irb makes a few assumptions:
- IRB will manage all threads that host sub-irb sessions
- All IRB sessions will be run on the threads created by IRB itself
However, when using the debugger these assumptions are broken:
- `debug` will freeze ALL threads when it suspends the session (e.g. when
hitting a breakpoint, or performing step-debugging).
- Since the irb-debug integration runs IRB as the debugger's interface,
it will be run on the debugger's thread, which is not managed by IRB.
So we should prevent the 2 features from being used at the same time.
To do that, we check if the other feature is already activated when
executing the commands that would activate the other feature.
https://github.com/ruby/irb/commit/d8fb3246be
|
|
(https://github.com/ruby/irb/pull/652)
1. Dynamically including `HistorySavingAbility` makes things unnecessarily
complicated and should be avoided.
2. Because both `Reline` and `Readline` use a single `HISTORY` constant
to store history data. When nesting IRB sessions, only the first IRB
session should handle history loading and saving so we can avoid
duplicating history.
3. History saving callback should NOT be stored in `IRB.conf` as it's
recreated every time `IRB.setup` is called, which would happen when
nesting IRB sessions.
https://github.com/ruby/irb/commit/0fef0ae160
|
|
(https://github.com/ruby/irb/pull/642)
* Define RelineInputMethod::HISTORY
The HistorySavingAbility module doesn't do anything if the input method
class doesn't define HISTORY.
- https://github.com/ruby/irb/blob/3ac96be660bf052902fb4e532c7a46cf294b71eb/lib/irb/history.rb#L10
- https://github.com/ruby/irb/blob/3ac96be660bf052902fb4e532c7a46cf294b71eb/lib/irb/history.rb#L34
This patch defines RelineInputMethod::HISTORY to avoid this.
* Improve history-saving's ability check
Instead of checking the existence of `input_method_class::HISTORY`, we should
make every input method class declare if it supports history saving or not.
Since the default value is `false`, it shouldn't break any custom input method
that inherits from `IRB::InputMethod`.
https://github.com/ruby/irb/commit/aec7a5b3f5
|
|
(https://github.com/ruby/irb/pull/613)
Since `IRB.conf[:SAVE_HISTORY]` is assigned with 1000 by default, history-saving
is a feature enabled by default. So it should not be treated as an extension,
which adds unnecessary complexity to the code.
|
|
(https://github.com/ruby/irb/pull/618)
* Test last value is assigned with measure enabled
* Remove unnecessary `result` variable
`Context#evaluate` always assigns the result of the evaluation to `_` so
we don't need to do it in `Irb#eval_input`.
* Move benchmarking logic into `Context#evaluate`
Current location of the benchmarking logic is too high up and includes
operations like command loading and argument transformation, which should
be excluded. So this commit moves it into `Context#evaluate` to reduce the
noise.
We don't move it further down to `Workspace#evaluate` because `Context`
is an argument of the measure block, which is not available in `Workspace`.
|
|
the value is always nil
(https://github.com/ruby/irb/pull/617)
https://github.com/ruby/irb/commit/62691384f8
|
|
(https://github.com/ruby/irb/pull/615)
This makes sure `Context#evaluate` really just evaluates the input.
It will also make #575's implementation cleaner.
|
|
(https://github.com/ruby/irb/pull/488)
The context argument was introduced in this change:
https://github.com/ruby/irb/commit/6806669d178f90f38b99c144bdfee06bdb93a229#diff-296327851fb7a2c307c2d0693b769f58c01aaf315972f290500d10081ee200a9
perhaps for potential usages. But after that it's never used.
|
|
https://github.com/ruby/irb/commit/cef125850d
|
|
https://github.com/ruby/irb/commit/07fae94862
|
|
(https://github.com/ruby/irb/pull/449)
* Seamlessly integrate a few debug commands
* Improve the break command support
* Utilize skip_src option if available
* Add step and delete commands
* Write end-to-end tests for each debugger command
* Add documentation
* Add backtrace, info, catch commands
https://github.com/ruby/irb/commit/976100c1c2
|
|
Based on this commit: https://github.com/ruby/irb/commit/93f87ec65344b44123b0150a5fc07de1fd4c80c4
It appears that the maintainer @aycabta wanted to deprecate any `USE_*LINE` configs in favor of
`USE_MULTILINE`. So we should deprecate `USE_RELINE` as well.
https://github.com/ruby/irb/commit/478f19f3ae
|
|
(https://github.com/ruby/irb/pull/430)
* Support non-string input in show_source
* Test show_source as a method
|
|
(https://github.com/ruby/irb/pull/426)
* Allow non-identifier aliases
* Move the configuration to IRB.conf
* Avoid abusing method lookup for symbol aliases
* Add more alias tests
* A small optimization
* Assume non-nil Context
* Load IRB.conf earlier
https://github.com/ruby/irb/commit/e23db5132e
|
|
(https://github.com/ruby/irb/pull/397)
* Use local_variables for colorize, code_block_open check, nesting_level and assignment_expression check
* Check if expression is an assignment BEFORE evaluating it. evaluate might define new localvars and change result of assignment_expression?
* Add local_variables dependent code test
* pend local variable dependent test on truffleruby
code_block_open is not working on truffleruby
* Always pass context to RubyLex#lex
* Rename local_variable_assign_code generator method name
* Add assignment expression truncate test
* Add Context#local_variables and make generate_local_variables_assign_code more simple
* Update lib/irb/input-method.rb
Co-authored-by: Stan Lo <[email protected]>
* Add a comment why assignment expression check should be done before evaluate
https://github.com/ruby/irb/commit/c8b3877281
Co-authored-by: Stan Lo <[email protected]>
Co-authored-by: Takashi Kokubun <[email protected]>
|