Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuzzy match in Explorer tree Find on an ISFS folder not fixed by #1443 #1445

Closed
gjsjohnmurray opened this issue Oct 4, 2024 · 1 comment · Fixed by #1446
Closed

Fuzzy match in Explorer tree Find on an ISFS folder not fixed by #1443 #1445

gjsjohnmurray opened this issue Oct 4, 2024 · 1 comment · Fixed by #1446
Assignees

Comments

@gjsjohnmurray
Copy link
Contributor

#1444 got Explorer Find working again for 1.94 but didn't deal with fuzzy match mode.

Related to microsoft/vscode#230483 (comment)

I will prepare a PR.

@gjsjohnmurray gjsjohnmurray self-assigned this Oct 4, 2024
@isc-bsaviano
Copy link
Contributor

isc-bsaviano commented Oct 4, 2024

@gjsjohnmurray I was messing around with a function that does this in the past. Not sure if it's complete though becuase it doesn't handle glob characters. It also converts the pattern to lowercase so in the query the column needs to be wrapped in LOWER. The explicit LOWER is needed because come columns have exact collation, so LIKE is case sensitive for them.

/** Convert `query` to a fuzzy LIKE compatible pattern */
export function queryToFuzzyLike(query: string): string {
  let p = "%";
  for (const c of query.toLowerCase()) p += `${["_", "%", "\\"].includes(c) ? "\\" : ""}${c}%`;
  return p;
}

@gjsjohnmurray gjsjohnmurray changed the title Fuzzy match in Explorer tree search of an ISFS folder not fixed by #1443 Fuzzy match in Explorer tree Find on an ISFS folder not fixed by #1443 Oct 4, 2024
gjsjohnmurray added a commit to gjsjohnmurray/vscode-objectscript that referenced this issue Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants