-
Notifications
You must be signed in to change notification settings - Fork 56
Description
I am opening this issue to have a discussion and record my findings. This may be something we don't want to do.
The idea is to add SpaceKind::Interface enum value so that interfaces show like classes (see image below).
This was kicked off from the conversation here with @calixteman .
Scope and motivation
This would be used in supported languages that make use interfaces ie. Java, TypeScript (future C# and Go?). This makes more sense recently since, for good or ill, many languages support default implementations on interfaces. This would give other languages a little more parity with the Rust implementation which distinguishes trait and impl already.
Effort and impact
This appears to be a fairly trivial feature to add:
- Add
SpaceKind::Interfaceenum - Add
SpaceKind::Interface => "interface",to the match in theSpaceKindDisplaytrait'sfmtimplementation
The following tasks are needed per language
- For language's
Getter.get_space_kindreturnSpaceKind::Interfacefor correct grammar elements ie.InterfaceDeclarationin Java ie.InterfaceDeclaration => SpaceKind::Interface - For the language's
Checkerimplementation, add the grammar elements in the previous task to theis_func_spacemk_checkermacro arguments so the interface is included as a space for functions and metrics
I am not sure if this has much of a performance impact? I imagine not because of the type of change but I would need input or time to run tests.
Result
I implemented this for the Java lang and this is what it looks like.
