<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:04:47 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-4043] Tab completion does not work in mid-code</title>
                <link>https://jira.mongodb.org/browse/SERVER-4043</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Tab completion in the shell seems to stop working after other code is already on the input line.  It seems like this dates to the introduction of linenoise as a readline replacement.&lt;/p&gt;

&lt;p&gt;MongoDB shell version: 2.1.0-pre-&lt;br/&gt;
&amp;gt; f=function(){} // define empty function&lt;br/&gt;
function () {&lt;br/&gt;
}&lt;br/&gt;
&amp;gt; f.toL&amp;lt;tab&amp;gt;ocaleString() // hit tab after &quot;f.toL&quot; and it completes (I added the &quot;)&quot;)&lt;br/&gt;
function () {&lt;br/&gt;
}&lt;br/&gt;
&amp;gt; typeof f.toL&amp;lt;tab&amp;gt; // nothing, no completion&lt;br/&gt;
undefined&lt;br/&gt;
&amp;gt; g=f.toL&amp;lt;tab&amp;gt; // nothing, no completion&lt;/p&gt;

&lt;p&gt;The behavior is the same in 1.9.1, 2.0.0 and the current code.  This works in 1.8.4-rc1-pre- built from source today.&lt;/p&gt;

&lt;p&gt;Tested in Ubuntu 11.04 with gnome terminal.&lt;/p&gt;


</description>
                <environment></environment>
        <key id="23417">SERVER-4043</key>
            <summary>Tab completion does not work in mid-code</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="tad">Tad Marshall</assignee>
                                    <reporter username="tad">Tad Marshall</reporter>
                        <labels>
                    </labels>
                <created>Sun, 9 Oct 2011 16:59:30 +0000</created>
                <updated>Mon, 11 Jul 2016 18:34:40 +0000</updated>
                            <resolved>Wed, 16 Nov 2011 20:47:06 +0000</resolved>
                                                    <fixVersion>2.1.0</fixVersion>
                                    <component>Shell</component>
                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="67248" author="tad" created="Wed, 16 Nov 2011 20:47:06 +0000"  >&lt;p&gt;Fixed by commit 9bef2fd11e1aa85581c41a7a9ac48ebfb94e7d63 (&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4043&quot; title=&quot;Tab completion does not work in mid-code&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-4043&quot;&gt;&lt;del&gt;SERVER-4043&lt;/del&gt;&lt;/a&gt; &amp;#8211; fix tab completion in mid-code).&lt;/p&gt;</comment>
                            <comment id="67242" author="auto" created="Wed, 16 Nov 2011 20:22:03 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;&apos;, u&apos;name&apos;: u&apos;Tad Marshall&apos;, u&apos;email&apos;: u&apos;tad@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4043&quot; title=&quot;Tab completion does not work in mid-code&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-4043&quot;&gt;&lt;del&gt;SERVER-4043&lt;/del&gt;&lt;/a&gt; &amp;#8211; fix tab completion in mid-code&lt;/p&gt;

&lt;p&gt;Add code to linenoise to do what readline was doing.  When tab is&lt;br/&gt;
hit, we need to search backwards from the insertion point for a&lt;br/&gt;
break character (we&apos;re using &quot; =+-/\\*?\&quot;&apos;`&amp;amp;&amp;lt;&amp;gt;;|@&lt;/p&gt;
{([])}
&lt;p&gt;&quot; for now)&lt;br/&gt;
and only pass the characters between that point and the cursor&lt;br/&gt;
position to the completion routine.  When it gives us possible&lt;br/&gt;
completions, we need to insert them in place of the string we&lt;br/&gt;
extracted, which makes completion work when not at the left margin&lt;br/&gt;
and even when inside another expression.  Linenoise was passing&lt;br/&gt;
the whole input line and substituting the replacement text for the&lt;br/&gt;
entire line.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/9bef2fd11e1aa85581c41a7a9ac48ebfb94e7d63&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/9bef2fd11e1aa85581c41a7a9ac48ebfb94e7d63&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="62979" author="tad" created="Thu, 27 Oct 2011 05:09:36 +0000"  >&lt;p&gt;Pull request 110 got closed and I forget if Dwight closed it or I did.  The problem wasn&apos;t with my fix which was and is good but with the incorrect way that I was issuing my pull requests.  I was making each pull request against a commit that was based on my previous commits and the way GitHub works this caused each of my pull requests to include every previous change I had made.  You can view the specific code changes for this bug at &lt;a href=&quot;https://github.com/tadmarshall/mongo/commit/8d04e31d9e4d71af2f8630cf3d4cd28daeca5557&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/tadmarshall/mongo/commit/8d04e31d9e4d71af2f8630cf3d4cd28daeca5557&lt;/a&gt; .&lt;/p&gt;

&lt;p&gt;I can resubmit the pull request but because there is a call to refreshLine(), there is an interaction with my larger fix to &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3771&quot; title=&quot;custom prompt usability issues&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3771&quot;&gt;&lt;del&gt;SERVER-3771&lt;/del&gt;&lt;/a&gt; in &lt;a href=&quot;https://github.com/mongodb/mongo/pull/123&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/pull/123&lt;/a&gt; (I changed one of the call&apos;s arguments).  If I create a new pull request for this bug fix, then it either requires pull request 123 to be applied first or there will be a merge conflict.&lt;/p&gt;

&lt;p&gt;There is enough information in the earlier (closed) pull request (110) in the commit mentioned above that someone could hand-merge the code if they felt like it, or I can resubmit a pull request dependent on 123 or a variation that assumes that 123 will be rejected.  Let me know what you&apos;d like.&lt;/p&gt;

&lt;p&gt;In any case, this is a significant bug (tab completion is broken at any location other than the start of a line) and the fix is available, so some version of the fix should get into the codebase.&lt;/p&gt;</comment>
                            <comment id="59434" author="tad" created="Mon, 10 Oct 2011 10:19:09 +0000"  >&lt;p&gt;Pull request &lt;a href=&quot;https://github.com/mongodb/mongo/pull/110&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/pull/110&lt;/a&gt; addresses this.&lt;/p&gt;</comment>
                            <comment id="59433" author="tad" created="Mon, 10 Oct 2011 09:57:45 +0000"  >&lt;p&gt;readline was doing some processing that we weren&apos;t emulating in linenoise.  It looks backwards in the input for a break character and only passes the portion of the buffer between the break character and the current position to the completion routine.  So, when I type &quot;g=f.toL&amp;lt;tab&amp;gt;&quot;, the 1.8.* readline code would pass &quot;f.toL&quot; to our command completion code, which it handled fine.  The newer linenoise code was passing &quot;g=f.toL&quot; which fails.  readline also inserts the completion text into the command line at the current position replacing the extracted portion.  linenoise was taking the completion text as a full command line replacement.  Doing what readline did should make the code work again.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 16 Nov 2011 20:22:03 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        12 years, 14 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 years, 14 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>tad</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hroogv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrgen3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9281</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrovfz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>