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

Word completion not working properly. #851

Open
1 of 3 tasks
Victor-El opened this issue Jul 25, 2020 · 5 comments · May be fixed by #1487
Open
1 of 3 tasks

Word completion not working properly. #851

Victor-El opened this issue Jul 25, 2020 · 5 comments · May be fixed by #1487

Comments

@Victor-El
Copy link

Prerequisites

  • I have searched open and closed issues for duplicates.

Describe the bug

I found out that word completion extension suggests some incomplete words I used, or
some mistakes I made which I later corrected. I encountered this error in my JavaScript file.

To Reproduce

Steps to reproduce the behavior:

  1. Click on the settings icon
  2. Click on the extensions tab
  3. Check Words Completion extension
  4. Start writing a script greater than 50 lines.
  5. Deliberately make some mistakes in variable names or function names.
  6. Go back and correct them.
  7. Now check whether you get those words that contains mistakes.

Expected behavior

I expected the word completion to suggest only words that are currently in my code, not
words that have been deleted or incomplete words.

Screenshots or screen recordings

Logs

Platform Information

Screenshot from 2020-07-25 18-23-57

  • I'm using the latest version from git that I've manually compiled
  • I'm using the latest released stable version

Additional context

@colinkiama
Copy link
Member

I still see these sorts of errors from time to time.

I see that in: https://github.com/elementary/code/blob/master/plugins/word-completion/plugin.vala#L137 the CTRL + | key combination rebuilds the word completion list however, I think that the completion list should be managed in a more dynamic way, similar to what was done in the Find project files (Fuzzy Search) plugin

@jeremypw
Copy link
Collaborator

@colinkiama Is that something you have time to attempt? I agree the word completion plugin could be improved - it suggests deleted words and misses words recently added at the moment.

@colinkiama
Copy link
Member

Yes, I can spend a few hours a week on this issue.

@colinkiama
Copy link
Member

This is as far as I can go with this issue: https://github.com/elementary/code/tree/851-fix-word-completion-logic

Things left to implement:

  • Handle text being inserted at the start of a word
  • Handle delete_range signal, removing unused words from the prefix tree
  • Allow numeric delimiters as long as they aren't at the start of a word (allows variables with numbers in them to be suggested)

@jeremypw jeremypw linked a pull request Nov 24, 2024 that will close this issue
3 tasks
@jeremypw jeremypw linked a pull request Nov 24, 2024 that will close this issue
3 tasks
@jeremypw
Copy link
Collaborator

@colinkiama Thanks for your work on this! I have created a draft PR and will try it out and, if possible complete it.

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 a pull request may close this issue.

3 participants