-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Use replaceAll when replacing separators #15288
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
Comments
Hi, I would like to work on this issue,can you suggest me ways to get started? |
@KamalSinghKhanna go ahead |
Hello, So the required changes are :
Is that right? |
@vijaya-lakshmi-venkatraman That is correct. Edit: You may have to add the |
Thanks @karthiknadig. |
@vijaya-lakshmi-venkatraman go ahead. |
Is this issue still open or @vijaya-lakshmi-venkatraman is still working on this issue |
One thing to note. there is no if you decide to extend string, you can do that here src\client\common\extensions.ts . Then all you have to do is include it in that file where you consume |
Hi, is this issue still open or is @KamalSinghKhanna or @vijaya-lakshmi-venkatraman working on this? If not could I try working on this? |
Hi @IceJinx33 , feel free to work on this. |
@karthiknadig, The original Code QL issue link link doesn't seem to be working. Where can I verify the correct requirements of the code? |
@IceJinx33 This is what the CodeQL link says: |
@karthiknadig, I extended the string in src\client\common\extensions.ts to have a replaceAll function, which simply uses a RegExp global search 'g' to replace an old substring with a new one. However, the old substring needs to be escaped properly to get a correct RegExp, and the escaping function from MDN Web Docs escapes a limited set of special characters. replaceAll is used in the following files for replacing '\\' with '\\\\' In the extensions.unit.tests.ts, I added the following tests for the above use case and they pass when tested using Are there any test cases I could be missing? I'm also not really sure if the escaping function covers all cases, so is the way I've documented it okay? Or should I think of a different approach? |
@IceJinx33 This is fantastic. Can you open a PR. |
See here:
https://github.com/microsoft/vscode-python/security/code-scanning/10?query=ref%3Arefs%2Fheads%2Fmain
Issue Location:
https://github.com/microsoft/vscode-python/blob/2021.1.502429796/src/client/pythonEnvironments/base/info/interpreter.ts
https://github.com/microsoft/vscode-python/blob/2021.1.502429796/src/client/pythonEnvironments/info/interpreter.ts
The text was updated successfully, but these errors were encountered: