Skip to content

Commit

Permalink
chore: fix generate workspace installation warnings (#7055)
Browse files Browse the repository at this point in the history
Fixes #7054.
  • Loading branch information
skyrpex authored Aug 30, 2024
1 parent 00c1a8f commit 221b738
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
8 changes: 6 additions & 2 deletions apps/wing/src/commands/diagnostics.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { existsSync, statSync } from "fs";
import { readFile } from "fs/promises";
import { relative } from "path";
import { WingDiagnostic } from "@winglang/compiler";
import { Label, File, emitDiagnostic, CHARS_ASCII } from "codespan-wasm";
import { COLORING } from "../util";
import { existsSync, statSync } from "fs";

export async function formatDiagnostics(diagnostics: WingDiagnostic[]): Promise<string> {
const cwd = process.cwd();
Expand Down Expand Up @@ -33,7 +33,11 @@ export async function formatDiagnostics(diagnostics: WingDiagnostic[]): Promise<

for (const annotation of annotations) {
// file_id might be "" if the span is synthetic (see #2521)
if (!annotation.span?.file_id || !existsSync(annotation.span.file_id) || !statSync(annotation.span.file_id).isFile()) {
if (
!annotation.span?.file_id ||
!existsSync(annotation.span.file_id) ||
!statSync(annotation.span.file_id).isFile()
) {
continue;
}
const source = await readFile(annotation.span.file_id, "utf8");
Expand Down
2 changes: 1 addition & 1 deletion apps/wing/src/commands/pack.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as fs from "fs/promises";
import { existsSync } from "fs";
import * as fs from "fs/promises";
import { join } from "path";
import { describe, it, expect, afterEach, vi } from "vitest";
import { pack } from "./pack";
Expand Down
3 changes: 3 additions & 0 deletions tools/generate-workspace/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ const ignoreList = [
"@wingconsole/tsconfig",
"@wingconsole/use-loading",
"@wingconsole/use-persistent-state",
"@wingconsole/utilities",
"@winglang/compatibility-spy",
"@winglang/platform-awscdk",
"@winglang/tree-sitter-wing",
"@winglang/wingc",
"@winglang/wingii",
"@winglibs/testfixture",
"@winglang/docs",
"bump-pack",
"compatibility-matrix-automation",
"construct-library",
Expand All @@ -41,6 +43,7 @@ const nameMapping: Record<string, string> = {
"examples-invalid": "Tests: Invalid",
"examples-sdk": "SDK Tests",
"examples-valid": "Tests: Valid",
"examples-docs": "Tests: Docs",
"vscode-wing": "VSCode",
"wing-api-checker": "API Checker",
winglang: "CLI",
Expand Down
4 changes: 4 additions & 0 deletions wing.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
"name": "Tests: Valid",
"path": "./examples/tests/valid"
},
{
"name": "Tests: Docs",
"path": "./examples/tests/doc_examples"
},
{
"name": "VSCode",
"path": "./apps/vscode-wing"
Expand Down

0 comments on commit 221b738

Please sign in to comment.