The enum values of SyntaxKind (plus a few smaller enums) in types.ts are not specified as constant values and therefore adding new members between existing ones changes the values of other members. These values end up in tsserverlibrary.d.ts and through that into compiled language service plugins that are published on for instance npm. In a compiled plugin the values will be simple numeric constants from whatever version it was compiled against. Due to this, a language service plugin will probably work incorrectly if the compiler version it's running under is even slightly different from the one it was compiled against.
The edit history of this file looks like members are being added without taking this into account:
https://github.com/Microsoft/TypeScript/blame/d450b8b2ab788d0ca6a22e5202685ac39fc86e9f/src/compiler/types.ts#L50
Even though these values might be semi-internal, I think it would make sense to keep the values stable at least within the same major version in order to not unnecessarily break compatibility with language service plugins. I ran into this problem while playing around with a plugin compiled against the newest version of TypeScript from npm and running it within VS 2017 which apparently has a slightly older version of TypeScript and the enum values are slightly different.
The enum values of SyntaxKind (plus a few smaller enums) in types.ts are not specified as constant values and therefore adding new members between existing ones changes the values of other members. These values end up in tsserverlibrary.d.ts and through that into compiled language service plugins that are published on for instance npm. In a compiled plugin the values will be simple numeric constants from whatever version it was compiled against. Due to this, a language service plugin will probably work incorrectly if the compiler version it's running under is even slightly different from the one it was compiled against.
The edit history of this file looks like members are being added without taking this into account:
https://github.com/Microsoft/TypeScript/blame/d450b8b2ab788d0ca6a22e5202685ac39fc86e9f/src/compiler/types.ts#L50
Even though these values might be semi-internal, I think it would make sense to keep the values stable at least within the same major version in order to not unnecessarily break compatibility with language service plugins. I ran into this problem while playing around with a plugin compiled against the newest version of TypeScript from npm and running it within VS 2017 which apparently has a slightly older version of TypeScript and the enum values are slightly different.