@@ -35,9 +35,14 @@ private NodeJsManager() {
3535 private static final String MACOS_DSCL_SHELL_PREFIX = "UserShell: " ;
3636
3737 /**
38- * The minimum required version of Node.js for Copilot Language Server.
38+ * The minimum required major version of Node.js for Copilot Language Server.
3939 */
40- private static final int REQUIRED_MINIMUM_VERSION = 22 ;
40+ private static final int REQUIRED_MINIMUM_MAJOR_VERSION = 22 ;
41+
42+ /**
43+ * The minimum required minor version of Node.js for Copilot Language Server (when major equals the minimum).
44+ */
45+ private static final int REQUIRED_MINIMUM_MINOR_VERSION = 13 ;
4146
4247 private static final String NODE_NAME = "node" ;
4348
@@ -276,9 +281,14 @@ private static boolean validateNodeVersion(File nodeJsLocation) {
276281 }
277282
278283 try {
279- String majorVersionStr = nodeVersion .split ("\\ ." )[0 ];
280- int majorVersion = Integer .parseInt (majorVersionStr );
281- return majorVersion >= REQUIRED_MINIMUM_VERSION ;
284+ String [] versionParts = nodeVersion .split ("\\ ." );
285+ int majorVersion = Integer .parseInt (versionParts [0 ]);
286+ int minorVersion = versionParts .length > 1 ? Integer .parseInt (versionParts [1 ]) : 0 ;
287+
288+ if (majorVersion != REQUIRED_MINIMUM_MAJOR_VERSION ) {
289+ return majorVersion > REQUIRED_MINIMUM_MAJOR_VERSION ;
290+ }
291+ return minorVersion >= REQUIRED_MINIMUM_MINOR_VERSION ;
282292 } catch (Exception e ) {
283293 Activator .getDefault ().getLog ().log (new Status (IStatus .ERROR ,
284294 Activator .getDefault ().getBundle ().getSymbolicName (), "Failed to parse Node.js version: " + nodeVersion , e ));
0 commit comments