Skip to content

Commit

Permalink
feat: use --inspect-wait for prerelease deno (#1150)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeiea authored Sep 23, 2024
1 parent 8444e87 commit b7258f4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
run: npx $VSCE_COMMAND package -o vscode-deno.vsix

- name: Artifact upload
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: vscode-deno
path: vscode-deno.vsix
Expand Down
6 changes: 2 additions & 4 deletions client/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import { createRegistryStateHandler } from "./notification_handlers";
import { DenoServerInfo } from "./server_info";

import * as dotenv from "dotenv";
import * as semver from "semver";
import * as vscode from "vscode";
import { LanguageClient, ServerOptions } from "vscode-languageclient/node";
import type { Location, Position } from "vscode-languageclient/node";
Expand All @@ -39,6 +38,7 @@ import { denoUpgradePromptAndExecute } from "./upgrade";
import { join } from "path";
import { readFileSync } from "fs";
import * as process from "process";
import { semver } from "./semver";

// deno-lint-ignore no-explicit-any
export type Callback = (...args: any[]) => unknown;
Expand Down Expand Up @@ -261,9 +261,7 @@ export function startLanguageServer(

if (
semver.valid(extensionContext.serverInfo.version) &&
!semver.satisfies(extensionContext.serverInfo.version, SERVER_SEMVER, {
includePrerelease: true,
})
!semver.satisfies(extensionContext.serverInfo.version, SERVER_SEMVER)
) {
notifyServerSemver(extensionContext.serverInfo.version);
} else {
Expand Down
18 changes: 18 additions & 0 deletions client/src/semver.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import * as semverPackage from "semver";
import { Options, Range, SemVer } from "semver";

export const semver = {
...semverPackage,

satisfies: (
version: string | SemVer,
range: string | Range,
optionsOrLoose?: boolean | Options,
): boolean => {
return semverPackage.satisfies(
version,
range,
optionsOrLoose ?? { includePrerelease: true },
);
},
};
2 changes: 1 addition & 1 deletion client/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import * as fs from "fs";
import * as os from "os";
import * as path from "path";
import * as process from "process";
import * as semver from "semver";
import {
Location,
Position,
Expand All @@ -16,6 +15,7 @@ import {
WorkspaceFolder,
} from "vscode";
import { JSONVisitor, visit } from "jsonc-parser/lib/esm/main.js";
import { semver } from "./semver";

/** Assert that the condition is "truthy", otherwise throw. */
export function assert(cond: unknown, msg = "Assertion failed."): asserts cond {
Expand Down

0 comments on commit b7258f4

Please sign in to comment.