From f1f13285afebbf7f4f516ad562633876fc6d8ed0 Mon Sep 17 00:00:00 2001 From: unvalley Date: Sat, 22 Jun 2024 20:46:22 +0900 Subject: [PATCH 1/3] chore: upgrade biome to v1.8.2 --- extension/biome.json | 2 +- extension/package-lock.json | 72 ++++++++++++++++++------------------- extension/package.json | 4 +-- 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/extension/biome.json b/extension/biome.json index 2487385..d154399 100644 --- a/extension/biome.json +++ b/extension/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/1.7.3/schema.json", + "$schema": "https://biomejs.dev/schemas/1.8.2/schema.json", "organizeImports": { "enabled": true }, diff --git a/extension/package-lock.json b/extension/package-lock.json index b0aed4f..6a41363 100644 --- a/extension/package-lock.json +++ b/extension/package-lock.json @@ -11,7 +11,7 @@ "vscode-languageclient": "^8.0.2" }, "devDependencies": { - "@biomejs/biome": "^1.7.3", + "@biomejs/biome": "^1.8.2", "@types/glob": "^8.0.0", "@types/mocha": "^10.0.1", "@types/node": "18.x", @@ -29,9 +29,9 @@ } }, "node_modules/@biomejs/biome": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.7.3.tgz", - "integrity": "sha512-ogFQI+fpXftr+tiahA6bIXwZ7CSikygASdqMtH07J2cUzrpjyTMVc9Y97v23c7/tL1xCZhM+W9k4hYIBm7Q6cQ==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.8.2.tgz", + "integrity": "sha512-XafCzLgs0xbH0bCjYKxQ63ig2V86fZQMq1jiy5pyLToWk9aHxA8GAUxyBtklPHtPYZPGEPOYglQHj4jyfUp+Iw==", "dev": true, "hasInstallScript": true, "bin": { @@ -45,20 +45,20 @@ "url": "https://opencollective.com/biome" }, "optionalDependencies": { - "@biomejs/cli-darwin-arm64": "1.7.3", - "@biomejs/cli-darwin-x64": "1.7.3", - "@biomejs/cli-linux-arm64": "1.7.3", - "@biomejs/cli-linux-arm64-musl": "1.7.3", - "@biomejs/cli-linux-x64": "1.7.3", - "@biomejs/cli-linux-x64-musl": "1.7.3", - "@biomejs/cli-win32-arm64": "1.7.3", - "@biomejs/cli-win32-x64": "1.7.3" + "@biomejs/cli-darwin-arm64": "1.8.2", + "@biomejs/cli-darwin-x64": "1.8.2", + "@biomejs/cli-linux-arm64": "1.8.2", + "@biomejs/cli-linux-arm64-musl": "1.8.2", + "@biomejs/cli-linux-x64": "1.8.2", + "@biomejs/cli-linux-x64-musl": "1.8.2", + "@biomejs/cli-win32-arm64": "1.8.2", + "@biomejs/cli-win32-x64": "1.8.2" } }, "node_modules/@biomejs/cli-darwin-arm64": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.7.3.tgz", - "integrity": "sha512-eDvLQWmGRqrPIRY7AIrkPHkQ3visEItJKkPYSHCscSDdGvKzYjmBJwG1Gu8+QC5ed6R7eiU63LEC0APFBobmfQ==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.8.2.tgz", + "integrity": "sha512-l9msLsTcSIAPqMsPIhodQmb50sEfaXPLQ0YW4cdj6INmd8iaOh/V9NceQb2366vACTJgcWDQ2RzlvURek1T68g==", "cpu": [ "arm64" ], @@ -72,9 +72,9 @@ } }, "node_modules/@biomejs/cli-darwin-x64": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.7.3.tgz", - "integrity": "sha512-JXCaIseKRER7dIURsVlAJacnm8SG5I0RpxZ4ya3dudASYUc68WGl4+FEN03ABY3KMIq7hcK1tzsJiWlmXyosZg==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.8.2.tgz", + "integrity": "sha512-Fc4y/FuIxRSiB3TJ+y27vFDE/HJt4QgBuymktsIKEcBZvnKfsRjxvzVDunccRn4xbKgepnp+fn6BoS+ZIg/I3Q==", "cpu": [ "x64" ], @@ -88,9 +88,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.7.3.tgz", - "integrity": "sha512-phNTBpo7joDFastnmZsFjYcDYobLTx4qR4oPvc9tJ486Bd1SfEVPHEvJdNJrMwUQK56T+TRClOQd/8X1nnjA9w==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.8.2.tgz", + "integrity": "sha512-Q99qwP0qibkZxm2kfnt37OxeIlliDYf5ogi3zX9ij2DULzc+KtPA9Uj0wCljcJofOBsBYaHc7597Q+Bf/251ww==", "cpu": [ "arm64" ], @@ -104,9 +104,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64-musl": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.7.3.tgz", - "integrity": "sha512-c8AlO45PNFZ1BYcwaKzdt46kYbuP6xPGuGQ6h4j3XiEDpyseRRUy/h+6gxj07XovmyxKnSX9GSZ6nVbZvcVUAw==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.8.2.tgz", + "integrity": "sha512-WpT41QJJvkZa1eZq0WmD513zkC6AYaMI39HJKmKeiUeX2NZirG+bxv1YRDhqkns1NbBqo3+qrJqBkPmOW+xAVA==", "cpu": [ "arm64" ], @@ -120,9 +120,9 @@ } }, "node_modules/@biomejs/cli-linux-x64": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.7.3.tgz", - "integrity": "sha512-vnedYcd5p4keT3iD48oSKjOIRPYcjSNNbd8MO1bKo9ajg3GwQXZLAH+0Cvlr+eMsO67/HddWmscSQwTFrC/uPA==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.8.2.tgz", + "integrity": "sha512-bjhhUVFchFid2gOjrvBe4fg8BShcpyFQTHuB/QQnfGxs1ddrGP30yq3fHfc6S6MoCcz9Tjd3Zzq1EfWfyy5iHA==", "cpu": [ "x64" ], @@ -136,9 +136,9 @@ } }, "node_modules/@biomejs/cli-linux-x64-musl": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.7.3.tgz", - "integrity": "sha512-UdEHKtYGWEX3eDmVWvQeT+z05T9/Sdt2+F/7zmMOFQ7boANeX8pcO6EkJPK3wxMudrApsNEKT26rzqK6sZRTRA==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.8.2.tgz", + "integrity": "sha512-rk1Wj4d3LIlAlIAS1m2jlyfOjkNbuY1lfwKvWIAeZC51yDMzwhRD7cReE5PE+jqLDtq60PX38hDPeKd7nA1S6A==", "cpu": [ "x64" ], @@ -152,9 +152,9 @@ } }, "node_modules/@biomejs/cli-win32-arm64": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.7.3.tgz", - "integrity": "sha512-unNCDqUKjujYkkSxs7gFIfdasttbDC4+z0kYmcqzRk6yWVoQBL4dNLcCbdnJS+qvVDNdI9rHp2NwpQ0WAdla4Q==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.8.2.tgz", + "integrity": "sha512-EUbqmCmNWT5xhnxHrCAEBzJB1AnLqxTYoRjlxiCMzGvsy5jQzhCanJ8CT9kNsApW3pfPWBWkoTa7qrwWmwnEGA==", "cpu": [ "arm64" ], @@ -168,9 +168,9 @@ } }, "node_modules/@biomejs/cli-win32-x64": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.7.3.tgz", - "integrity": "sha512-ZmByhbrnmz/UUFYB622CECwhKIPjJLLPr5zr3edhu04LzbfcOrz16VYeNq5dpO1ADG70FORhAJkaIGdaVBG00w==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.8.2.tgz", + "integrity": "sha512-n9H5oRUCk1uNezMgyJh9+hZdtfD8PXLLeq8DUzTycIhl0I1BulIoZ/uxWgRVDFDwAR1JHu1AykISCRFNGnc4iA==", "cpu": [ "x64" ], diff --git a/extension/package.json b/extension/package.json index f12b1d4..14097ab 100644 --- a/extension/package.json +++ b/extension/package.json @@ -66,14 +66,14 @@ "type-check": "tsc --noEmit", "lint": "biome lint .", "format": "biome format .", - "lint:fix-suggested": "biome check --apply .", + "lint:fix-suggested": "biome check --write .", "format:fix": "biome format --write ." }, "dependencies": { "vscode-languageclient": "^8.0.2" }, "devDependencies": { - "@biomejs/biome": "^1.7.3", + "@biomejs/biome": "^1.8.2", "@types/glob": "^8.0.0", "@types/mocha": "^10.0.1", "@types/node": "18.x", From 5e9a7f9215dcf3012beff025331fda0d4573e59d Mon Sep 17 00:00:00 2001 From: Shunsuke Shibayama Date: Wed, 26 Jun 2024 17:07:32 +0900 Subject: [PATCH 2/3] style: format files --- extension/src/commands.ts | 6 ++++- extension/src/extension.ts | 49 ++++++++++++++++++++++++++++---------- 2 files changed, 42 insertions(+), 13 deletions(-) diff --git a/extension/src/commands.ts b/extension/src/commands.ts index 5c0e8bb..80b2cd1 100644 --- a/extension/src/commands.ts +++ b/extension/src/commands.ts @@ -1,6 +1,10 @@ import { Uri, commands } from "vscode"; // copied and modified from https://github.com/rust-lang/rust-analyzer/blob/27239fbb58a115915ffc1ce65ededc951eb00fd2/editors/code/src/commands.ts -import type { LanguageClient, Location, Position } from "vscode-languageclient/node"; +import type { + LanguageClient, + Location, + Position, +} from "vscode-languageclient/node"; export async function showReferences( client: LanguageClient | undefined, diff --git a/extension/src/extension.ts b/extension/src/extension.ts index 60683ee..aaef40a 100644 --- a/extension/src/extension.ts +++ b/extension/src/extension.ts @@ -1,5 +1,9 @@ import { type ExtensionContext, commands, window, workspace } from "vscode"; -import { LanguageClient, type LanguageClientOptions, type ServerOptions } from "vscode-languageclient/node"; +import { + LanguageClient, + type LanguageClientOptions, + type ServerOptions, +} from "vscode-languageclient/node"; import { showReferences } from "./commands"; let client: LanguageClient | undefined; @@ -7,16 +11,30 @@ let client: LanguageClient | undefined; async function startLanguageClient(context: ExtensionContext) { try { const executablePath = (() => { - const executablePath = workspace.getConfiguration("pylyzer").get("executablePath", ""); + const executablePath = workspace + .getConfiguration("pylyzer") + .get("executablePath", ""); return executablePath === "" ? "pylyzer" : executablePath; })(); - const enableDiagnostics = workspace.getConfiguration("pylyzer").get("diagnostics", true); - const enableInlayHints = workspace.getConfiguration("pylyzer").get("inlayHints", false); - const enableSemanticTokens = workspace.getConfiguration("pylyzer").get("semanticTokens", true); - const enableHover = workspace.getConfiguration("pylyzer").get("hover", true); - const smartCompletion = workspace.getConfiguration("pylyzer").get("smartCompletion", true); + const enableDiagnostics = workspace + .getConfiguration("pylyzer") + .get("diagnostics", true); + const enableInlayHints = workspace + .getConfiguration("pylyzer") + .get("inlayHints", false); + const enableSemanticTokens = workspace + .getConfiguration("pylyzer") + .get("semanticTokens", true); + const enableHover = workspace + .getConfiguration("pylyzer") + .get("hover", true); + const smartCompletion = workspace + .getConfiguration("pylyzer") + .get("smartCompletion", true); /* optional features */ - const checkOnType = workspace.getConfiguration("pylyzer").get("checkOnType", false); + const checkOnType = workspace + .getConfiguration("pylyzer") + .get("checkOnType", false); const args = ["--server"]; args.push("--"); if (!enableDiagnostics) { @@ -78,11 +96,18 @@ async function restartLanguageClient() { } export async function activate(context: ExtensionContext) { - context.subscriptions.push(commands.registerCommand("pylyzer.restartLanguageServer", () => restartLanguageClient())); context.subscriptions.push( - commands.registerCommand("pylyzer.showReferences", async (uri, position, locations) => { - await showReferences(client, uri, position, locations); - }), + commands.registerCommand("pylyzer.restartLanguageServer", () => + restartLanguageClient(), + ), + ); + context.subscriptions.push( + commands.registerCommand( + "pylyzer.showReferences", + async (uri, position, locations) => { + await showReferences(client, uri, position, locations); + }, + ), ); await startLanguageClient(context); } From 0717723ca75e2ddb95d6c0fc2410615e1f32f118 Mon Sep 17 00:00:00 2001 From: Shunsuke Shibayama Date: Wed, 26 Jun 2024 17:11:18 +0900 Subject: [PATCH 3/3] Revert "style: format files" This reverts commit 5e9a7f9215dcf3012beff025331fda0d4573e59d. --- extension/src/commands.ts | 6 +---- extension/src/extension.ts | 49 ++++++++++---------------------------- 2 files changed, 13 insertions(+), 42 deletions(-) diff --git a/extension/src/commands.ts b/extension/src/commands.ts index 80b2cd1..5c0e8bb 100644 --- a/extension/src/commands.ts +++ b/extension/src/commands.ts @@ -1,10 +1,6 @@ import { Uri, commands } from "vscode"; // copied and modified from https://github.com/rust-lang/rust-analyzer/blob/27239fbb58a115915ffc1ce65ededc951eb00fd2/editors/code/src/commands.ts -import type { - LanguageClient, - Location, - Position, -} from "vscode-languageclient/node"; +import type { LanguageClient, Location, Position } from "vscode-languageclient/node"; export async function showReferences( client: LanguageClient | undefined, diff --git a/extension/src/extension.ts b/extension/src/extension.ts index aaef40a..60683ee 100644 --- a/extension/src/extension.ts +++ b/extension/src/extension.ts @@ -1,9 +1,5 @@ import { type ExtensionContext, commands, window, workspace } from "vscode"; -import { - LanguageClient, - type LanguageClientOptions, - type ServerOptions, -} from "vscode-languageclient/node"; +import { LanguageClient, type LanguageClientOptions, type ServerOptions } from "vscode-languageclient/node"; import { showReferences } from "./commands"; let client: LanguageClient | undefined; @@ -11,30 +7,16 @@ let client: LanguageClient | undefined; async function startLanguageClient(context: ExtensionContext) { try { const executablePath = (() => { - const executablePath = workspace - .getConfiguration("pylyzer") - .get("executablePath", ""); + const executablePath = workspace.getConfiguration("pylyzer").get("executablePath", ""); return executablePath === "" ? "pylyzer" : executablePath; })(); - const enableDiagnostics = workspace - .getConfiguration("pylyzer") - .get("diagnostics", true); - const enableInlayHints = workspace - .getConfiguration("pylyzer") - .get("inlayHints", false); - const enableSemanticTokens = workspace - .getConfiguration("pylyzer") - .get("semanticTokens", true); - const enableHover = workspace - .getConfiguration("pylyzer") - .get("hover", true); - const smartCompletion = workspace - .getConfiguration("pylyzer") - .get("smartCompletion", true); + const enableDiagnostics = workspace.getConfiguration("pylyzer").get("diagnostics", true); + const enableInlayHints = workspace.getConfiguration("pylyzer").get("inlayHints", false); + const enableSemanticTokens = workspace.getConfiguration("pylyzer").get("semanticTokens", true); + const enableHover = workspace.getConfiguration("pylyzer").get("hover", true); + const smartCompletion = workspace.getConfiguration("pylyzer").get("smartCompletion", true); /* optional features */ - const checkOnType = workspace - .getConfiguration("pylyzer") - .get("checkOnType", false); + const checkOnType = workspace.getConfiguration("pylyzer").get("checkOnType", false); const args = ["--server"]; args.push("--"); if (!enableDiagnostics) { @@ -96,18 +78,11 @@ async function restartLanguageClient() { } export async function activate(context: ExtensionContext) { + context.subscriptions.push(commands.registerCommand("pylyzer.restartLanguageServer", () => restartLanguageClient())); context.subscriptions.push( - commands.registerCommand("pylyzer.restartLanguageServer", () => - restartLanguageClient(), - ), - ); - context.subscriptions.push( - commands.registerCommand( - "pylyzer.showReferences", - async (uri, position, locations) => { - await showReferences(client, uri, position, locations); - }, - ), + commands.registerCommand("pylyzer.showReferences", async (uri, position, locations) => { + await showReferences(client, uri, position, locations); + }), ); await startLanguageClient(context); }