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 symbols for non-existing (unsaved) files #302

Merged
merged 2 commits into from
Dec 11, 2022

Conversation

rear1019
Copy link
Contributor

@rear1019 rear1019 commented Nov 23, 2022

See #301 and commit message for details. Regression test included.

Fixes #301.

Add a test for `textDocument/documentSymbols` of a non-existing
(unsaved) file. The test fails as of this commit and is a regression
test for issue python-lsp#301 [1].

[1] python-lsp#301
@ccordoba12 ccordoba12 added this to the v1.7.0 milestone Nov 23, 2022
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.

Thanks @rear1019 for your help with this! I left a small comment for you, otherwise looks good to me.

pylsp/plugins/symbols.py Outdated Show resolved Hide resolved
Fix `textDocument/documentSymbols` returning an empty result for
non-existing (unsaved) files: Do not use `os.path.samefile()` which
accesses the file system to check if two file paths point to the same
file. Just compare the file paths. (This basically reverts commit
40afab3.)

This fixes issue python-lsp#301 [1].

[1] python-lsp#301
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.

Thanks @rear1019 for your contribution!

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.

textDocument/documentSymbol returns empty result for non-existing files
2 participants