Skip to content
This repository was archived by the owner on Jul 21, 2026. It is now read-only.
This repository was archived by the owner on Jul 21, 2026. It is now read-only.

[Bug]: regenerating numbers rename the enumeration constants #190

Description

@markand

Is there an existing issue for this?

  • I have searched the existing issues and this is a new bug

Bug Description

Considering this enum:

	enum Method {
		AGA8_GCM_1 = 0;
		AGA8_GCM_2 = 1;
		AGANX19_HI = 2;
		AGANX19_LO = 3;
		GERG88_1 = 1;
		GERG88_2 = 1;
		GERG88_3 = 1;
		CONSTANT = 4;
		DCAGA = 5;
	}

When using the feature "Proto3: Renumber Fields/Enum values", it renames GERG88_1, GERG88_2 and GERG88_3 to GERG88_4, GERG88_5, GERG88_6 thinking that they are part of the enum number.

See after calling the command:

	enum Method {
		AGA8_GCM_1 = 0;
		AGA8_GCM_2 = 1;
		AGANX19_HI = 2;
		AGANX19_LO = 3;
		GERG88_4 = 1;
		GERG88_2 = 5;
		GERG88_3 = 6;
		CONSTANT = 7;
		DCAGA = 8;
	}

Expected Behavior

	enum Method {
		AGA8_GCM_1 = 0;
		AGA8_GCM_2 = 1;
		AGANX19_HI = 2;
		AGANX19_LO = 3;
		GERG88_1 = 4;
		GERG88_2 = 5;
		GERG88_3 = 6;
		CONSTANT = 7;
		DCAGA = 8;
	}

Actual Behavior

	enum Method {
		AGA8_GCM_1 = 0;
		AGA8_GCM_2 = 1;
		AGANX19_HI = 2;
		AGANX19_LO = 3;
		GERG88_4 = 1;
		GERG88_2 = 5;
		GERG88_3 = 6;
		CONSTANT = 7;
		DCAGA = 8;
	}

Steps to Reproduce

  1. Use the example
  2. Use command to renumber fields.

Proto File Sample

message Calculation {
	enum Method {
		AGA8_GCM_1 = 0;
		AGA8_GCM_2 = 1;
		AGANX19_HI = 2;
		AGANX19_LO = 3;
		GERG88_1 = 4;
		GERG88_2 = 5;
		GERG88_3 = 6;
		CONSTANT = 7;
		DCAGA = 8;
	}
}

VS Code Version

1.96.4

Extension Version

0.5.7

Operating System

Windows 11

Is protoc installed?

Yes

protoc Version (if installed)

No response

Is clang-format installed?

None

Relevant Settings

Error Logs

Screenshots

No response

Additional Context

No response

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions