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

workaround for https://github.com/foxglove/rosmsg/issues/39 #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

@@ -7,18 +7,41 @@ import { IConfig } from '../types/config';
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