zls
zls copied to clipboard
Move to file action
It would be really nice if there was a "move this struct to a new file" LSP action that becomes available when you select const Foo = struct {.... This would involve:
- Copying all the referenced identifiers as imports in the new file
- Adding
pubin front of referenced identifiers and functions that are not public - Adding a
pub const Foo = @import("./${target}.zig")
This is a feature that the TypeScript LSP has (when you click "Refactor")
When you click "Move to file", it causes the editor to prompt the user for a file path