# actions3 \(\#3578\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/cea26c9d1003f83381210943212eda01e96e9a2c)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: cea26c9d1003f83381210943212eda01e96e9a2c

Requested commit: cea26c9d1003f83381210943212eda01e96e9a2c

Commit: cea26c9d1003f83381210943212eda01e96e9a2c

Tree: 78a80eda23f96c642818ae5a4810f7dba5cad713

Author: Conrad Irwin

Committer: GitHub

## Message

```
actions3 (#3578)

- Restore impl_actions! and remove derive(Action)

Originally in gpui2 we inferred the action's namespace from the module
it was
defined in. This worked most of the time (ignoring the "remove_the_2"
hack),
but caused unintended (and mostly invisible) behavior in crates with
multiple
modules.

#3577 restored the namespace parameter to actions!, and this PR
reintroduces
`impl_actions!` to do the same for non-unit structs.

I considered trying to keep the struct-attribute API work, because it
does feel
more stylistically appropriate for rust, but two problems lead to it
feeling less good than `impl_actions!` in practice:
1. You have to repeat the namespace for each struct (and usually you're
defining them all in the same namespace)
2. You can't pass an argument to a derive macro inline, you need to use
an attribute instead.


Release Notes:

- N/A
```

## Parents

- [ff45b4385756c149a99ab15871a77a927a255231](https://git.cafe/gitcafe/zed/commit/ff45b4385756c149a99ab15871a77a927a255231?format=markdown)

- [c5367e3085a10b893eea2145c08f3457da103178](https://git.cafe/gitcafe/zed/commit/c5367e3085a10b893eea2145c08f3457da103178?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/cea26c9d1003f83381210943212eda01e96e9a2c?format=markdown)
