[ABANDONED] 'Go To Declaration' won't work from a definition

  • Nordic are very fond of this kind of thing:

    ie, renaming functions via #defines.

    So, for example, in my code I might call nrf_drv_gpiote_init:

    C
    err_code = nrf_drv_gpiote_init();
        APP_ERROR_CHECK(err_code);


    If I do either 'Go To Definition' or 'Go To Declaration' on that call, they both end up at the #define


    C
    /** @brief Macro for forwarding the new implementation. */
    #define nrf_drv_gpiote_in_init            nrfx_gpiote_in_init

    Which is all fine and correct.


    But, if I select nrfx_gpiote_in_init on that #define line, then 'Go To Declaration' will go to the definition - not the declaration:

    C
    nrfx_err_t nrfx_gpiote_in_init(nrfx_gpiote_pin_t               pin,
                                   nrfx_gpiote_in_config_t const * p_config,
                                   nrfx_gpiote_evt_handler_t       evt_handler)
    {
        NRFX_ASSERT(pin < NUMBER_OF_PINS);
        nrfx_err_t err_code = NRFX_SUCCESS;
        :
        :


    This is WRONG!


    And 'Go To Declaration' at that point does nothing.

    Why is this important?

    Because, as is common practice, the documentation is with the declaration - not the definition:

  • Hello,

    Thank you for your inquiry.
    We tried to reproduce the issue but it was not possible with our simplified examples.
    Could you point me to the correct Nordic SDK source for reference?
    Which Embedded Studio version are you using? Does the behaviour change when using the latest version?

    Best regards,
    Nino

    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

  • Actually, it's not limited to just the definitions redirected via macros as described.

    I frequently find that 'Got To Declaration' won't even work on a "simple", un-obfuscated definition.

    The behaviour doesn't seem to be entirely consistent: sometimes it does work, often it doesn't.

    I've not been able to spot any pattern in when it does & doesn't work (other than with the macro stuff).

    I get a similar problem with header file names: usually, after selecting a header file name in a #include, 'Go To Definition' will open that header. Except when it doesn't.

    I have seen this behaviour ever since I start using SES with the Nordic nRF52 SDK v15.0.0, and now on v15.3.0

    SES version is:

    Using a later version of SES with the Nordic SDK caused too much grief last time I tried it ...

    Is it possible to have 2 different versions of SES installed at the same time on the same PC?

    EDIT

    I see that the Nordic SDK v15.3.0 now recommends SES v4.12 - so I could give that a go. But the question about multiple SES versions on the same PC still stands ...

    Edited once, last by awneil: updated information (May 9, 2019 at 5:15 PM).

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!