Skip to content

[BUG]: Type hint order matters for VSCode intellisense #162

Closed
@TheTripleV

Description

@TheTripleV

Problem description

Might not be an issue and may be a side-effect of robotpy/robotpy-wpimath#29.

From pathplannerlib's generated .pyi file:

class PathPlannerTrajectory():
    class PathPlannerState():
        ... # stuff here
    class Waypoint():
        ... # stuff here
    def asWPILibTrajectory(self) -> wpimath._controls._controls.trajectory.Trajectory: ...
    def getEndState(self) -> PathPlannerTrajectory.PathPlannerState: ...
    def getInitialState(self) -> PathPlannerTrajectory.PathPlannerState: ...
    def getState(self, i: int) -> PathPlannerTrajectory.PathPlannerState: ...
    def getStates(self) -> typing.List[PathPlannerTrajectory.PathPlannerState]: ...
    def getTotalTime(self) -> seconds: ...
    def numStates(self) -> int: ...
    def sample(self, time: seconds) -> PathPlannerTrajectory.PathPlannerState: ...
    pass

PathPlannerTrajectory's methods come after internal classes. These methods are not recommended by VSCode and are considered errors by PyRight/PyLance.

Operating System

MacOS

Installed Python Packages

No response

Reproducible example code

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions