Skip to content

Commit 72c04ba

Browse files
Make it easier for Windows users to test Red Knot (#703)
## Summary The extension now also recognizes `red_knot.exe` as a Red Knot affix. ## Test Plan None. --------- Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
1 parent 9da8dc2 commit 72c04ba

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/common/server.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@ async function createNativeServer(
175175

176176
logger.info(`Found Ruff ${versionToString(ruffVersion)} at ${ruffBinaryPath}`);
177177

178-
if (!ruffBinaryPath.endsWith("red_knot")) {
178+
const isRedKnot = ruffBinaryPath.endsWith("red_knot") || ruffBinaryPath.endsWith("red_knot.exe");
179+
180+
if (!isRedKnot) {
179181
if (!supportsNativeServer(ruffVersion)) {
180182
const message =
181183
`Native server requires Ruff ${versionToString(
@@ -192,7 +194,7 @@ async function createNativeServer(
192194
}
193195

194196
let ruffServerArgs: string[];
195-
if (ruffBinaryPath.endsWith("red_knot")) {
197+
if (isRedKnot) {
196198
ruffServerArgs = [RUFF_SERVER_SUBCOMMAND];
197199
} else if (supportsStableNativeServer(ruffVersion)) {
198200
ruffServerArgs = [RUFF_SERVER_SUBCOMMAND];

0 commit comments

Comments
 (0)