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

Ignore notebook names on cell completion for autoimport #466

Merged

Conversation

tkrabel-db
Copy link
Contributor

@tkrabel-db tkrabel-db commented Oct 17, 2023

What is changed?

With the notebook document, every cell is its own document living in the workspace. When doing rope autoimport completions on a cell document position, we should not provide completion suggestions for names already imported before that (see video below).

How is this tested?

  • integration test
  • manually on Databricks notebooks
Screen.Recording.2023-10-18.at.11.48.23.mov

Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments for you @tkrabel-db, the rest looks good to me.

pylsp/workspace.py Outdated Show resolved Hide resolved
test/fixtures.py Outdated Show resolved Hide resolved
test/plugins/test_autoimport.py Outdated Show resolved Hide resolved
test/test_utils.py Outdated Show resolved Hide resolved
test/test_notebook_document.py Outdated Show resolved Hide resolved
@ccordoba12 ccordoba12 added this to the v1.9.0 milestone Oct 18, 2023
@ccordoba12 ccordoba12 added the enhancement New feature or request label Oct 18, 2023
@ccordoba12 ccordoba12 changed the title rope autoimport -- ignore notebook names on cell completion Ignore notebook names on cell completion in autoimport Oct 18, 2023
@ccordoba12 ccordoba12 changed the title Ignore notebook names on cell completion in autoimport Ignore notebook names on cell completion for autoimport Oct 18, 2023
@tkrabel-db
Copy link
Contributor Author

Thanks for the review @ccordoba12 . I added all your suggestions! 🚀

@tkrabel-db
Copy link
Contributor Author

Weird, Static code analysis / Static code analysis (pull_request) failed but when looking at the details, everything passed ...

@krassowski
Copy link
Contributor

Kicked, let's see if it happens again.

Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now, thanks @tkrabel-db!

@ccordoba12 ccordoba12 merged commit b864c4f into python-lsp:develop Oct 19, 2023
10 checks passed
staticf0x pushed a commit to staticf0x/python-lsp-server that referenced this pull request Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants