Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,18 @@
"request": "launch",
"args": ["--extensionDevelopmentPath=${workspaceFolder}/packages/cadl-vscode"],
"env": {
"CADL_DEVELOPMENT_MODE": "true",
"CADL_SERVER_NODE_OPTIONS": "--nolazy --inspect-brk=4242"
// Log elapsed time for each call to server.
//"CADL_SERVER_LOG_TIMING": "true",

// Save .cpuprofile for last run of each server function here
// NOTE: This will add a lot of lag so don't trust logged timing if also enabled above.
//"CADL_SERVER_PROFILE_DIR": "${workspaceRoot}/temp",

// Use empty node options and don't debug while profiling to get the most accurate timing
//"CADL_SERVER_NODE_OPTIONS": "",

"CADL_SERVER_NODE_OPTIONS": "--nolazy --inspect-brk=4242",
"CADL_DEVELOPMENT_MODE": "true"
},
"presentation": {
"hidden": true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@cadl-lang/compiler",
"comment": "Perf: Reuse unchanged files and programs in language server.",
"type": "minor"
}
],
"packageName": "@cadl-lang/compiler"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@cadl-lang/versioning",
"comment": "",
"type": "none"
}
],
"packageName": "@cadl-lang/versioning"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "cadl-vscode",
"comment": "",
"type": "none"
}
],
"packageName": "cadl-vscode"
}
2 changes: 1 addition & 1 deletion packages/cadl-vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async function resolveCadlServer(context: ExtensionContext): Promise<Executable>
const script = context.asAbsolutePath("../compiler/dist/server/server.js");
// we use CLI instead of NODE_OPTIONS environment variable in this case
// because --nolazy is not supported by NODE_OPTIONS.
const options = nodeOptions?.split(" ") ?? [];
const options = nodeOptions?.split(" ").filter((o) => o) ?? [];
return { command: "node", args: [...options, script, ...args] };
}

Expand Down
6 changes: 3 additions & 3 deletions packages/compiler/config/config-loader.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import jsyaml from "js-yaml";
import { getDirectoryPath, joinPaths, resolvePath } from "../core/path-utils.js";
import { SchemaValidator } from "../core/schema-validator.js";
import { createJSONSchemaValidator } from "../core/schema-validator.js";
import { CompilerHost, Diagnostic } from "../core/types.js";
import { deepClone, deepFreeze, doIO, loadFile } from "../core/util.js";
import { CadlConfigJsonSchema } from "./config-schema.js";
import { CadlConfig } from "./types.js";

export const CadlConfigFilename = "cadl-project.yaml";

const defaultConfig: CadlConfig = deepFreeze({
export const defaultConfig: CadlConfig = deepFreeze({
diagnostics: [],
emitters: {},
});
Expand Down Expand Up @@ -88,7 +88,7 @@ export async function loadCadlConfigFile(
};
}

const configValidator = new SchemaValidator(CadlConfigJsonSchema);
const configValidator = createJSONSchemaValidator(CadlConfigJsonSchema);

async function loadConfigFile(
host: CompilerHost,
Expand Down
Loading