Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Replace All breaks when replacing php arrow accessors with PHP language enabled #1083

Closed
1 task done
Torniojaws opened this issue May 21, 2019 · 3 comments
Closed
1 task done

Comments

@Torniojaws
Copy link

Prerequisites

Description

When using Replace All on a php file with php language package enabled, the replace breaks on arrow accessors ($obj->property) and stops replacing after the first item.

Steps to Reproduce

  1. Create a new file
  2. Make its contents:
<?php
example->value;
another->value;
  1. Change the syntax from "Plain Text" to "PHP" in the bottom taskbar
  2. Select the last two rows (begins with "example" and "another")
  3. Press Ctrl/Command+F to open the search bar
  4. In the "Find" bar, enable "Regex" and "Only in selection"
  5. In the Search field, write: \-\>
  6. In the Replace field, write ['
  7. Press "Find All"
  8. Press "Replace All"

Expected behavior: [What you expect to happen]

The file contents change from:

<?php
example->value;
another->value;

To this:

<?php
example['value;
another['value;

Actual behavior: [What actually happens]

The contents become:

<?php
example->value;
another['value;

And the search bar says: "no results", so you cannot press "Replace" or "Replace All" again to continue replacing.

Reproduces how often: [What percentage of the time does it reproduce?]

Every time. 100 %

Versions

Atom : 1.34.0
Electron: 2.0.16
Chrome : 61.0.3163.100
Node : 8.9.3

apm 2.1.3
npm 6.2.0
node 8.9.3 x64
atom 1.34.0
python 2.7.10
git 2.20.1

MacOS Mojave 10.14.4

Additional Information

@rsese rsese transferred this issue from atom/atom May 21, 2019
@rsese
Copy link

rsese commented May 22, 2019

Thanks for contributing!

Though I can reproduce, this looks like a duplicate of #1010 so you can subscribe there for updates if you'd like. If I'm misunderstanding, please let me know ✌️


Because we treat our issues list as the Atom team's backlog, we close duplicates to focus our work and not have to touch the same chunk of code for the same reason multiple times. This is also why we may mark something as duplicate that isn't an exact duplicate but is closely related.

For information on how to use GitHub's search feature to find out if something is a duplicate before filing, see the How Can I Contribute? section of the Atom CONTRIBUTING guide.

@rsese rsese closed this as completed May 22, 2019
@Torniojaws
Copy link
Author

Ah yes, it appears to be the same. It seems if you search from the main atom project, it doesn't show the subprojects like find-and-replace :) Since I searched for the exact term that ticket has in its title (Replace All).

@rsese
Copy link

rsese commented May 23, 2019

Yeah a couple of search quirks there but thanks for searching for previous reports 🙇

If you haven't come across it already, you can search across repositories under the Atom organization from the search bar on any page with something like this for example org:atom is:issue within selection:

https://github.com/search?q=org%3Aatom+is%3Aissue+within+selection

You also need to choose the dropdown option to search All GitHub.

Or if you search from the Atom organization page, the search bar will scope your search to the organization by default.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants