This repository was archived by the owner on Sep 2, 2025. It is now read-only.
forked from ajshort/vscode-ros
-
Notifications
You must be signed in to change notification settings - Fork 101
This repository was archived by the owner on Sep 2, 2025. It is now read-only.
[feature] "go to definition" for ROS messages #1301
Copy link
Copy link
Open
Labels
Description
what is needed
Support "go to definition" button for ROS messages. Should work similarly to language ones: in any *.msg file it should be triggered by either
- RMB (context menu) on message attribute type -> Go to Definition, or
- F12 with cursor on the type, or
- Ctrl+LMB on type
Then file with message of specified type should open (if type is another message, and not primitive one). It would be nice if extension could work with both custom and standard ROS messages correctly scanning for them in project.
Bonus feature: make the same button but for the C++/Python code (context menu -> "Go to message definition") that is accessible if current type is a generated ROS message.
why is it needed
It allows developers to navigate quickly between ROS messages edit them and remind structure of complex custom messages.
Example
/// src/node.cpp
custom_msgs::MyMessage msg; // F12 or ctrl+click on "MyMessage"...... opens this file
### src/custom_msgs/msg/MyMessage.msg
std_msgs/Header header # F12 or ctrl+click on "Header"...
...... jumps to file:
### /opt/ros/melodic/share/std_msgs/msg/Header.msg
# Standard metadata for higher-level stamped data types.
# This is generally used to communicate timestamped data
# in a particular coordinate frame.
#
# sequence ID: consecutively increasing ID
uint32 seq
#Two-integer timestamp that is expressed as:
# * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')
# * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')
# time-handling sugar is provided by the client library
time stamp
#Frame this data is associated with
string frame_id