Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Simplify FindUtils.parseDollars #7582

Merged
merged 2 commits into from
Jun 25, 2014

Conversation

marcelgerber
Copy link
Contributor

I tried to simplify/comment the quite complicated FindReplace helper function parseDollars, but to be honest, I don't know if I made it better or worse.

Let's see if someone understands the function now 😆

The only architectural change is that parseInt is only called after we made sure index is indeed an integer (and not &).

@dangoor
Copy link
Contributor

dangoor commented Apr 21, 2014

@njx

@njx
Copy link
Contributor

njx commented Apr 24, 2014

Marking low priority. (@SAplayer - not intended to be an insult :), but we're starting to try to sort out pull requests that need to be dealt with more urgently from ones that can wait a bit.)

if (index === "&") { // handle $&
// slice the first dollar (but leave any others there to get undescaped below) and return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "unescaped"

@dangoor dangoor assigned dangoor and unassigned njx Jun 17, 2014
@dangoor
Copy link
Contributor

dangoor commented Jun 17, 2014

Stealing this from @njx. @SAplayer the change seems fine. Would you be willing to add some test code for this to FindReplace-test.js? I realize there are no tests there now, but it would be nice to have some that demonstrate what this function does (and that it actually does it!)

Thanks!

@njx
Copy link
Contributor

njx commented Jun 17, 2014

Before merging this, let me check whether it will merge cleanly with the replace-across-files branch - I might have moved the function elsewhere.

@dangoor
Copy link
Contributor

dangoor commented Jun 17, 2014

@njx OK. I was surprised it hadn't moved already :)

Getting replace-across-files in is higher priority, so you can just carry on, merge that and then we'll see what needs to happen.

@njx
Copy link
Contributor

njx commented Jun 17, 2014

Yup, it's moved to FindUtils.js in my branch. Should be easy enough to copy it there after that lands and put up a new PR. (Sorry, I should have landed this before starting the branch in the first place.)

@marcelgerber
Copy link
Contributor Author

@dangoor There are no tests specificially for this function, but there are many for the functionality:
https://github.com/adobe/brackets/blob/master/test/spec/FindReplace-test.js#L1173-1331

@dangoor
Copy link
Contributor

dangoor commented Jun 18, 2014

@SAplayer Ahh, you're right. That's fine.

…llars

Conflicts:
	src/search/FindReplace.js
@marcelgerber
Copy link
Contributor Author

@dangoor @njx Merged and ready.

@marcelgerber marcelgerber changed the title Simplify (?) FindReplace helper function parseDollars Simplify FindUtils.parseDollars Jun 20, 2014
@dangoor
Copy link
Contributor

dangoor commented Jun 25, 2014

@SAplayer Thanks for merging this in with the recent find changes.

dangoor added a commit that referenced this pull request Jun 25, 2014
@dangoor dangoor merged commit f5fd5fa into adobe:master Jun 25, 2014
@marcelgerber marcelgerber deleted the simplify-parse-dollars branch June 25, 2014 20:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants