PlatformIO IDE for Atom: Go To Declaration

That’s a cool feature to have. Many thanks.

I just wonder if it’s possible to replace [F3] with [Ctrl]+[Left Mouse Button Click]?

We are working on it. We will inform later when this feature will be available.

Hi Ivan,

are there any requirements to use the “Jump to declaration” feature? I freshly installed IDE 1.2.2 and set up a basic Blink sketch. But when I want to jump to the “digitalWrite” declaration for example (using F3 shortkey) nothing happens.

I found out that in the context menu there are two entries: “Goto declaration” and “Go to declaration”. Might there be a conflict that prevents the feature from working?

Best regards,
Thomas

Hi,

Is your sketch with *.cpp/*.c extension?

Yes. The source file is named “Blink.cpp” and contains the default Arduino Blink example - just with the additional “Arduino.h” include.
Unfortunately I cannot find any Atom syslog file to find out what’s going on…

  1. Try Menu: PlatformIO > Rebuild C/C++ index
  2. Does autocompletion work?

Index is rebuilt and auto completion does work flawlessly. It’s just as if F3 is not bound to anything - but it is as settings menu shows…

Did you try 2 different “Go to declarations” from the context menu?

I did. The “Goto Declaration” item highlights the method the cursor in on, the “Go to Declaration” doesn’t do anything a all.

Please provide:

  1. OS type
  2. The source code of platformio.ini
  3. The log output (Menu: View > Developer > Toggle Developer Tools > Console).

Thanks.

OS Type:
Windows 10 64bit

platform.ini

[env:nanoatmega328]
platform = atmelavr
framework = arduino
board = nanoatmega328

Log:

In file included from <stdin>:16:
C:\Users\Thomas\.platformio\packages\framework-arduinoavr\cores\arduino\Arduino.h:155:23: warning: unknown attribute __progmem__ ignored [-Wunknown-attributes]
extern const uint16_t PROGMEM port_to_mode_PGM[];
                      ^

autocomplete-clang.coffee:87 C:\Users\Thomas\.platformio\packages\toolchain-atmelavr\avr\include\avr/pgmspace.h:109:17: note: expanded from macro 'PROGMEM'
#define PROGMEM __ATTR_PROGMEM__
                ^
C:\Users\Thomas\.platformio\packages\toolchain-atmelavr\avr\include\avr/pgmspace.h:95:41: note: expanded from macro '__ATTR_PROGMEM__'
#define __ATTR_PROGMEM__ __attribute__((__progmem__))
                                        ^
In file included from <stdin>:16:
C:\Users\Thomas\.platformio\packages\framework-arduinoavr\cores\arduino\Arduino.h:156:23: warning: unknown attribute '__progmem__' ignored [-Wunknown-attributes]
extern const uint16_t PROGMEM port_to_input_PGM[];
                      ^
C:\Users\Thomas\.platformio\packages\toolchain-atmelavr\avr\include\avr/pgmspace.h:109:17: note: expanded from macro 'PROGMEM'
#define PROGMEM __ATTR_PROGMEM__
                ^
C:\Users\Thomas\.platformio\packages\toolchain-atmelavr\avr\include\avr/pgmspace.h:95:41: note: expanded from macro '__ATTR_PROGMEM__'
#define __ATTR_PROGMEM__ __attribute__((__progmem__))
                                        ^
In file included from <stdin>:16:
C:\Users\Thomas\.platformio\packages\framework-arduinoavr\cores\arduino\Arduino.h:157:23: warning: unknown attribute '__progmem__' ignored [-Wunknown-attributes]
extern const uint16_t PROGMEM port_to_output_PGM[];
                      ^
C:\Users\Thomas\.platformio\packages\toolchain-atmelavr\avr\include\avr/pgmspace.h:109:17: note: expanded from macro 'PROGMEM'
#define PROGMEM __ATTR_PROGMEM__
                ^
C:\Users\Thomas\.platformio\packages\toolchain-atmelavr\avr\include\avr/pgmspace.h:95:41: note: expanded from macro '__ATTR_PROGMEM__'
#define __ATTR_PROGMEM__ __attribute__((__progmem__))
                                        ^
In file included from <stdin>:16:
C:\Users\Thomas\.platformio\packages\framework-arduinoavr\cores\arduino\Arduino.h:159:22: warning: unknown attribute '__progmem__' ignored [-Wunknown-attributes]
extern const uint8_t PROGMEM digital_pin_to_port_PGM[];
                     ^
C:\Users\Thomas\.platformio\packages\toolchain-atmelavr\avr\include\avr/pgmspace.h:109:17: note: expanded from macro 'PROGMEM'
#define PROGMEM __ATTR_PROGMEM__
                ^
C:\Users\Thomas\.platformio\packages\toolchain-atmelavr\avr\include\avr/pgmspace.h:95:41: note: expanded from macro '__ATTR_PROGMEM__'
#define __ATTR_PROGMEM__ __attribute__((__progmem__))
                                        ^
In file included from <stdin>:16:
C:\Users\Thomas\.platformio\packages\framework-arduinoavr\cores\arduino\Arduino.h:161:22: warning: unknown attribute '__progmem__' ignored [-Wunknown-attributes]
extern const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[];
                     ^
C:\Users\Thomas\.platformio\packages\toolchain-atmelavr\avr\include\avr/pgmspace.h:109:17: note: expanded from macro 'PROGMEM'
#define PROGMEM __ATTR_PROGMEM__
                ^

autocomplete-clang.coffee:87 C:\Users\Thomas\.platformio\packages\toolchain-atmelavr\avr\include\avr/pgmspace.h:95:41: note: expanded from macro '__ATTR_PROGMEM__'
#define __ATTR_PROGMEM__ __attribute__((__progmem__))
                                        ^
In file included from <stdin>:16:
C:\Users\Thomas\.platformio\packages\framework-arduinoavr\cores\arduino\Arduino.h:162:22: warning: unknown attribute '__progmem__' ignored [-Wunknown-attributes]
extern const uint8_t PROGMEM digital_pin_to_timer_PGM[];
                     ^
C:\Users\Thomas\.platformio\packages\toolchain-atmelavr\avr\include\avr/pgmspace.h:109:17: note: expanded from macro 'PROGMEM'
#define PROGMEM __ATTR_PROGMEM__
                ^
C:\Users\Thomas\.platformio\packages\toolchain-atmelavr\avr\include\avr/pgmspace.h:95:41: note: expanded from macro '__ATTR_PROGMEM__'
#define __ATTR_PROGMEM__ __attribute__((__progmem__))
                                        ^

autocomplete-clang.coffee:87 In file included from <stdin>:16:
In file included from C:\Users\Thomas\.platformio\packages\framework-arduinoavr\cores\arduino\Arduino.h:225:
In file included from C:\Users\Thomas\.platformio\packages\framework-arduinoavr\cores\arduino/USBAPI.h:27:
In file included from C:\Users\Thomas\.platformio\packages\toolchain-atmelavr\avr\include\util/delay.h:43:
C:\Users\Thomas\.platformio\packages\toolchain-atmelavr\avr\include\util/delay_basic.h:108:5: error: invalid output constraint '=w' in asm
                : "=w" (__count)
                  ^

autocomplete-clang.coffee:87 In file included from <stdin>:16:
In file included from C:\Users\Thomas\.platformio\packages\framework-arduinoavr\cores\arduino\Arduino.h:225:
In file included from C:\Users\Thomas\.platformio\packages\framework-arduinoavr\cores\arduino/USBAPI.h:27:
C:\Users\Thomas\.platformio\packages\toolchain-atmelavr\avr\include\util/delay.h:95:3: warning: "Compiler optimizations disabled; functions from <util/delay.h> won't work as designed" [-W#warnings]
# warning "Compiler optimizations disabled; functions from <util/delay.h> won't work as designed"
  ^

autocomplete-clang.coffee:87 7 warnings and 1 error generated.

@valeros has just checked it under Windows and reported that this feature does not work. @DerTomm please open an issue here: GitHub - platformio/platformio-atom-ide: PlatformIO IDE for Atom: The next generation integrated development environment for IoT

P.S: It works very well under Unix.

Done.

Good to know :slight_smile:

Hello, are there any news on this issue?

We work on the big update for PlatformIO IDE 2.0. I hope after that we will resolve this issue.

This is good to know, is there an estimate release date?

It will be good to have first public beta this year :blush:

@ivankravets unfortunately I was a bit busy and I didn’t had the chance to check the progress on this issue.
Has the beta been released to the public? Is the feature working on windows?
I really like this feature when I have a lot of code lines written :slight_smile:

We haven’t released PIO IDE 2.0 yet. However, we announced the first public Preview. See

Hi, Ivan.

I’m also having trouble with “go to declaration”. I did ask on the Atom.io board at Sunsetting Atom | The GitHub Blog as well and I was referred to this board.

Info:

  1. Debian Stable (Platform.IO 3.5.3a8 on Atom.IO)

  2. platformio.ini

    [env:esp32dev]
    platform=espressif32
    board=esp32dev
    framework=arduino
    monitor_baud=115200
    [platformio]
    src_dir=.
    lib_extra_dirs = …/…/libraries

  3. Log
    autocomplete-clang.coffee? [sm]:86 GoDecl err
    clang: error: no input files

Error message above was the result of opening the telelogger project and trying to navigate, for example, from initialize() in line 976. This is just an example, no similar jumps work anywhere in any of the Arduino sketches I am trying.

Could you please tell me what I am doing wrong?

Thanks,
Andrea.