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

Remove redundant prefix from candidates. #213

Closed
wants to merge 1 commit into from

Conversation

bbelleville
Copy link
Contributor

This is to fix #162, where if you complete 'java.uti' it will end up
inserting 'java.java.util'. This is because the completion prefix in
this example is 'uti', but the candidate returned by eclim will be the
full package name 'java.util'. Company will insert the completion from
the prefix, which leads to the incorrect behavior. This solves this
issue by looking before the prefix at what is already present in the
buffer, and removing and redundancy from candidates if present.

@kleewho
Copy link
Collaborator

kleewho commented Jul 21, 2015

Thank you! You we're very productive today. Great

This is to fix the issue where if you complete 'java.uti' it will end up
inserting 'java.java.util'. This is because the completion prefix in
this example is 'uti', but the candidate returned by eclim will be the
full package name 'java.util'. Company will insert the completion from
the prefix, which leads to the incorrect behavior. This solves this
issue by looking before the prefix at what is already present in the
buffer, and removing and redundancy from candidates if present.
@bbelleville
Copy link
Contributor Author

I just updated the pull request. It now will ignore errors when searching for the existing package name in the buffer. Without this it was breaking completion if there wasn't a symbol immediately before the prefix. I also added checks to ensure that the package name is non-nil and not the empty string.

@kleewho kleewho self-assigned this Jul 26, 2015
@kleewho kleewho closed this in 0348608 Jul 30, 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.

invalid completion for "java." etc.
2 participants