Skip to content

Commit

Permalink
Merge branch 'generateSDK' of https://github.com/chunyu3/typespec int…
Browse files Browse the repository at this point in the history
…o generateSDK
  • Loading branch information
chunyu3 committed Dec 19, 2024
2 parents 6f49c5f + 9105874 commit bae77bb
Show file tree
Hide file tree
Showing 10 changed files with 216 additions and 238 deletions.
107 changes: 35 additions & 72 deletions packages/typespec-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"default": "off",
"description": "Define whether/how the TypeSpec language server should send traces to client. For the traces to show properly in vscode Output, make sure 'Log Level' is also set to 'Trace' so that they won't be filtered at client side, which can be set through 'Developer: Set Log Level...' command."
},
"typespec.client.emitter": {
"typespec.emitters": {
"scope": "window",
"type": "array",
"items": {
Expand All @@ -122,99 +122,65 @@
"Java",
"JavaScript",
"Python",
"Go"
"Go",
"OpenAPI3",
"ProtoBuf",
"JsonSchema"
],
"description": "Define the language the emitter will emit."
},
"package": {
"type": "string",
"description": "Define the emitter package.\n\nExample (with version): @typespec/[email protected]\n\nExample (without version): @typespec/http-client-csharp"
},
"kind": {
"type": "string",
"enum": [
"client",
"server",
"schema"
],
"description": "Define the emitter kind."
}
}
},
"default": [
{
"language": "DotNet",
"package": "@typespec/http-client-csharp"
"package": "@typespec/http-client-csharp",
"kind": "client"
},
{
"language": "Java",
"package": "@typespec/http-client-java"
"package": "@typespec/http-client-java",
"kind": "client"
},
{
"language": "JavaScript",
"package": "@azure-tools/typespec-ts"
"package": "@azure-tools/typespec-ts",
"kind": "client"
},
{
"language": "Python",
"package": "@typespec/http-client-python"
}
],
"description": "Define the emitter for a language client sdk generation."
},
"typespec.server.emitter": {
"scope": "window",
"type": "array",
"items": {
"type": "object",
"properties": {
"language": {
"type": "string",
"enum": [
"DotNet",
"Java",
"JavaScript",
"Python",
"Go"
],
"description": "Define the language for the emitter."
},
"package": {
"type": "string",
"description": "Define the emitter package.\n\nExample (with version): @typespec/[email protected]\n\nExample (without version): @typespec/http-server-csharp"
}
}
},
"default": [
"package": "@typespec/http-client-python",
"kind": "client"
},
{
"language": "DotNet",
"package": "@typespec/http-server-csharp"
"package": "@typespec/http-server-csharp",
"kind": "server"
},
{
"language": "JavaScript",
"package": "@typespec/http-server-javascript"
}
],
"description": "Define the emitter for server code generation."
},
"typespec.schema.emitter": {
"scope": "window",
"type": "array",
"items": {
"type": "object",
"properties": {
"language": {
"type": "string",
"enum": [
"OpenAPI3",
"ProtoBuf",
"JsonSchema"
],
"description": "Define the language for the emitter."
},
"package": {
"type": "string",
"description": "Define the emitter package.\n\nExample (with version): @typespec/[email protected]\n\nExample (without version): @typespec/openapi3"
}
}
},
"default": [
"package": "@typespec/http-server-javascript",
"kind": "server"
},
{
"language": "OpenAPI3",
"package": "@typespec/openapi3"
"package": "@typespec/openapi3",
"kind": "schema"
}
],
"description": "Define the emitter for a schema."
]
}
}
}
Expand Down Expand Up @@ -249,8 +215,8 @@
"category": "TypeSpec"
},
{
"command": "typespec.emit",
"title": "TypeSpec: Emit Code",
"command": "typespec.generate",
"title": "Generate from TypeSpec",
"category": "TypeSpec"
},
{
Expand All @@ -267,14 +233,14 @@
"menus": {
"explorer/context": [
{
"command": "typespec.emit",
"command": "typespec.generate",
"when": "explorerResourceIsFolder || resourceLangId == typespec",
"group": "code_generation"
}
],
"editor/context": [
{
"command": "typespec.emit",
"command": "typespec.generate",
"when": "resourceLangId == typespec",
"group": "code_generation"
}
Expand Down Expand Up @@ -336,9 +302,6 @@
"test:e2e": "pnpm test:web",
"test:web": "vscode-test-web --extensionDevelopmentPath=. --headless --extensionTestsPath=dist/test/web/suite.js ./test/web/data"
},
"dependencies": {
"@typespec/compiler": "workspace:~"
},
"devDependencies": {
"@rollup/plugin-commonjs": "~28.0.0",
"@rollup/plugin-node-resolve": "~15.3.0",
Expand Down
8 changes: 0 additions & 8 deletions packages/typespec-vscode/src/const.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
import { SettingName } from "./types.js";

export const EmitterSettingName: Record<string, string> = {
client: SettingName.ClientEmitter,
server: SettingName.ServerEmitter,
schema: SettingName.SchemaEmitter,
};

export const StartFileName = "main.tsp";
Loading

0 comments on commit bae77bb

Please sign in to comment.