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

Rename symbol feature #114

Closed
Sh4rK opened this issue Aug 28, 2012 · 17 comments
Closed

Rename symbol feature #114

Sh4rK opened this issue Aug 28, 2012 · 17 comments

Comments

@Sh4rK
Copy link

Sh4rK commented Aug 28, 2012

It would be nice to have a feature to rename symbols (variables, structure fields, functions etc) in a syntax-aware way, and across all files of a package (or even inter-package, but I'm not sure about that).

@DisposaBoy
Copy link
Owner

marked as FR. I doubt I'd even look into cross-package refactory as it's not something I'm a fan of but locals and globals should be safe

@augustoroman
Copy link

You could now integrate gorename. It's designed for both manual cli use as well as direct text-editor integration:

Examples:

% gorename -offset file.go:#123 -to foo

  Rename the object whose identifier is at byte offset 123 within file file.go.

@mdwhatcott
Copy link

@DisposaBoy - +1 for adding support for gorename.

@lindroth
Copy link

I have been looking for a way to use gorename in an easy way all day, that would be AWESOME!

@justinfx
Copy link

Has anyone looked into this one yet?
I thought it might be as simple as just chucking in a command that takes the current cursor pos, and an input string from the user, and shells out to gorename. But then I wondered if it needed to handle dirty views, or to just work only if the current view isn't dirty?

@mdwhatcott
Copy link

@justinfx - I've taken a stab at it, but I'm not sure how to get sublime to see my $PATH--I'd rather not have to hardcode a path to gorename.

https://github.com/smartystreets/sublime-gorename/blob/master/gorename.py

Am I missing something simple?

@justinfx
Copy link

That is something that should already be handled by GoSublime

https://github.com/DisposaBoy/GoSublime/blob/master/gosubl/gs.py

The env is a settings value that allows you to point it at the desired bin
locations. For instance, I have mine include my GOBIN. So you should be
able to run subprocess and pass it the env. What you are doing is more or
less what I thought to do as a bare minimum, but I wondered if anyone
thought it should take into consideration dirty views.

Also you may want to switch your subprocess call to use the list form, and
not use shell=True. It is easier to avoid quoting and escaping issues,
especially if the file path has spaces.

On Sun, 16 Nov 2014 12:58 PM Michael Whatcott notifications@github.com
wrote:

@justinfx https://github.com/justinfx - I've taken a stab at it, but
I'm not sure how to get sublime to see my $PATH--I'd rather not have to
hardcode a path to gorename.

https://github.com/smartystreets/sublime-gorename/blob/master/gorename.py

Am I missing something simple?


Reply to this email directly or view it on GitHub
#114 (comment)
.

@mdwhatcott
Copy link

Ok, thanks for the pointers @justinfx. Not sure if I'll be getting to this anytime soon. If my code helps someone else move this forward that's great too.

@justinfx
Copy link

Maybe I will take what you started and propose a merge request to GoSublime

On Sun, 16 Nov 2014 7:16 PM Michael Whatcott notifications@github.com
wrote:

Ok, thanks for the pointers @justinfx https://github.com/justinfx. Not
sure if I'll be getting to this anytime soon. If my code helps someone else
move this forward that's great goo.


Reply to this email directly or view it on GitHub
#114 (comment)
.

@mdwhatcott
Copy link

Go for it!

@clipperhouse
Copy link

+1 @justinfx

@justinfx
Copy link

Comments welcome, on merge request #569

OneOfOne added a commit to OneOfOne/GoSublime that referenced this issue Mar 3, 2015
* dlclark/master:
  Reduce Margo goto logging in normal mode.  Clean test file.
  Fix issue where output would show error even on successful goto definition or find usage
  Remove unused imports
  Added find usages to command list and default keyboard mapping
  Updated for windows paths
  Updated vendored code for types, gcimporter, and exact
  Switch Margo to GoType and added Find Usages
  Removed extraneous "fmt_enabled" check from GsGoRename
  Fixes DisposaBoy#114 - Integrate GoRename command
@justinfx
Copy link

justinfx commented Jul 2, 2015

would love to see this merged. it's been 7 months since the pull request I had made.

@rafaeldaime
Copy link

me too...

@mdwhatcott
Copy link

@DisposaBoy - Thanks for creating a great plugin for go development. I've written so much code with this tool!

Being able to safely rename a variable across an entire project from within the editor is a powerful capability. This PR would be a great addition to GoSublime. Once you've had the ability to rename any token at will in other languages, programming in go feels clunky. The good news: The go plugin for Intellij already supports this behavior and it's awesome. Just sayin'.

@justinfx
Copy link

Pretty sure the project is abandoned. What with this pull request being a year old.

@fulldump
Copy link

A great golang plugin has dead :(

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

No branches or pull requests

9 participants