Show PyPi link in requirements#23288
Merged
karthiknadig merged 10 commits intomicrosoft:mainfrom May 7, 2024
Merged
Conversation
Author
|
@microsoft-github-policy-service agree |
Comment on lines
14
to
18
| // Regex to allow to find every possible pypi package (base regex from https://peps.python.org/pep-0508/#names) | ||
| const regex = /^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*)($|=| |;|\[)/i | ||
| const row = document.lineAt(position.line).text; | ||
| const projectName = row.match(regex); | ||
| return(projectName) ? new Hover(`https://pypi.org/project/${projectName[1]}/`) : null |
Member
There was a problem hiding this comment.
You can pull this out into a function by itself that takes in a string and returns hover info. Then you can test that function independently.
Member
karthiknadig
left a comment
There was a problem hiding this comment.
Thanks for adding this feature, and the test cases. This mostly looks good. I have some minor suggestions, overall looks great.
Co-authored-by: Karthik Nadig <kanadig@microsoft.com>
Co-authored-by: Karthik Nadig <kanadig@microsoft.com>
Co-authored-by: Karthik Nadig <kanadig@microsoft.com>
Co-authored-by: Karthik Nadig <kanadig@microsoft.com>
Author
|
@karthiknadig No, I think it's an issue in test: |
karthiknadig
reviewed
May 1, 2024
karthiknadig
previously approved these changes
May 6, 2024
anthonykim1
previously approved these changes
May 6, 2024
|
There's still lint error on src/client/activation/requirementsTxtLinkActivator.ts |
Member
|
@LouisGobert Sorry for another ping on this. Can you format the following with prettier extension? |
Author
|
@karthiknadig Done: |
karthiknadig
approved these changes
May 7, 2024
anthonykim1
approved these changes
May 7, 2024
anthonykim1
pushed a commit
to anthonykim1/vscode-python
that referenced
this pull request
May 10, 2024
Show PyPi link in requirements, see microsoft#14495. Apart from the test to verify the register of `RequirementsTxtLinkActivator`, there are no other tests. This is my first contribution in TypeScript, if you have an example of a test that could be done, I'm interested :) --------- Co-authored-by: Karthik Nadig <kanadig@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Show PyPi link in requirements, see #14495.
Apart from the test to verify the register of
RequirementsTxtLinkActivator, there are no other tests. This is my first contribution in TypeScript, if you have an example of a test that could be done, I'm interested :)