Skip to content

Commit

Permalink
feat: use --inspect-wait for prerelease deno
Browse files Browse the repository at this point in the history
  • Loading branch information
jeiea committed Aug 16, 2024
1 parent 6a31dc0 commit 5e9bd4c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
6 changes: 2 additions & 4 deletions client/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ 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";
import { getWorkspacesEnabledInfo, setupCheckConfig } from "./enable";
import { denoUpgradePromptAndExecute } from "./upgrade";
import { join } from "path";
import { readFileSync } from "fs";
import { semver } from "./semver";

// deno-lint-ignore no-explicit-any
export type Callback = (...args: any[]) => unknown;
Expand Down Expand Up @@ -263,9 +263,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 5e9bd4c

Please sign in to comment.