Skip to content

Commit

Permalink
Fix Units imports conversion
Browse files Browse the repository at this point in the history
Fixes Mutable imports and units
Fixes wildcard import for Units
Converts MutableMeasure.zero
Fixes wpilibsuite/2025Beta#51
  • Loading branch information
sciencewhiz committed Nov 28, 2024
1 parent 5047124 commit f29db0d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions vscode-wpilib/resources/java_replacements.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,21 @@
{ "from": "SendableRegistry[.]getInstance[(][)][.]", "to": "SendableRegistry." },
{ "from": "[.]get(\\w*)[(](?:GenericHID[.])?Hand[.]k(\\w*)[)]", "to": ".get$2$1()" },
{ "from": "CommandBase", "to": "Command" },
{ "from": "import edu[.]wpi[.]first[.]units[.]measure[.]Measure;", "to": "" },
{ "from": "edu[.]wpi[.]first[.]units[.](.*);", "to": "edu.wpi.first.units.measure.$1;" },
{ "from": "edu[.]wpi[.]first[.]units[.]measure[.]Units[.](\\w*);", "to": "edu.wpi.first.units.Units.$1;" },
{ "from": "edu[.]wpi[.]first[.]units[.]MutableMeasure", "to": "edu.wpi.first.units.MutableMeasure" },
{ "from": "edu[.]wpi[.]first[.]units[.]measure[.]Measure", "to": "edu.wpi.first.units.Measure" },
{ "from": "edu[.]wpi[.]first[.]units[.](?!MutableMeasure|ImmutableMeasure|UnitBuilder|Measure)(.*);", "to": "edu.wpi.first.units.measure.$1;" },
{ "from": "edu[.]wpi[.]first[.]units[.]measure[.]Units[.](.*);", "to": "edu.wpi.first.units.Units.$1;" },
{ "from": "MutableMeasure<(\\w*)>", "to": "Mut$1" },
{ "from": "MutableMeasure<Velocity<Distance>>", "to": "MutLinearVelocity" },
{ "from": "MutableMeasure<Velocity<Angle>>", "to": "MutAngularVelocity" },
{ "from": "MutableMeasure<Velocity<Velocity<Distance>>>", "to": "MutLinearAcceleration" },
{ "from": "MutableMeasure<Velocity<Velocity<Angle>>>", "to": "MutAngularAcceleration" }
{ "from": "Measure<(\\w*)>", "to": "$1" },
{ "from": "Measure<Velocity<Distance>>", "to": "LinearVelocity" },
{ "from": "Measure<Velocity<Angle>>", "to": "AngularVelocity" },
{ "from": "Measure<Velocity<Velocity<Distance>>>", "to": "LinearAcceleration" },
{ "from": "Measure<Velocity<Velocity<Angle>>>", "to": "AngularAcceleration" }
{ "from": "Measure<Velocity<Velocity<Angle>>>", "to": "AngularAcceleration" },
{ "from": "MutableMeasure.zero\\((\\w*)\\)", "to": "$1.mutable(0)" },
]
}
]

0 comments on commit f29db0d

Please sign in to comment.