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

Multi-file search & replace incorrectly selecting contents based on regular expression #26208

Closed
Quitch opened this issue May 8, 2017 · 2 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@Quitch
Copy link

Quitch commented May 8, 2017

  • VSCode Version: Code 1.12.1 (f6868fc, 2017-05-04T21:26:50.689Z)
  • OS Version: Windows_NT ia32 10.0.14393
  • Extensions:
Extension Author Version
rainbow-brackets 2gua 0.0.6

Example file:

  "name": "Legion - Bronze - Teleporter",
  "to_build": "LegionStructureBasicTeleporter",
  "instance_count": 1,
  "priority": 1,
  "max_num_assisters": 10,
  "builders": [
    "LegionCommander",
    "AnyLegionFabberBasic",
    "AnyLegionFabberAdvanced",
    "LegionOrbitalBasicFabber"
  ],

Steps to Reproduce:

  1. Switch to Search
  2. Expand Search to include replace field
  3. Enable regular expression
  4. In FIND box enter: ,\n "builders":
  5. In REPLACE box enter: ,\n "base_sort": "FromBuilder",\n "builders":

EXPECTED BEHAVIOUR:

File will become as follows:

  "name": "Legion - Bronze - Teleporter",
  "to_build": "LegionStructureBasicTeleporter",
  "instance_count": 1,
  "priority": 1,
  "max_num_assisters": 10,
  "base_sort": "FromBuilder",
  "builders": [
    "LegionCommander",
    "AnyLegionFabberBasic",
    "AnyLegionFabberAdvanced",
    "LegionOrbitalBasicFabber"
  ],

CURRENT BEHAVIOUR:

File becomes the following:

  "name": "Legion - Bronze - Teleporter",
  "to_build": "LegionStructureBasicTeleporter",
  "instance_count": 1,
  "priority": 1,
  "max_num_as
  "base_sort": "FromBuilder",
  "builders":
  "builders": [
    "LegionCommander",
    "AnyLegionFabberBasic",
    "AnyLegionFabberAdvanced",
    "LegionOrbitalBasicFabber"
  ],

NOTE: use CTRL-H search & replace within a file behaves according to expected behaviour.

example files.zip

@Quitch Quitch changed the title Multi-file search & replace incorrectly expanding find selection Multi-file search & replace incorrectly selecting contents based on regular expression May 8, 2017
@Quitch
Copy link
Author

Quitch commented May 8, 2017

A further example:

  "name": "Bronze - Basic Metal Extractor - cdr",
  "to_build": "BasicMetalExtractor",
  "instance_count": 1,
  "max_num_assisters": 3,
  "shared_instance_count": "BasicMetal",
  "priority": 261,
  "base_sort": "FromBuilder",
  "base_sort": "FromBuilder",
  "builders": [
    "UberCommander"
  ],

Find: "base_sort": "FromBuilder",\n "base_sort": "FromBuilder",
Replace: "base_sort": "FromBuilder",

Output:

  "name": "Bronze - Basic Metal Extractor - cdr",
  "to_build": "BasicMetalExtractor",
  "instance_count": 1,
  "max_num_assisters": 3,
  "shared_instance_count": "BasicMetal",
  "priority": 261,
  "base_sort": "FromBuilder",
  "base_sort": "FromBuilder",
  "builders": [
    "UberCommander"
  ],

The problem is multi-file FIND only highlights the first base_sort line rather than both of them as it should.

And again, search & replace within a single file, not using the sidebar search function, works as expected correctly highlighting both base_sort lines and outputting the following:

  "name": "Bronze - Basic Metal Extractor - cdr",
  "to_build": "BasicMetalExtractor",
  "instance_count": 1,
  "max_num_assisters": 3,
  "shared_instance_count": "BasicMetal",
  "priority": 261,
  "base_sort": "FromBuilder",
  "builders": [
    "UberCommander"
  ],

@sandy081
Copy link
Member

sandy081 commented May 8, 2017

Duplicates #13155

@sandy081 sandy081 closed this as completed May 8, 2017
@sandy081 sandy081 added the *duplicate Issue identified as a duplicate of another issue(s) label May 8, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

2 participants