golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
121.06k stars 17.37k forks source link

x/tools/gopls: CLI cannot rename directories #68097

Open adonovan opened 1 week ago

adonovan commented 1 week ago

In a clean x/tools repo, using tip go1.23 and tip gopls, in VS Code, rename package frob in gopls/internal/util/frob/frob.go to "blorf" using this command:

xtools$ gopls rename -w ~/w/xtools/gopls/internal/util/frob/frob.go:#1151 blorf
gopls: getFile: file:///Users/adonovan/w/xtools/gopls/internal/util/frob: read /Users/adonovan/w/xtools/gopls/internal/util/frob: is a directory

The error appears to arise from a WorkspaceEdit containing a rename DocumentChange referring to a directory.

gabyhelp commented 1 week ago

Similar Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)