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

Python imports broken in all sort of ways. #1141

Open
laundmo opened this issue Dec 6, 2020 · 3 comments
Open

Python imports broken in all sort of ways. #1141

laundmo opened this issue Dec 6, 2020 · 3 comments
Labels

Comments

@laundmo
Copy link
Contributor

laundmo commented Dec 6, 2020

This is a bug report addressing a whole host of issues with the Python import support.

Here's a list of the issues:

  • Every second one of multiple simple imports will fail.
  • Imports using subpackages will not be recognized
  • Imports importing from a package with the package name as the first thing being imported will highlight/link at the wrong location.
  • Relative imports rarely work, related to: Relative imports in python? #357, especially multi-layer relative imports. (This is technically a feature requestm i know)

To Reproduce
Steps to reproduce most of the described behaviour:

  1. Go to https://gist.github.com/laundmo/55e4799cb446ae5c3535eca6d6a26102
  2. Observe the behaviours outlined in the comments.

I would be willing to write test cases if that helps, but I'm afraid I can't PR an actual fix since I only know a bare minimum of JS. (lots of Python though)

@laundmo laundmo added the bug label Dec 6, 2020
@stefanbuck
Copy link
Member

Thanks for filling this issue. I'm aware that our Python coverage is basic and I'm more than happy to improve it. The issue with multiple identical imports is a general limitation of our current implementation, but not obvious in other languages. I'm not sure how easy a fix this would be. I'll look into this, but would prefer to prioritise the other issues you mentioned.

Submitting a few E2E test for the other issues is highly appreciated and the best way for me to tackle this. Adding a E2E tests is quite easy and documented here. Please let me know if you have any questions.

@laundmo
Copy link
Contributor Author

laundmo commented Dec 11, 2020

@stefanbuck how would i specify using "OctoLinkerResolve" that the line should resolve to multiple things in multiple locations? How do i specify which word should be linked?

@laundmo
Copy link
Contributor Author

laundmo commented Dec 11, 2020

made a PR with test cases #1147

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants