-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Make identifier chars configurable #236
Conversation
This doesn't do everything I hoped for, unfortunately. First, a bit of context: The For example, take However, if On the other hand, if I do add Pressing I see a couple possible solutions, and went with the one I felt simplest:
I'm open to any improvement suggestions, but the fact that it seems to make YCM usable with a clojure setup ( |
Woops. The second part of the pull is broken. I'll separate it into a separate pull and fix it. I think the first change stands on its own anyway. |
Making identifier chars configurable is substantially more complicated than it appears. IdentifierUtils.cpp needs to be changed (the regex needs to be configurable), and so do all of the tests. I'll do this at some point in the future, don't worry about it. Also, the cache is already invalidated on semantic trigger characters. See this line. When |
Right - as long as a semantic trigger is not an identifier :) What I was aiming for was getting both the identifier before and the identifier after into the omnifunc (i.e. A better approach might be to let completers choose how much of the original text they want to replace - perhaps marking that per suggestion, allowing the completer to give different length completions? The code that replaces text with the completion on selection would have to be updated, of course. |
That would not respect the omnifunc spec that's in the Vim docs. See It's just easier to let the user configure the identifier characters. This also needs to be done for other reasons as well. |
is this in or not? Any progress since? Would love to use this for clojure if I could. |
Also would love to use this for clojure |
waiting clojure work with YCM |
It would be really great to add support for clojure. |
People, please note that this is a pull request; the corresponding issue you're looking for is #86. In other words, don't comment here. |
Fix filename of comment_strip tests `ycmd/completers/cpp/tests/comment_strip.py` tests was not run automatically by nosetests because `_test` was missing at the end of the filename.
Some languages allow more non-alphabetic characters in identifiers than just
'_'
. This pull request allows the user to configure which non-alphabetic chars should be accepted as part of identifiers.For example for clojure development I set this to
'_-/.><'
.I went for the simplest solution here, but it might be worth it to make it a regex. I can make that change if it's preferred.