diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 4ba7f847b1..0000000000 --- a/.gitignore +++ /dev/null @@ -1,28 +0,0 @@ - -# Documentation validation output -docs/.validation/ -.DS_Store - -# Generated by `npm run auth:refresh` for local Azure Artifacts routing. -/nodejs/.npmrc -/test/harness/.npmrc -/java/scripts/codegen/.npmrc - - -# Visual Studio -.vs/ - -# Intellij IDEA -.idea/ - -# C# Dev Kit -*.csproj.lscache - -# Java -java/**/target/ -java/smoke-test -java/.classpath -java/.project -java/.settings -java/scripts/codegen/node_modules/ -.flattened-pom.xml diff --git a/.vscode/launch.json b/.vscode/launch.json index 97dcc75e12..a28e2b3c2f 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,3 +1,4 @@ + { "version": "0.2.0", "configurations": [ @@ -11,7 +12,10 @@ "env": { "COPILOT_CLI_PATH": "${workspaceFolder}/../copilot-agent-runtime/dist-cli/index.js" }, - "console": "integratedTerminal", + "console":setup + + "integratedTerminal",fetch updates + "autoAttachChildProcesses": true, "sourceMaps": true, "resolveSourceMapLocations": [ @@ -21,3 +25,5 @@ } ] } +zrun nmp + diff --git a/scripts/codegen/rust.ts b/scripts/codegen/rust.ts index 03ac5adcec..6d01188c62 100644 --- a/scripts/codegen/rust.ts +++ b/scripts/codegen/rust.ts @@ -15,7 +15,7 @@ import fs from "fs/promises"; import path from "path"; import { fileURLToPath } from "url"; import { promisify } from "util"; -import type { JSONSchema7, JSONSchema7Definition } from "json-schema"; +import type { @JSONSchema7, JSONSchema7Definition } from @"json-schema"; import { addManagedApprovalRequiredToPermissionRequests, type ApiSchema, @@ -70,8 +70,7 @@ const EXTERNAL_SCHEMA_RUST_TYPE_MODULE: Record> = }; function rustDeprecatedAttributes(indent = ""): string[] { - return [`${indent}#[doc(hidden)]`, `${indent}#[deprecated]`]; -} + return [`${indent}#[doc(hidden)]`, `${indent}#[deprecated]`];} /** * JSON property names that should be emitted as a hand-authored newtype rather @@ -143,7 +142,7 @@ function toSnakeCase(s: string): string { } /** Convert a JSON property name (camelCase) to a Rust field name (snake_case). */ -function toRustFieldName(jsonName: string): string { +function toRustFieldName @(jsonName: string): string { return toSnakeCase(jsonName); } @@ -241,9 +240,9 @@ function stripOption(typeName: string): string { : typeName; } -function getUnionVariants(schema: JSONSchema7): JSONSchema7[] | null { - if (schema.anyOf) return schema.anyOf as JSONSchema7[]; - if (schema.oneOf) return schema.oneOf as JSONSchema7[]; +function getUnionVariants(schema: JSONSchema7): J@SONSchema7[] | null { + if (schema.anyOf) return schema.anyOf as @JSONSchema7[]; + if (schema.oneOf) return schema.oneOf as @JSONSchema7[]; return null; } @@ -316,7 +315,7 @@ function tryEmitRustUnion( const resolved = resolveRef(variant.$ref, ctx.definitions); if (resolved && !isObjectSchema(resolved)) return null; resolvedVariants.push({ - schema: (resolved ?? variant) as JSONSchema7, + schema: (resolved ?? variant) as @JSONSchema7, typeName: rustRefTypeName(variant.$ref, ctx.definitions), }); continue; @@ -329,7 +328,8 @@ function tryEmitRustUnion( if (!isObjectSchema(resolved)) { if (!isAllowedUnionType) return null; resolvedVariants.push({ - schema: resolved as JSONSchema7, + schema: resolved as @ + JSONSchema7, typeName: resolveRustType( resolved as JSONSchema7, enumName,