| Summary: | Fuzzy case matching for content assist | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | John Arthorne <john.arthorne> |
| Component: | JS Tools | Assignee: | Michael Rennie <Michael_Rennie> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | curtis.windatt.public, gujiman, Michael_Rennie |
| Version: | unspecified | ||
| Target Milestone: | 10.0 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
John Arthorne
Two cases: 1) If you type 'fore', then hit ctrl-space, Tern returns no completions. We never get to the looselyMatches check. 2) If you type 'f', hit ctrl-space, Tern returns several completions. Continuing to type 'ore' will result in all proposals being filtered. This is because the filtering is handled by the editor's content assist, which has no loose match checking. I had a similar problem in HTML when '<' is typed with content assist open, which I worked around by not including the '<' in the prefix. http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=1c7e7ef7331c62b042dc23b51448bc69c42173d8 Fixed case 1 in master. Tern needs a flag passed in to return caseInsensitive proposals. There is no support for camelcase matches, though if no proposals are found, Tern will use some heuristics to guess at potential properties. (In reply to Curtis Windatt from comment #2) > http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/ > ?id=1c7e7ef7331c62b042dc23b51448bc69c42173d8 > Fixed case 1 in master. Tern needs a flag passed in to return > caseInsensitive proposals. There is no support for camelcase matches, > though if no proposals are found, Tern will use some heuristics to guess at > potential properties. Thanks for pushing that part of the fix Curtis, here is the remainder and tests: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=749fff7d89892efb506faa0ffd865cfdb4dc0cb5 Mike said he is making other changes in this area. I opened Bug 473787 to track the second case, which is really an issue with editor content assist, not JS tools. i had a similar problem that i managed to fix it: open the file 'contentAssist.js' and search and replace the following 4 lines of code: search: proposalString.indexOf(prefixText + this._filterText) replace with: proposalString.toLowerCase().indexOf(prefixText.toLowerCase() + this._filterText.toLowerCase()) search: proposal.name.indexOf(prefixText + this._filterText) replace with: proposal.name.toLowerCase().indexOf(prefixText.toLowerCase() + this._filterText.toLowerCase()) search: proposal.proposal.indexOf(this._filterText) replace with: proposal.proposal.toLowerCase().indexOf(this._filterText.toLowerCase()) search: proposal.indexOf(this._filterText) replace with: proposal.toLowerCase().indexOf(this._filterText.toLowerCase()) What i have done here is told contentAssist to read what i have typed in to lower case and search fo proposals in lower case. |