-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add Python language support #52
base: main
Are you sure you want to change the base?
Conversation
@chrmarti If this PR is approved and you're ok with it, can you please add the |
Hope this PR can be approved soon. |
This PR has been sitting for ~6 months now, any chance of merging it, or is development on this extension stopped? |
This PR has been sitting for about a year now. Any chance it will be approved? Or is this extension abandoned? |
@anthonyjvoss Sorry for the delay, could you add Python to the package.json's description and activation events? Thanks! |
Update the package.json file to include Python in the package description as well as the activationEvents array.
@chrmarti - I have updated the package.json and pushed the updates to this branch. Thank you for the response. |
A speedy release would be very happy :) |
@@ -14,6 +14,7 @@ export function activate(context: vscode.ExtensionContext) { | |||
const regexRegex = /(^|\s|[()={},:?;])(\/((?:\\\/|\[[^\]]*\]|[^/])+)\/([gimuy]*))(\s|[()={},:?;]|$)/g; | |||
const phpRegexRegex = /(^|\s|[()={},:?;])['|"](\/((?:\\\/|\[[^\]]*\]|[^/])+)\/([gimuy]*))['|"](\s|[()={},:?;]|$)/g; | |||
const haxeRegexRegex = /(^|\s|[()={},:?;])(~\/((?:\\\/|\[[^\]]*\]|[^/])+)\/([gimsu]*))(\s|[.()={},:?;]|$)/g; | |||
const pyRegexRegex = /(^|\s|[()={},:?;])['|"](((?:\\\/|\[[^\]]*\]|[^/])+)([gimuy]*))['|"](\s|[()={},:?;]|$)/g; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize this shows the code lens above all strings. That seems a bit too much. Is there a way to reduce this to only match actual regular expressions? E.g., by only matching on strings as parameters to re.search
and others?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you provide a little more detail around what you're seeing and potential drawbacks? This should be providing the same match/highlighting as the other languages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const pyRegexRegex = /(^|\s|[()={},:?;])['|"](((?:\\\/|\[[^\]]*\]|[^/])+)([gimuy]*))['|"](\s|[()={},:?;]|$)/g; | |
const pyRegexRegex = /(^|\s|[()={},:?;])r['|"](((?:\\\/|\[[^\]]*\]|[^/])+)([gimuy]*))['|"](\s|[()={},:?;]|$)/g; |
Would it be acceptable to change the regex to only match "raw" strings (e.g r"\d{4}-\d{2}"
)? Sure it's not a perfect solution, as we would miss some simple regexes and also have a bunch of false positives, but if a caveat is added in the doc, it could work.
@anthonyjvoss can you fix this? |
Provide users the ability to use the extension with Python files.
Closes #35