summaryrefslogtreecommitdiff
path: root/lib/irb
AgeCommit message (Collapse)Author
2023-11-22[ruby/irb] Rescue Exception, ignore warning in completiontomoya ishida
doc_namespace (https://github.com/ruby/irb/pull/777) https://github.com/ruby/irb/commit/c2f671611a
2023-11-21[ruby/irb] Bump version to 1.9.1tomoya ishida
(https://github.com/ruby/irb/pull/773) https://github.com/ruby/irb/commit/997df3e849
2023-11-21[ruby/irb] Enable Setting Completer Type through `IRB_COMPLETOR`ima1zumi
(https://github.com/ruby/irb/pull/771) I propose introducing the capability to set the IRB completion kinds via an environment variable, specifically `IRB_COMPLETOR=type`. This feature aims to enhance the Rails console experience by allowing Rails users to specify their preferred completion more conveniently. Currently, when using the Rails console, there's no straightforward way to globally set the type completion across a Rails application repository. It's possible to configure this setting by placing a `.irbrc` file at the project root. However, using a .irbrc file is not ideal as it allows for broad configurations and can potentially affect the production environment. My suggestion focuses on allowing users to set the completion to 'type' in a minimal. This enhancement would be particularly beneficial for teams writing RBS in their Rails applications. This type completer, integrated with RBS, would enhance completion accuracy, improving the Rails console experience. https://github.com/ruby/irb/commit/032f6da25f
2023-11-18[ruby/irb] Fix irb crash on `{}.` completiontomoya ishida
(https://github.com/ruby/irb/pull/764) https://github.com/ruby/irb/commit/07e4d540cc
2023-11-10[ruby/irb] Bump version to 1.9.0ima1zumi
(https://github.com/ruby/irb/pull/757) https://github.com/ruby/irb/commit/41548b8bd0
2023-11-09[ruby/irb] Add command line option to select which completor to usetomoya ishida
(https://github.com/ruby/irb/pull/754) * Add command line option to select which completor to use * Add test for completor argv https://github.com/ruby/irb/commit/1dec2708c9
2023-11-08[ruby/irb] Type based completion using Prism and RBStomoya ishida
(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
2023-11-08[ruby/irb] Fix dancing-ruby Ctrl+C stoptomoya ishida
(https://github.com/ruby/irb/pull/735) https://github.com/ruby/irb/commit/802b1cb6d8
2023-10-28[ruby/irb] Easter egg for autocomplete modetomoya ishida
(https://github.com/ruby/irb/pull/737) * Show easter-egg inside document dialog in autocomplete mode * Show more easter_egg(dancing or logo) when Alt+d is pressed in autocomplete mode https://github.com/ruby/irb/commit/a8e5cc7354
2023-10-21[ruby/irb] Minor refactors around irb.rbStan Lo
(https://github.com/ruby/irb/pull/736) * Remove dead method * Simplify IRB.version * Move private Irb methods together * Centralise @CONF initialization/assignment in init.rb * Move attr_* calls above initialize method https://github.com/ruby/irb/commit/cf23be4395
2023-10-14[ruby/irb] Bump version to 1.8.3tomoya ishida
(https://github.com/ruby/irb/pull/731) https://github.com/ruby/irb/commit/de79375ac1
2023-10-14[ruby/irb] Restore IRB::InputCompletor for compatibilitytomoya ishida
(https://github.com/ruby/irb/pull/730) https://github.com/ruby/irb/commit/77265efc5f
2023-10-12[ruby/irb] Bump version to 1.8.2Stan Lo
https://github.com/ruby/irb/commit/47693a2213
2023-10-12[ruby/irb] Fix require path completion disturbing string methodtomoya ishida
completion (https://github.com/ruby/irb/pull/726) https://github.com/ruby/irb/commit/e42dc74ce0
2023-10-12[ruby/irb] Fix test runner exit bugtomoya ishida
(https://github.com/ruby/irb/pull/728) * Remove useless test setup and teardown that sets MAIN_CONTEXT to nil * Avoid adding command methods to main object in test https://github.com/ruby/irb/commit/f204829a08
2023-10-12[ruby/irb] Decouple RubyLex from prompt and line_notomoya ishida
(https://github.com/ruby/irb/pull/701) * Remove instance variable prompt and line_no from RubyLex * Fix prompt test * Rename prompt generating method and make it private https://github.com/ruby/irb/commit/1ceb97fe2e
2023-10-11Fix calling exit if irb_context is nilTakashi Kokubun
Trying to avoid a flaky failure like: https://github.com/ruby/ruby/actions/runs/6486918029/job/17616113816
2023-10-11[ruby/irb] Rename current completor to RegexpCompletor andtomoya ishida
refactored for future extension (https://github.com/ruby/irb/pull/707) * Move completion implementation to completion/regexp_completor for future extension * Remove constant CompletionProc and PerfectMatchedProc and add a class method * Move document display logic to InputCompletor. Each completor only need to implement `completion_caididates` and `doc_namespace` * Move display_document logic to RelineInputMethod * Use RegexpCompletor directly. Not through class method of InputCompletor. * RegexpCompletor extends BaseCompletor, move back definition to completion.rb * Move display_document test to input_method test * Stop re-initialize completor on each completion phase * Store completor to ReadlineInputMethod's iver https://github.com/ruby/irb/commit/1e98521483
2023-10-11[ruby/irb] Avoid locking the debug UI to a single threadStan Lo
(https://github.com/ruby/irb/pull/725) Since `debug` stores and updates the target thread via its Session's `@tc` variable, we don't need to and shouldn't lock the UI to the thread that activates the integration. https://github.com/ruby/irb/commit/202efdbf0c
2023-10-04[ruby/irb] Clear all context usages in RubyLexStan Lo
(https://github.com/ruby/irb/pull/684) After this change, `RubyLex` will not interact with `Context` directly in any way. This decoupling has a few benefits: - It makes `RubyLex` easier to test as it no longer has a dependency on `Context`. We can see this from the removal of `build_context` from `test_ruby_lex.rb`. - It will make `RubyLex` easier to understand as it will not be affected by state changes in `Context` objects. - It allows `RubyLex` to be used in places where `Context` is not available. https://github.com/ruby/irb/commit/d5b262a076
2023-09-22[ruby/irb] Page show_source's outputStan Lo
(https://github.com/ruby/irb/pull/719) https://github.com/ruby/irb/commit/3cedc5cb62
2023-09-16[ruby/irb] Handle Concurrent Sessions and Saving Readline::HISTORYChad Schroeder
(https://github.com/ruby/irb/pull/651) * handle concurrent sessions and saving Readline::HISTORY, fixes https://github.com/ruby/irb/pull/510 * separate tests * don't mutate the HISTORY object on the class * avoid repeated .to_i calls * remove intermediary history array * work with array, fix test comment --------- https://github.com/ruby/irb/commit/1681ada328 Co-authored-by: Stan Lo <stan001212@gmail.com>
2023-09-05[ruby/irb] Bump version to 1.8.1Stan Lo
(https://github.com/ruby/irb/pull/706) https://github.com/ruby/irb/commit/c7c838a4bf
2023-08-31[ruby/irb] Drop rdoc's version requirementStan Lo
(https://github.com/ruby/irb/pull/704) 1. The newer versions of rdoc requires pysch 4.0+, which could break apps using Ruby 3.0 or 2.7. #703 has more detailed explanation on this. 2. We actually don't use any version-specific rdoc APIs. So having a version requirement is not necessary atm. https://github.com/ruby/irb/commit/3e6ba78c42
2023-08-31[ruby/irb] Require Reline 0.3.8+Stan Lo
(https://github.com/ruby/irb/pull/702) Reline 0.3.8 reduces the chance of having a deadlock with the debugger while using the new `irb:rdbg` integration. https://github.com/ruby/irb/commit/9b8c56b7d4
2023-08-30[ruby/irb] Bump version to 1.8.0Stan Lo
(https://github.com/ruby/irb/pull/700) https://github.com/ruby/irb/commit/a061744ed3
2023-08-29[ruby/irb] Improve help/show_cmds message during debuggerStan Lo
integration (https://github.com/ruby/irb/pull/693) * `help` should display debugger's help during irb:rdbg session * Update `show_cmds`'s output when in irb:rdbg session https://github.com/ruby/irb/commit/4029c2e564
2023-08-29[ruby/irb] irb:rdbg cleanups (https://github.com/ruby/irb/pull/697)Stan Lo
* Remove unused method and constant from IRB::Debug * Update comments https://github.com/ruby/irb/commit/98914a963c
2023-08-29[ruby/irb] Print deprecation message for prompt_n methodsStan Lo
(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
2023-08-29[ruby/irb] Remove unused `PROMPT_N`Summer ☀️
(https://github.com/ruby/irb/pull/685) https://github.com/ruby/irb/commit/66e69fa0dc
2023-08-24[ruby/irb] Deprecate RubyLex and warn about referencing to itStan Lo
(https://github.com/ruby/irb/pull/692) `RubyLex` has always been a private component of IRB, so we should explicitly discourage usages of it. Also, it should be placed under the `IRB` module like other components. https://github.com/ruby/irb/commit/069b5625f7
2023-08-21[ruby/irb] Avoid overriding user's `irb_name` setting in debuggerStan Lo
integration (https://github.com/ruby/irb/pull/688) * Avoid overriding user's irb_name setting in debugger integration Instead of always setting `irb_name` to `irb:rdbg`, it should respect the user's setting and only append `:rdbg` to it. * Introduce write_rc test helper https://github.com/ruby/irb/commit/2ce7593351
2023-08-21[ruby/irb] Move input processing out of RubyLexStan Lo
(https://github.com/ruby/irb/pull/683) * Add a test case for Ctrl-C handling * Test symbol aliases with integration tests There are a few places that also need to check symbol aliases before `Irb#eval_input`. But since the current command test skip them, we don't have test coverage on them. * Move each_top_level_statement and readmultiline to Irb This will save RubyLex from knowning information about commands and aliases. https://github.com/ruby/irb/commit/69cb5b5615
2023-08-20[ruby/irb] Support `VISUAL` env var, and prefer it over `EDITOR`Summer ☀️
(https://github.com/ruby/irb/pull/686) * Support `VISUAL` env var, and prefer it over `EDITOR` * Update test/irb/test_cmd.rb --------- https://github.com/ruby/irb/commit/399b872c31 Co-authored-by: Stan Lo <stan001212@gmail.com>
2023-08-16[ruby/irb] Encapsulate input details in Statement objectsStan Lo
(https://github.com/ruby/irb/pull/682) * Introduce Statement class * Split Statement class for better clarity https://github.com/ruby/irb/commit/65e8e68690
2023-08-13[ruby/irb] Support seamless integration with ruby/debugStan Lo
(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
2023-08-13[ruby/irb] Move IO configuration to IRB::IrbStan Lo
(https://github.com/ruby/irb/pull/681) It shouldn't be `RubyLex`'s responsibility to handle IO. So this moves the configuration to `IRB::Irb`. https://github.com/ruby/irb/commit/daff750076
2023-08-13[ruby/irb] Remove useless `begin`/`end` [ci skip]Nobuyoshi Nakada
(https://github.com/ruby/irb/pull/680) The `rescue` was removed at https://github.com/ruby/irb/commit/420e7d227011. https://github.com/ruby/irb/commit/8fa688e9c0
2023-08-12[ruby/irb] Drop showing indent level number in DEFAULT prompt andtomoya ishida
INF_RUBY prompt (https://github.com/ruby/irb/pull/679) * Drop showing indent level number in DEFAULT prompt and INF_RUBY prompt * Update prompt part of test_rendering's expected result https://github.com/ruby/irb/commit/3847532e54
2023-08-12[ruby/irb] Reline/ReadlineInputMethod should inheritStan Lo
StdioInputMethod (https://github.com/ruby/irb/pull/671) They are both built on top of stdio and are basically extended version of StdioInputMethod. They also share several attributes and methods with StdioInputMethod. https://github.com/ruby/irb/commit/c5f5abdbde
2023-08-11[ruby/irb] Remove needless removal of trailing whitespace intomoya ishida
check_code_state (https://github.com/ruby/irb/pull/678) https://github.com/ruby/irb/commit/4a6af7d1ed
2023-08-11[ruby/irb] Move assignment check to RubyLexStan Lo
(https://github.com/ruby/irb/pull/670) Since assignment check relies on tokenization with `Ripper`, it feels like the responsibility of `RubyLex`. `Irb#eval_input` should simply get the result when calling `each_top_level_statement` on `RubyLex`. https://github.com/ruby/irb/commit/89d1adb3fd
2023-08-11[ruby/irb] Add black and white color to IRB::ColorStan Lo
(https://github.com/ruby/irb/pull/676) https://github.com/ruby/irb/commit/a2763acade
2023-08-09[ruby/irb] Fix nested IRB sessions' history savingStan Lo
(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
2023-08-07[ruby/irb] Remove unused `InputMethod#initialize`Stan Lo
(https://github.com/ruby/irb/pull/635) * Remove unused InputMethod#initialize The constructor takes a `file_name` argument, but it is never used. The only input method that needs a file is `FileInputMethod`, which has its own constructor to take a file object directly. So the constructor in `InputMethod` is not needed and its child classes don't need to call `super` in their constructors. * Remove unused FileInputMethod#file_name https://github.com/ruby/irb/commit/153b1e9d1c
2023-08-02[ruby/irb] Deprecate multi-irb commandsStan Lo
(https://github.com/ruby/irb/pull/654) * Deprecate multi-irb commands - Print deprecated message when any of the commands are used - Put related commands under `Multi-irb` category with a deprecated label * Update readme https://github.com/ruby/irb/commit/861731ac12
2023-08-02[ruby/irb] Drop src_encoding.rbStan Lo
(https://github.com/ruby/irb/pull/634) Its method `IRB.default_src_encoding` was only used in `magic-file.rb`, which has been removed. https://github.com/ruby/irb/commit/ed98983b1f
2023-08-01[ruby/irb] Add workspace categoryStan Lo
(https://github.com/ruby/irb/pull/661) * Create a new Workspace command category * Update readme https://github.com/ruby/irb/commit/310650c213
2023-07-31[ruby/irb] Decouple `edit` and `show_source` commandsStan Lo
(https://github.com/ruby/irb/pull/658) * Decouple `edit` command from `show_source` 2 commands should not depend on each other. If `edit` command also needs to find a source, the source finding logic should be extracted into a separate class. * Return nil if is not an actual file path * Refactor SourceFinder https://github.com/ruby/irb/commit/9790517a0c
2023-07-26[ruby/irb] Page `ls`'s output (https://github.com/ruby/irb/pull/657)Stan Lo
* Page ls command's output * Use Pager.page_content in show_cmds too https://github.com/ruby/irb/commit/82d1687302