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

Fix unwanted path auto-completion, allow user-invoked completion in strings/comments #264

Closed
wants to merge 1 commit into from

Conversation

krassowski
Copy link
Member

@krassowski krassowski commented Apr 29, 2020

References

Fixes #241

Code changes

with_trigger_kind replaced with set_trigger_kind_for_next_invocation as the with the idea did not play well here (it seems that even after converting the callback to await it was only waiting for the invocation, but not for completion due to how commands work); either way it is to be removed as setting trigger_kind on an instance is silly and error-prone and should not be done in the first place (but I did not want to re-implement completer:invoke-notebook and completer:invoke-file); now it seems that a thin wrapper/re-implementation/PR upstream which would allow passing the trigger_kind when executing the command is the best way out (also described with a TODO comment), but this may be out of the scope of this PR.

Maybe, just maybe, a custom implementation of a command, let's name it completer:trigger would allow getting rid of the current workaround (but then the value from this PR is in adding a test-case).

TODO

  • play around to check if we can implement completer:trigger easily, and in the process get rid of two workarounds:
    • trigger_kind on an instance,
    • adding the dummy completer item described below
  • or - if the above cannot be accomplished within two weeks - open an issue for that.

User-facing changes

  • Auto-completion is not performed if LSP does not return results and Kernel returns only one result (which is usually .ipynb-checkpoints for Python); to workaround how completer:invoke-notebook/file work (auto-completing if there is one suggestion), I add a second dummy (but harmless) suggestion. This is not the final solution, just a workaround.
  • Completion in strings and comments can now be manually invoked

Backwards-incompatible changes

None, but will likely need manual merge with #239

Chores

  • linted
  • tested
  • documented
  • changelog entry

@krassowski
Copy link
Member Author

On hold until I get a feedback on jupyterlab/jupyterlab#8406

@krassowski
Copy link
Member Author

Superseded by jupyterlab/jupyterlab#8375. Maybe some tests could be rescued from there, but not a priority ATM.

@krassowski krassowski closed this Jun 7, 2020
@krassowski krassowski deleted the fix/completer-with-paths branch October 29, 2021 20:33
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.

Auto-complete issue related to file paths
1 participant