Skip to content

Conversation

@jobafr
Copy link
Contributor

@jobafr jobafr commented Oct 9, 2023

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    Bug fix

  • What is the current behavior? (You can also link to an open issue here)
    foxglove/rosmsg mixes up types with the same name, which means that ros-typescript-generator generates incorrect interfaces. For a minimal example see
    Types with same name are mixed up foxglove/rosmsg#39

  • What is the new behavior (if this is a feature change)?
    When a message field's type is declared without an explicit package name, assume it refers to a type in the same package.

  • Other information:
    This should probably be fixed upstream in foxglove/rosmsg, but their parser seems rather elaborate and I couldn't figure it out, so I reported the bug there and implemented this workaround here for the time being.

import { generateFromRosMsg } from './generateFromRosMsg';
import { getMsgFilesData } from './readMsgFiles';

const disambiguatePkgOfPropertyTypes = (joinedMessages: string) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A test and fixing of lint issues on this would be much appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants