golang / go

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

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

Open adonovan opened 5 months ago

adonovan commented 5 months 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 5 months ago

Similar Issues

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