Skip to content

Support Fuzzier Searching using navto #13909

@mjbvz

Description

@mjbvz

From microsoft/vscode#20039
TypeScript Version: 2.1.5

function helloWorld1() {}
function hElloWorld2() {}
function helloWOrld3() {}
function hElloWOrld4() {}

Expected behavior
A search with eo in any capitalization returns some results. This is how VSCode's search works for symbols in a document

Actual Behavior
Using navTo on tsserver, only a search term of EO returns any results

[Trace - 2:27:05 PM] Sending request: navto (24). Response expected: yes. Current queue length: 0
Arguments: {
    "file": "/Users/matb/projects/sandy/y.ts",
    "searchValue": "EO"
}
[Trace - 2:27:05 PM] Response received: navto (24). Request took 2 ms. Success: true 
Result: [
    {
        "name": "hElloWOrld4",
        "kind": "function",
        "file": "/Users/matb/projects/sandy/y.ts",
        "start": {
            "line": 4,
            "offset": 1
        },
        "end": {
            "line": 4,
            "offset": 26
        },
        "matchKind": "camelCase"
    }
]

Here's the logic we use on the VSCode side for filtering: https://github.com/Microsoft/vscode/blob/master/src/vs/base/common/filters.ts#L355

I believe fuzzySeparateFilter is the key difference

Metadata

Metadata

Assignees

No one assigned

    Labels

    Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScriptWon't FixThe severity and priority of this issue do not warrant the time or complexity needed to fix it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions