Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display special badge for methods overrides #219

Open
bennycode opened this issue Jan 15, 2016 · 5 comments
Open

Display special badge for methods overrides #219

bennycode opened this issue Jan 15, 2016 · 5 comments
Labels

Comments

@bennycode
Copy link

In some programming languages like Java it is common to annotate method implementations (which come from an interface) with @override.

It would be nice if codo would also have this annotation.

Example for @override:

Interface

window.cryptobox ?= {}

class cryptobox.CryptoboxStore
  add_prekey: (key) ->
  load_prekey: (prekey_id) ->

Implementation

window.z ?= {}
z.storage ?= {}

class z.storage.EncryptionAssetStore extends cryptobox.CryptoboxStore

  constructor: (@storage_repository) ->
    @prekeys = {}

  ###
  @override
  ###
  add_prekey: (prekey) ->
    Proteus.util.TypeUtil.assert_is_instance Proteus.keys.PreKey, prekey
    serialised = prekey.serialise()
    @prekeys[prekey.key_id] = serialised

  ###
  @override
  ###
  load_prekey: (prekey_id) ->
    serialised = @prekeys[prekey_id]
    return undefined if not serialised
    return Proteus.keys.PreKey.deserialise serialised

What do you think about my idea? Or is there already an approach to handle my use case with the current codo?

@inossidabile
Copy link
Member

I don't see the need to annotate something that can be extracted from source code directly.

@bennycode
Copy link
Author

But this is common practice and in the end everything can be extracted from the source code so why annotating functions at all?

@inossidabile
Copy link
Member

I'm ok to accept PR that leaves overriding mark based on having similarly named method in parent. With current Codo design it should be piece of cake. We will not introduce the tag - if it shows you overrides - it has to show them all. Another approach is harmful.

@inossidabile
Copy link
Member

In fact I like the idea of displaying that. I'll keep it open.

@E-geek
Copy link

E-geek commented Jun 23, 2016

I keep this solution!

@inossidabile inossidabile changed the title Support for @override annotation Display special badge for methods overrides Jul 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants