From 072f69e4c16bb49f9fd94989029d3e5086e8ac22 Mon Sep 17 00:00:00 2001 From: Bruno Ortiz Date: Wed, 26 Apr 2023 22:02:38 -0300 Subject: [PATCH] fixing ts linting and rust test --- crates/project-model/src/workspace.rs | 29 ++++++++++++----------- editors/code/src/ctx.ts | 18 +++++++------- editors/code/src/dependencies_provider.ts | 9 +++---- editors/code/src/toolchain.ts | 2 +- 4 files changed, 30 insertions(+), 28 deletions(-) diff --git a/crates/project-model/src/workspace.rs b/crates/project-model/src/workspace.rs index 102f862522e..5924287a37f 100644 --- a/crates/project-model/src/workspace.rs +++ b/crates/project-model/src/workspace.rs @@ -1317,24 +1317,25 @@ fn sysroot_to_crate_graph( .filter_map(|krate| { let file_id = load(&sysroot[krate].root)?; - let env = Env::default(); - let display_name = CrateDisplayName::from_canonical_name(sysroot[krate].name.clone()); - let crate_id = crate_graph.add_crate_root( + let env = Env::default(); + let display_name = + CrateDisplayName::from_canonical_name(sysroot[krate].name.clone()); + let crate_id = crate_graph.add_crate_root( file_id, Edition::CURRENT, Some(display_name), None, - cfg_options.clone(), - None, - env, - false, - CrateOrigin::Lang(LangCrateOrigin::from(&*sysroot[krate].name)), - target_layout.clone(), - channel, - ); - Some((krate, crate_id)) - }) - .collect(), + cfg_options.clone(), + None, + env, + false, + CrateOrigin::Lang(LangCrateOrigin::from(&*sysroot[krate].name)), + target_layout.clone(), + channel, + ); + Some((krate, crate_id)) + }) + .collect(), }; for from in sysroot.crates() { for &to in sysroot[from].deps.iter() { diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts index 60ea7695795..8bed74b88ea 100644 --- a/editors/code/src/ctx.ts +++ b/editors/code/src/ctx.ts @@ -33,12 +33,12 @@ import { ExecOptions } from "child_process"; export type Workspace = | { kind: "Empty" } | { - kind: "Workspace Folder"; -} + kind: "Workspace Folder"; + } | { - kind: "Detached Files"; - files: vscode.TextDocument[]; -}; + kind: "Detached Files"; + files: vscode.TextDocument[]; + }; export function fetchWorkspace(): Workspace { const folders = (vscode.workspace.workspaceFolders || []).filter( @@ -52,9 +52,9 @@ export function fetchWorkspace(): Workspace { ? rustDocuments.length === 0 ? { kind: "Empty" } : { - kind: "Detached Files", - files: rustDocuments, - } + kind: "Detached Files", + files: rustDocuments, + } : { kind: "Workspace Folder" }; } @@ -476,4 +476,4 @@ export interface Disposable { dispose(): void; } -export type Cmd = (...args: any[]) => unknown; \ No newline at end of file +export type Cmd = (...args: any[]) => unknown; diff --git a/editors/code/src/dependencies_provider.ts b/editors/code/src/dependencies_provider.ts index 0faf7665cfd..59b3b27731c 100644 --- a/editors/code/src/dependencies_provider.ts +++ b/editors/code/src/dependencies_provider.ts @@ -1,12 +1,13 @@ import * as vscode from "vscode"; import * as fspath from "path"; import * as fs from "fs"; -import {CtxInit} from "./ctx"; +import { CtxInit } from "./ctx"; import * as ra from "./lsp_ext"; -import {FetchDependencyListResult} from "./lsp_ext"; +import { FetchDependencyListResult } from "./lsp_ext"; export class RustDependenciesProvider - implements vscode.TreeDataProvider { + implements vscode.TreeDataProvider +{ dependenciesMap: { [id: string]: Dependency | DependencyFile }; ctx: CtxInit; @@ -131,4 +132,4 @@ export class DependencyFile extends vscode.TreeItem { } } -export type DependencyId = { id: string }; \ No newline at end of file +export type DependencyId = { id: string }; diff --git a/editors/code/src/toolchain.ts b/editors/code/src/toolchain.ts index c876048ba65..917a1d6b099 100644 --- a/editors/code/src/toolchain.ts +++ b/editors/code/src/toolchain.ts @@ -211,4 +211,4 @@ async function isFileAtUri(uri: vscode.Uri): Promise { } catch { return false; } -} \ No newline at end of file +}