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

Completion casing #45

Closed
bbbscarter opened this issue Jan 1, 2014 · 11 comments
Closed

Completion casing #45

bbbscarter opened this issue Jan 1, 2014 · 11 comments

Comments

@bbbscarter
Copy link

Hi! Happy new year!

I've had a request from one of the users of the company backend for OmniSharp to allow completions to ignore case. There's the 'ignore-case' option in company-mode, which I've tried, but it doesn't seem to do quite what I want.

Company's 'ignore-case' option does the following; given the completion "SomeThing", typing 'somet' will trigger the completion 'something'.

What I want is for the following: given the completion "SomeThing", typing "somet" will trigger the completion "SomeThing". That is, the filtering ignores case, but the completion keeps case.

Is there a way of enabling this that I've missed?

Thanks!

@dgutov
Copy link
Member

dgutov commented Jan 3, 2014

Not currently, but it's a reasonable request. I'll look into it.

@bbbscarter
Copy link
Author

Thanks - much appreciated!

On 3 Jan 2014, at 20:49, Dmitry Gutov notifications@github.com wrote:

Not currently, but it's a reasonable request. I'll look into it.


Reply to this email directly or view it on GitHub.

@nosami
Copy link

nosami commented Jan 3, 2014

Hi. The OmniSharp server also allows CamelCase completions.

From the docs :-

  • CamelCase completions are supported, e.g Console.WL(TAB) will complete to Console.WriteLine
  • "Subsequence" completions are also supported. e.g. Console.Wline would also complete to Console.WriteLine
  • Completions are ranked in the following order
    • Exact start match (case sensitive)
    • Exact start match (case insensitive)
    • CamelCase completions
    • Subsequence match completions

The server side component filters and ranks possible completions. Could it also be possible to have an option to not filter at all given that the server has already done the job?

@dgutov dgutov closed this as completed in bd82c7e Jan 14, 2014
@dgutov
Copy link
Member

dgutov commented Jan 14, 2014

Hi again, sorry for the delay.

For both requests, please try the latest master.

And for non-prefix completions specifically, disable the cache in your backend function (no-cache t), so that we don't try to remember the candidates and filter them by prefix later.

@nosami
Copy link

nosami commented Jan 14, 2014

Thanks for doing this. Looking forward to trying it out later!

@nosami
Copy link

nosami commented Jan 14, 2014

There is a failing test btw.
1 unexpected results:
FAILED company-ignore-case-replaces-prefix

@dgutov
Copy link
Member

dgutov commented Jan 14, 2014

No problem!

There is a failing test btw

Yep, fixed now.

By the way, since you can return case-insensitive matches, you should add (ignore-case t) to the backend function.

@dgutov
Copy link
Member

dgutov commented Jan 14, 2014

Does OmniSharp server return information about which characters were matched, in camelcase and subsequence completions? Being able to highlight the exact matching characters would be nice.

@nosami
Copy link

nosami commented Jan 14, 2014

Hmm.... no - but it could. Is this not possible from the elisp side? Excuse my ignorance, I know nothing about elisp :)

@dgutov
Copy link
Member

dgutov commented Jan 14, 2014

Possible, of course, but here we'll either have to guess (example: input cs, candidate crash-sequence, which s to highlight?), or reimplement a part of completions matching/ranking logic (and the elisp code will need to know about the notion of CamelCase completions).

If I implement an automatic non-prefix highlighter, it will highlight *c*ra*s*h-sequence, not *c*rash-*s*equence. Not ideal, but yes, just a minor issue.

@bbbscarter
Copy link
Author

Thanks for doing this, it’s greatly appreciated. I’m have a play around with integration when I get a moment, which should be soon.

Thanks!

Simon

On 14 Jan 2014, at 15:42, Dmitry Gutov notifications@github.com wrote:

Possible, of course, but here we'll either have to guess (example: input cs, candidate crash-sequence, which s to highlight?), or reimplement a part of completions matching/ranking logic (and the elisp code will need to know about the notion of CamelCase completions).

If I'll implement an automatic non-prefix highlighter, it will highlight _c_ra_s_h-sequence, not _c_rash-_s_equence. Not ideal, but yes, just a minor issue.


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants