The line that I replaced was supposed to be removing the duplicate import that is required in a script if you want to develop in VSCode and have code completion, etc... It turns out the line didn't actually do anything because the replace method of a string doesn't change the string, so it needed to be reassigned to the variable, like code = code.replace(...
While fixing and testing this change, I realized that just a little more work and it could remove more combinations and iterations of the imports that might be used or suggested by VSCode, so I built and tested a regex that seems to do the trick with just about every situation I've come across while using VSCode and all the Python tools.
I'm open to comments and/or feedback, so please let me know if there are any suggestions!
The line that I replaced was supposed to be removing the duplicate import that is required in a script if you want to develop in VSCode and have code completion, etc... It turns out the line didn't actually do anything because the replace method of a string doesn't change the string, so it needed to be reassigned to the variable, like code = code.replace(...
While fixing and testing this change, I realized that just a little more work and it could remove more combinations and iterations of the imports that might be used or suggested by VSCode, so I built and tested a regex that seems to do the trick with just about every situation I've come across while using VSCode and all the Python tools.
I'm open to comments and/or feedback, so please let me know if there are any suggestions!