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

Update JS Function Name on every Call #13010

Open
core-ai-bot opened this issue Aug 31, 2021 · 4 comments
Open

Update JS Function Name on every Call #13010

core-ai-bot opened this issue Aug 31, 2021 · 4 comments

Comments

@core-ai-bot
Copy link
Member

Issue by O4D
Saturday Jan 03, 2015 at 15:11 GMT
Originally opened as adobe/brackets#10302


Hello,

Would it be possible to add the feature to update all the call of a js function when we change his name ?

For example, on this code...
1 function MyFunction(){return true;}
2
3 MyFunction();
4
5 if(true){MyFunction();}

...if I change " function MyFunction " to " function DaFunction ", the line 3 and 5 would be automatically be updated.

Regards,

O4D

@core-ai-bot
Copy link
Member Author

Comment by sbruchmann
Saturday Jan 03, 2015 at 15:27 GMT


Hello@O4D,

there are currently two extensions that implement a slightly different behaviour, but are the closest you can get:

I personally recommend to install ternific if you want better autocompletion for JavaScript.

@core-ai-bot
Copy link
Member Author

Comment by MarcelGerber
Sunday Jan 04, 2015 at 00:29 GMT


Also, what you can do without extensions:

  • Replace all occurrences using Replace (Ctrl+H)
  • Select all occurrences (using Find all and select (Alt+F3) or Add next match to selection (Ctrl+B)) and override them

It may not be that comfortable, but it's still pretty quick

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Wednesday Jan 28, 2015 at 01:40 GMT


It's essentially impossible to make a 100% reliable version of this feature for JavaScript -- unlike statically-typed languages such as Java. Type inference can give pretty accurate results, and ask the user to confirm in cases where the correct action is ambiguous -- I believe that's what the few tools that do offer this for JS (like WebStorm) do. Question is whether the Tern type inference engine inside Brackets could do that well enough for this feature to feel much better than the simple Replace commands we have today.

@core-ai-bot
Copy link
Member Author

Comment by O4D
Friday Apr 24, 2015 at 09:33 GMT


Thank you for your answer. I were very busy these last month but it helps me to know the real capacity of Brackets.

I think today I'll use " Select all occurrences (using Find all and select (Alt+F3)) ", and I already begin to use Ctrl+E to find the original function's definition.

But i'm a little sad to not find equals features than in Visual Studio (C#)...

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

No branches or pull requests

1 participant