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

[tern addon] Add caseInsensitive autocompletion option #3308

Closed
wants to merge 1 commit into from

Conversation

zz85
Copy link

@zz85 zz85 commented Jun 5, 2015

  • allow caseInsensitive option eg.
    server = new CodeMirror.TernServer({caseInsensitive: true});
  • caseInsensitive is passed to tern request query which allow case insensitive autocomplete searches

relates to ternjs/tern#163

- allow caseInsensitive option eg.
` server = new CodeMirror.TernServer({caseInsensitive: true});`

- caseInsensitive is passed to tern request query which allow case insensitive autocomplete searches
@mrdoob
Copy link

mrdoob commented Jun 6, 2015

Just a suggestion. Maybe caseSensitive true by default would be more clear.

@zz85
Copy link
Author

zz85 commented Jun 6, 2015

hmm yes, double negatives... i used caseInsensitive following ternjs's change. let's see what @marijnh thinks :)

marijnh added a commit that referenced this pull request Jun 11, 2015
@marijnh
Copy link
Member

marijnh commented Jun 11, 2015

Please take a look at the attached patch instead. It adds a more general way to add options to queries. You'd pass it queryOptions: {completions: {caseInsensitive: true}} to get the effect you want. Does this work for you?

As for the double negative, I agree that's bad style, but that ship has sailed (it is part of the Tern API, and I don't consider it a big enough problem to change it now).

@zz85
Copy link
Author

zz85 commented Jun 12, 2015

@marijnh hmm. let me test that.

but from my first looks it seems like queryOptions: {completions: {caseInsensitive: true}} might override any properties already in query.completions, unless usage of .request() ever pass in a completions property.

do you think it would be better to have a query hook filter option which takes a function instead (which might be even more flexible)?

@zz85
Copy link
Author

zz85 commented Jun 12, 2015

quick test with queryOptions: {completions: {caseInsensitive: true}} works.

@marijnh
Copy link
Member

marijnh commented Jun 12, 2015

I am not sure I understand your concern. Yes, queryOptions could override properties that the library itself added, and you could pass something like {type: "foo"} and break the library. But why would you?

@zz85
Copy link
Author

zz85 commented Jun 12, 2015

maybe my concerns are unfounded, but looks like this issue has been resolve, so I'll close this. Thanks!

@zz85 zz85 closed this Jun 12, 2015
ctucker pushed a commit to ServiceNow/CodeMirror that referenced this pull request Jun 16, 2015
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

Successfully merging this pull request may close these issues.

3 participants