[SERVER-4052] Suggestion: allow case-insensitive command completion in the shell Created: 10/Oct/11 Updated: 11/Jul/16 Resolved: 28/Nov/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | None |
| Fix Version/s: | 2.1.0 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Tad Marshall | Assignee: | Tad Marshall |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
JavaScript is a case-sensitive language, which is generally a fine feature, but it makes typing in legal JavaScript a little harder than it might be. The problem is when you created a property and don't remember exactly how you used camelCase in it. For example: MongoDB shell version: 2.1.0-pre- > user.zip // hit tab – command completion doesn't work because you spelled ZipCode with an initial cap The code that provides the command completion is in JavaScript and is doing a simple string comparison of possibilities with what we are trying to match. See shell/utils.js and matching code in shell/mongo_vstudio.cpp . if (p.substr(0, lastPrefix.length) != lastPrefix) continue; // skip items that don't match (my comment) It could easily do a case-insensitive comparison instead. if (p.substr(0, lastPrefix.length).toLowerCase() != lastPrefixLowercase) continue; // set up lastPrefixLowercase before loop The code would always return the case-correct completion, so this is just a convenience in typing, making the tab completion feature a tiny bit more useful. The cases where users would be annoyed by seeing case-insensitive matches seem likely to be fewer than the cases where this would be helpful. |
| Comments |
| Comment by Tad Marshall [ 28/Nov/11 ] |
|
Fixed by commit e5a54592f1ed5947b518ef1ca98ae91f68a2520a . |
| Comment by auto [ 28/Nov/11 ] |
|
Author: {u'login': u'', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}Message: Provide command completions for partially typed commands without |