Comments (4)
I'm not able to reproduce this in Vim. Assuming the following code:
package main
import "fmt"
func main() {
num := 1
fmt.Println(num)
}
doing num -> n -> num
works every time.
Basically it's having trouble finding the variable from your selection.
Messing with godoctor, it seems that the -pos offset,len
style isn't very consistent, I'm able to reproduce the problem with variable n
with godoctor -file main.go -pos 44,1 rename num
. Seems to only be a problem with single character variables.
I'm pretty sure the Vim plugin uses the -pos startrow,startcol:endrow,endcol
format, which if you try godoctor with godoctor -file main.go -pos 6,5:6,5 rename num
, it will work. Be wary of tabs/spaces though.
@rdallman @joverbey sound right?
from godoctor.
thanks for debugging and raising issue. should we require the startrow,startcol:endrow,endcol
syntax in the api to avoid such issues in the future?
from godoctor.
Thanks I'll try the longer format as suggested. Will report back!
from godoctor.
The suggested format works much better.
-pos startrow,startcol:endrow,endcol
And now I have applied the change to the Emacs package.
@roberthorn @rdallman Thanks for helping me sort this out.
from godoctor.
Related Issues (20)
- go get godoctor fails with Go v1.5 HOT 1
- Move away from version numbers? HOT 3
- OpenRefactory JSON protocol documentation is missing HOT 3
- godoc refactoring adds unnecessary comment for types and ignores value declarations HOT 2
- Can't rename struct fields HOT 3
- Go Doctor interactive mode? HOT 2
- Add scope detection based on VCS root HOT 6
- Function Extract failure HOT 7
- Extract Function failure - variable's previous value ignored HOT 2
- Named returns should be live at exit HOT 3
- Cut releases more frequently
- Is this tool actively mantained ? HOT 1
- Does it work with go modules? HOT 7
- Site down http://gorefactor.org/
- it seems like go module cannot work with "Extract to function" in vscode HOT 2
- godoctor causing dockerfile build failure HOT 4
- help!i can not complie master
- Manual not visible HOT 1
- Tests are broken HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from godoctor.