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

Regex "replace in files" group substitution does not work #81502

Closed
clmay opened this issue Sep 26, 2019 · 5 comments
Closed

Regex "replace in files" group substitution does not work #81502

clmay opened this issue Sep 26, 2019 · 5 comments

Comments

@clmay
Copy link

clmay commented Sep 26, 2019

  • VSCode Version: 1.38.1
  • OS Version: 10.14.6
Version: 1.38.1
Commit: b37e54c98e1a74ba89e03073e5a3761284e3ffb0
Date: 2019-09-11T13:31:32.854Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Darwin x64 18.7.0

Steps to Reproduce:

  1. Open "Replace in files"

  2. Perform a regex search that includes a group, e.g.:

    (some_var).method_to_replace(args)
    
  3. Perform replace using group substitution, e.g.:

    $1.new_method$2
    

Expected results:

some_var.new_method(args)

Actual result:

$1.new_method$2

Does this issue occur when all extensions are disabled?: Yes

It is worth noting that the expected results listed above are the exact behavior of the local find and replace feature, but this is for some reason not extended to the project-wide find and replace feature.

@ArturoDent
Copy link

When I use this search regex it works as expected:

(some_var)\.method_to_replace(\(args\))

Do you have a different example where it doesn't work and is unrelated to these fixes:

#81129
#80667

since your example did not include a newline or lookaround?

@clmay
Copy link
Author

clmay commented Sep 26, 2019

No, I'm sorry. I was not aware of #80667 and the actual regex I was using did include a newline. I will close this issue, but it does seem that the name of the other could be improved.

@clmay clmay closed this as completed Sep 26, 2019
@clmay
Copy link
Author

clmay commented Sep 26, 2019

@ArturoDent when will the fix for #80667 be released?

@ArturoDent
Copy link

It is already in the Insider's Build so "should" be in the next release - early October 2019.

@clmay
Copy link
Author

clmay commented Sep 26, 2019

Thank you.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants