@typespec/compiler 1.18.0-dev.4 → 1.18.0-dev.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated-defs/TypeSpec.d.ts +69 -1
- package/dist/generated-defs/TypeSpec.d.ts.map +1 -1
- package/dist/manifest.js +2 -2
- package/dist/src/config/config-to-options.d.ts +2 -0
- package/dist/src/config/config-to-options.d.ts.map +1 -1
- package/dist/src/config/config-to-options.js.map +1 -1
- package/dist/src/config/types.d.ts +26 -1
- package/dist/src/config/types.d.ts.map +1 -1
- package/dist/src/core/checker.d.ts +23 -0
- package/dist/src/core/checker.d.ts.map +1 -1
- package/dist/src/core/checker.js +7 -0
- package/dist/src/core/checker.js.map +1 -1
- package/dist/src/core/code-fixes.d.ts +6 -0
- package/dist/src/core/code-fixes.d.ts.map +1 -1
- package/dist/src/core/code-fixes.js +6 -0
- package/dist/src/core/code-fixes.js.map +1 -1
- package/dist/src/core/compiler-code-fixes/suppress.codefix.d.ts +7 -0
- package/dist/src/core/compiler-code-fixes/suppress.codefix.d.ts.map +1 -1
- package/dist/src/core/compiler-code-fixes/suppress.codefix.js +7 -0
- package/dist/src/core/compiler-code-fixes/suppress.codefix.js.map +1 -1
- package/dist/src/core/decorator-utils.d.ts +17 -0
- package/dist/src/core/decorator-utils.d.ts.map +1 -1
- package/dist/src/core/decorator-utils.js +5 -0
- package/dist/src/core/decorator-utils.js.map +1 -1
- package/dist/src/core/diagnostics.d.ts +9 -0
- package/dist/src/core/diagnostics.d.ts.map +1 -1
- package/dist/src/core/diagnostics.js +2 -0
- package/dist/src/core/diagnostics.js.map +1 -1
- package/dist/src/core/emitter-utils.d.ts +5 -0
- package/dist/src/core/emitter-utils.d.ts.map +1 -1
- package/dist/src/core/emitter-utils.js.map +1 -1
- package/dist/src/core/file-ref.d.ts +2 -0
- package/dist/src/core/file-ref.d.ts.map +1 -1
- package/dist/src/core/file-ref.js +1 -0
- package/dist/src/core/file-ref.js.map +1 -1
- package/dist/src/core/helpers/discriminator-utils.d.ts +14 -0
- package/dist/src/core/helpers/discriminator-utils.d.ts.map +1 -1
- package/dist/src/core/helpers/discriminator-utils.js +5 -0
- package/dist/src/core/helpers/discriminator-utils.js.map +1 -1
- package/dist/src/core/helpers/location-context.d.ts +1 -0
- package/dist/src/core/helpers/location-context.d.ts.map +1 -1
- package/dist/src/core/helpers/location-context.js +1 -0
- package/dist/src/core/helpers/location-context.js.map +1 -1
- package/dist/src/core/helpers/operation-utils.d.ts +1 -0
- package/dist/src/core/helpers/operation-utils.d.ts.map +1 -1
- package/dist/src/core/helpers/operation-utils.js.map +1 -1
- package/dist/src/core/helpers/type-name-utils.d.ts +7 -0
- package/dist/src/core/helpers/type-name-utils.d.ts.map +1 -1
- package/dist/src/core/helpers/type-name-utils.js +3 -0
- package/dist/src/core/helpers/type-name-utils.js.map +1 -1
- package/dist/src/core/helpers/usage-resolver.d.ts +9 -0
- package/dist/src/core/helpers/usage-resolver.d.ts.map +1 -1
- package/dist/src/core/helpers/usage-resolver.js +4 -0
- package/dist/src/core/helpers/usage-resolver.js.map +1 -1
- package/dist/src/core/intrinsic-type-state.d.ts +44 -17
- package/dist/src/core/intrinsic-type-state.d.ts.map +1 -1
- package/dist/src/core/intrinsic-type-state.js +41 -17
- package/dist/src/core/intrinsic-type-state.js.map +1 -1
- package/dist/src/core/library.d.ts +2 -0
- package/dist/src/core/library.d.ts.map +1 -1
- package/dist/src/core/library.js +2 -0
- package/dist/src/core/library.js.map +1 -1
- package/dist/src/core/logger/console-sink.d.ts +4 -0
- package/dist/src/core/logger/console-sink.d.ts.map +1 -1
- package/dist/src/core/logger/console-sink.js +1 -0
- package/dist/src/core/logger/console-sink.js.map +1 -1
- package/dist/src/core/numeric.d.ts +11 -1
- package/dist/src/core/numeric.d.ts.map +1 -1
- package/dist/src/core/numeric.js.map +1 -1
- package/dist/src/core/options.d.ts +8 -2
- package/dist/src/core/options.d.ts.map +1 -1
- package/dist/src/core/param-message.d.ts +9 -0
- package/dist/src/core/param-message.d.ts.map +1 -1
- package/dist/src/core/param-message.js +9 -0
- package/dist/src/core/param-message.js.map +1 -1
- package/dist/src/core/parser.d.ts +19 -0
- package/dist/src/core/parser.d.ts.map +1 -1
- package/dist/src/core/parser.js +18 -0
- package/dist/src/core/parser.js.map +1 -1
- package/dist/src/core/path-utils.d.ts +24 -0
- package/dist/src/core/path-utils.d.ts.map +1 -1
- package/dist/src/core/path-utils.js +9 -1
- package/dist/src/core/path-utils.js.map +1 -1
- package/dist/src/core/perf.d.ts +8 -1
- package/dist/src/core/perf.d.ts.map +1 -1
- package/dist/src/core/perf.js +8 -1
- package/dist/src/core/perf.js.map +1 -1
- package/dist/src/core/program.d.ts +31 -1
- package/dist/src/core/program.d.ts.map +1 -1
- package/dist/src/core/program.js +5 -0
- package/dist/src/core/program.js.map +1 -1
- package/dist/src/core/semantic-walker.d.ts +20 -5
- package/dist/src/core/semantic-walker.d.ts.map +1 -1
- package/dist/src/core/semantic-walker.js +13 -3
- package/dist/src/core/semantic-walker.js.map +1 -1
- package/dist/src/core/source-file.d.ts +2 -0
- package/dist/src/core/source-file.d.ts.map +1 -1
- package/dist/src/core/source-file.js +2 -0
- package/dist/src/core/source-file.js.map +1 -1
- package/dist/src/core/type-utils.d.ts +8 -0
- package/dist/src/core/type-utils.d.ts.map +1 -1
- package/dist/src/core/type-utils.js +8 -0
- package/dist/src/core/type-utils.js.map +1 -1
- package/dist/src/core/types.d.ts +1004 -46
- package/dist/src/core/types.d.ts.map +1 -1
- package/dist/src/core/types.js +130 -5
- package/dist/src/core/types.js.map +1 -1
- package/dist/src/experimental/mutators.d.ts +32 -3
- package/dist/src/experimental/mutators.d.ts.map +1 -1
- package/dist/src/experimental/mutators.js +11 -3
- package/dist/src/experimental/mutators.js.map +1 -1
- package/dist/src/experimental/realm.d.ts +34 -1
- package/dist/src/experimental/realm.d.ts.map +1 -1
- package/dist/src/experimental/realm.js +34 -1
- package/dist/src/experimental/realm.js.map +1 -1
- package/dist/src/init/core-templates.d.ts +3 -0
- package/dist/src/init/core-templates.d.ts.map +1 -1
- package/dist/src/init/core-templates.js.map +1 -1
- package/dist/src/init/init-template.d.ts +9 -0
- package/dist/src/init/init-template.d.ts.map +1 -1
- package/dist/src/init/init-template.js.map +1 -1
- package/dist/src/init/scaffold.d.ts +1 -0
- package/dist/src/init/scaffold.d.ts.map +1 -1
- package/dist/src/init/scaffold.js.map +1 -1
- package/dist/src/init/template-source/types.d.ts +2 -0
- package/dist/src/init/template-source/types.d.ts.map +1 -1
- package/dist/src/init/template-source/types.js.map +1 -1
- package/dist/src/lib/decorators.d.ts +84 -2
- package/dist/src/lib/decorators.d.ts.map +1 -1
- package/dist/src/lib/decorators.js +71 -7
- package/dist/src/lib/decorators.js.map +1 -1
- package/dist/src/lib/encoded-names.d.ts +4 -0
- package/dist/src/lib/encoded-names.d.ts.map +1 -1
- package/dist/src/lib/encoded-names.js +4 -0
- package/dist/src/lib/encoded-names.js.map +1 -1
- package/dist/src/lib/examples.d.ts +29 -2
- package/dist/src/lib/examples.d.ts.map +1 -1
- package/dist/src/lib/examples.js +25 -2
- package/dist/src/lib/examples.js.map +1 -1
- package/dist/src/lib/key.d.ts +2 -0
- package/dist/src/lib/key.d.ts.map +1 -1
- package/dist/src/lib/key.js +2 -0
- package/dist/src/lib/key.js.map +1 -1
- package/dist/src/lib/paging.d.ts +27 -0
- package/dist/src/lib/paging.d.ts.map +1 -1
- package/dist/src/lib/paging.js +7 -0
- package/dist/src/lib/paging.js.map +1 -1
- package/dist/src/lib/service.d.ts +9 -2
- package/dist/src/lib/service.d.ts.map +1 -1
- package/dist/src/lib/service.js +5 -2
- package/dist/src/lib/service.js.map +1 -1
- package/dist/src/lib/visibility.d.ts +44 -10
- package/dist/src/lib/visibility.d.ts.map +1 -1
- package/dist/src/lib/visibility.js +42 -10
- package/dist/src/lib/visibility.js.map +1 -1
- package/dist/src/manifest.d.ts +2 -0
- package/dist/src/manifest.d.ts.map +1 -1
- package/dist/src/manifest.js +1 -0
- package/dist/src/manifest.js.map +1 -1
- package/dist/src/module-resolver/module-resolver.d.ts +12 -1
- package/dist/src/module-resolver/module-resolver.d.ts.map +1 -1
- package/dist/src/module-resolver/module-resolver.js +7 -1
- package/dist/src/module-resolver/module-resolver.js.map +1 -1
- package/dist/src/module-resolver/types.d.ts +14 -1
- package/dist/src/module-resolver/types.d.ts.map +1 -1
- package/dist/src/server/client-config-provider.d.ts +14 -0
- package/dist/src/server/client-config-provider.d.ts.map +1 -1
- package/dist/src/server/client-config-provider.js.map +1 -1
- package/dist/src/server/server-compile-manager.d.ts +30 -4
- package/dist/src/server/server-compile-manager.d.ts.map +1 -1
- package/dist/src/server/server-compile-manager.js +21 -0
- package/dist/src/server/server-compile-manager.js.map +1 -1
- package/dist/src/server/serverlib.d.ts +9 -0
- package/dist/src/server/serverlib.d.ts.map +1 -1
- package/dist/src/server/serverlib.js +9 -0
- package/dist/src/server/serverlib.js.map +1 -1
- package/dist/src/server/types.d.ts +133 -0
- package/dist/src/server/types.d.ts.map +1 -1
- package/dist/src/server/types.js +26 -0
- package/dist/src/server/types.js.map +1 -1
- package/dist/src/server/update-manager.d.ts +24 -7
- package/dist/src/server/update-manager.d.ts.map +1 -1
- package/dist/src/server/update-manager.js +16 -7
- package/dist/src/server/update-manager.js.map +1 -1
- package/dist/src/testing/code-fix-testing.d.ts +2 -0
- package/dist/src/testing/code-fix-testing.d.ts.map +1 -1
- package/dist/src/testing/code-fix-testing.js.map +1 -1
- package/dist/src/testing/expect.d.ts +16 -10
- package/dist/src/testing/expect.d.ts.map +1 -1
- package/dist/src/testing/expect.js +9 -3
- package/dist/src/testing/expect.js.map +1 -1
- package/dist/src/testing/fourslash.d.ts +3 -3
- package/dist/src/testing/fourslash.d.ts.map +1 -1
- package/dist/src/testing/fs.d.ts +4 -0
- package/dist/src/testing/fs.d.ts.map +1 -1
- package/dist/src/testing/fs.js +4 -0
- package/dist/src/testing/fs.js.map +1 -1
- package/dist/src/testing/marked-template.d.ts +25 -2
- package/dist/src/testing/marked-template.d.ts.map +1 -1
- package/dist/src/testing/marked-template.js +7 -2
- package/dist/src/testing/marked-template.js.map +1 -1
- package/dist/src/testing/rule-tester.d.ts +22 -0
- package/dist/src/testing/rule-tester.d.ts.map +1 -1
- package/dist/src/testing/rule-tester.js +9 -0
- package/dist/src/testing/rule-tester.js.map +1 -1
- package/dist/src/testing/source-utils.d.ts +7 -2
- package/dist/src/testing/source-utils.d.ts.map +1 -1
- package/dist/src/testing/source-utils.js +2 -2
- package/dist/src/testing/source-utils.js.map +1 -1
- package/dist/src/testing/test-compiler-host.d.ts +8 -0
- package/dist/src/testing/test-compiler-host.d.ts.map +1 -1
- package/dist/src/testing/test-compiler-host.js +4 -0
- package/dist/src/testing/test-compiler-host.js.map +1 -1
- package/dist/src/testing/test-host.d.ts +4 -0
- package/dist/src/testing/test-host.d.ts.map +1 -1
- package/dist/src/testing/test-host.js +4 -0
- package/dist/src/testing/test-host.js.map +1 -1
- package/dist/src/testing/test-utils.d.ts +14 -2
- package/dist/src/testing/test-utils.d.ts.map +1 -1
- package/dist/src/testing/test-utils.js +9 -0
- package/dist/src/testing/test-utils.js.map +1 -1
- package/dist/src/testing/tester.d.ts +12 -0
- package/dist/src/testing/tester.d.ts.map +1 -1
- package/dist/src/testing/tester.js +7 -0
- package/dist/src/testing/tester.js.map +1 -1
- package/dist/src/testing/types.d.ts +101 -36
- package/dist/src/testing/types.d.ts.map +1 -1
- package/dist/src/testing/types.js +4 -1
- package/dist/src/testing/types.js.map +1 -1
- package/dist/src/typekit/define-kit.d.ts +6 -0
- package/dist/src/typekit/define-kit.d.ts.map +1 -1
- package/dist/src/typekit/define-kit.js.map +1 -1
- package/dist/src/typekit/kits/array.d.ts +3 -0
- package/dist/src/typekit/kits/array.d.ts.map +1 -1
- package/dist/src/typekit/kits/array.js.map +1 -1
- package/dist/src/typekit/kits/builtin.d.ts +3 -0
- package/dist/src/typekit/kits/builtin.d.ts.map +1 -1
- package/dist/src/typekit/kits/builtin.js.map +1 -1
- package/dist/src/typekit/kits/entity.d.ts +3 -0
- package/dist/src/typekit/kits/entity.d.ts.map +1 -1
- package/dist/src/typekit/kits/entity.js.map +1 -1
- package/dist/src/typekit/kits/enum-member.d.ts +3 -0
- package/dist/src/typekit/kits/enum-member.d.ts.map +1 -1
- package/dist/src/typekit/kits/enum-member.js.map +1 -1
- package/dist/src/typekit/kits/enum.d.ts +3 -0
- package/dist/src/typekit/kits/enum.d.ts.map +1 -1
- package/dist/src/typekit/kits/enum.js.map +1 -1
- package/dist/src/typekit/kits/intrinsic.d.ts +5 -0
- package/dist/src/typekit/kits/intrinsic.d.ts.map +1 -1
- package/dist/src/typekit/kits/intrinsic.js.map +1 -1
- package/dist/src/typekit/kits/model.d.ts +4 -0
- package/dist/src/typekit/kits/model.d.ts.map +1 -1
- package/dist/src/typekit/kits/model.js.map +1 -1
- package/dist/src/typekit/kits/record.d.ts +3 -0
- package/dist/src/typekit/kits/record.d.ts.map +1 -1
- package/dist/src/typekit/kits/record.js.map +1 -1
- package/dist/src/typekit/kits/scalar.d.ts +1 -1
- package/dist/src/typekit/kits/tuple.d.ts +5 -0
- package/dist/src/typekit/kits/tuple.d.ts.map +1 -1
- package/dist/src/typekit/kits/tuple.js.map +1 -1
- package/dist/src/typekit/kits/type.d.ts +5 -0
- package/dist/src/typekit/kits/type.d.ts.map +1 -1
- package/dist/src/typekit/kits/type.js.map +1 -1
- package/dist/src/typekit/kits/value.d.ts +8 -0
- package/dist/src/typekit/kits/value.d.ts.map +1 -1
- package/dist/src/typekit/kits/value.js.map +1 -1
- package/dist/src/types/package-json.d.ts +30 -0
- package/dist/src/types/package-json.d.ts.map +1 -1
- package/dist/src/utils/misc.d.ts +6 -0
- package/dist/src/utils/misc.d.ts.map +1 -1
- package/dist/src/utils/misc.js +6 -0
- package/dist/src/utils/misc.js.map +1 -1
- package/dist/src/utils/state-accessor.d.ts +10 -0
- package/dist/src/utils/state-accessor.d.ts.map +1 -1
- package/dist/src/utils/state-accessor.js +5 -0
- package/dist/src/utils/state-accessor.js.map +1 -1
- package/dist/src/yaml/types.d.ts +3 -0
- package/dist/src/yaml/types.d.ts.map +1 -1
- package/lib/std/decorators.tsp +16 -3
- package/lib/std/visibility.tsp +14 -0
- package/package.json +1 -1
|
@@ -7,135 +7,268 @@ import type { LoadedCoreTemplates } from "../init/core-templates.js";
|
|
|
7
7
|
import type { EmitterTemplate, InitTemplate, InitTemplateLibrarySpec } from "../init/init-template.js";
|
|
8
8
|
import type { ScaffoldingConfig } from "../init/scaffold.js";
|
|
9
9
|
import type { CompileTracker, ServerCompileOptions } from "./server-compile-manager.js";
|
|
10
|
+
/** Severity or verbosity assigned to a message delivered to the server host. */
|
|
10
11
|
export type ServerLogLevel = "trace" | "debug" | "info" | "warning" | "error";
|
|
12
|
+
/** A server message with optional structured context for the host's logging implementation. */
|
|
11
13
|
export interface ServerLog {
|
|
14
|
+
/** Severity or verbosity of this message; filtering is left to the host. */
|
|
12
15
|
level: ServerLogLevel;
|
|
16
|
+
/** Human-readable message, without a separately formatted severity prefix. */
|
|
13
17
|
message: string;
|
|
18
|
+
/** Additional context, such as an error or configuration object; not necessarily a string. */
|
|
14
19
|
detail?: unknown;
|
|
15
20
|
}
|
|
21
|
+
/** Environment and client callbacks needed to embed the TypeSpec language server. */
|
|
16
22
|
export interface ServerHost {
|
|
23
|
+
/** Base compiler I/O host; the server wraps it to read open documents and cache files. */
|
|
17
24
|
readonly compilerHost: CompilerHost;
|
|
25
|
+
/** Rethrow unexpected compilation errors instead of publishing error diagnostics. Defaults to false. */
|
|
18
26
|
readonly throwInternalErrors?: boolean;
|
|
27
|
+
/** Look up the current open document by its original URI; return undefined for closed documents. */
|
|
19
28
|
readonly getOpenDocumentByURL: (url: string) => TextDocument | undefined;
|
|
29
|
+
/** Publish diagnostics to the client, including empty lists that clear previously reported diagnostics. */
|
|
20
30
|
readonly sendDiagnostics: (params: PublishDiagnosticsParams) => void;
|
|
31
|
+
/** Receive server messages for display, persistence, or filtering by the embedding application. */
|
|
21
32
|
readonly log: (log: ServerLog) => void;
|
|
33
|
+
/** Ask the client to apply a workspace edit, for example to repair imports after a file rename. */
|
|
22
34
|
readonly applyEdit: (paramOrEdit: ApplyWorkspaceEditParams | WorkspaceEdit) => Promise<ApplyWorkspaceEditResult>;
|
|
23
35
|
}
|
|
36
|
+
/** Program and document context produced by a language-server compilation. */
|
|
24
37
|
export interface CompileResult {
|
|
38
|
+
/** Compiled project, which may include more files than the requested document. */
|
|
25
39
|
readonly program: Program;
|
|
40
|
+
/** Requested open document, if available; this is a host-owned document, not a cloned text snapshot. */
|
|
26
41
|
readonly document: TextDocument | undefined;
|
|
42
|
+
/** AST for the requested path within the program; absent when that path is not a compiled TypeSpec file. */
|
|
27
43
|
readonly script: TypeSpecScriptNode | undefined;
|
|
44
|
+
/** Resolved project configuration before server defaults, client settings, and additional options are applied. */
|
|
28
45
|
readonly optionsFromConfig: CompilerOptions;
|
|
46
|
+
/** Compilation metadata, captured logs, and freshness checks against the server's current change version. */
|
|
29
47
|
readonly tracker: CompileTracker;
|
|
30
48
|
}
|
|
49
|
+
/** Compiler diagnostic returned by the custom compilation request, with source information when available. */
|
|
31
50
|
export interface ServerDiagnostic extends Diagnostic {
|
|
51
|
+
/**
|
|
52
|
+
* Source information when available. Check for a source file before reading offsets,
|
|
53
|
+
* and honor isSynthetic when interpreting the location. Checking only for NoTarget
|
|
54
|
+
* does not establish that source fields are available.
|
|
55
|
+
*/
|
|
32
56
|
target: (SourceLocation & {
|
|
57
|
+
/** Human-readable start position when the diagnostic has an associated source file. */
|
|
33
58
|
position?: {
|
|
59
|
+
/** One-based line number, unlike the zero-based positions used by LSP. */
|
|
34
60
|
line: number;
|
|
61
|
+
/** One-based character offset within the line. */
|
|
35
62
|
column: number;
|
|
36
63
|
};
|
|
37
64
|
}) | typeof NoTarget;
|
|
38
65
|
}
|
|
66
|
+
/** Result of the custom compilation request, which bypasses server compilation caches. */
|
|
39
67
|
export interface InternalCompileResult {
|
|
68
|
+
/** Whether the program has errors, or compilation failed to produce a result. */
|
|
40
69
|
readonly hasError: boolean;
|
|
70
|
+
/** Compiler diagnostics, or an internal-error diagnostic if no compilation result was obtained. */
|
|
41
71
|
readonly diagnostics: ServerDiagnostic[];
|
|
72
|
+
/** URI of the result's open document, if available; not necessarily the inferred project entry point. */
|
|
42
73
|
readonly entrypoint?: string;
|
|
74
|
+
/** Effective options used by the returned program; absent when no compilation result was obtained. */
|
|
43
75
|
readonly options?: CompilerOptions;
|
|
44
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Language-server handlers and state for an embedding host to connect to LSP.
|
|
79
|
+
* Initialize the server before enabling document-update processing with {@link Server.initialized}.
|
|
80
|
+
*/
|
|
45
81
|
export interface Server {
|
|
82
|
+
/** Messages queued before initialized; the queue is flushed through the host when logging resumes. */
|
|
46
83
|
readonly pendingMessages: readonly ServerLog[];
|
|
84
|
+
/** Current workspace folders, including normalized paths used for project discovery. */
|
|
47
85
|
readonly workspaceFolders: readonly ServerWorkspaceFolder[];
|
|
86
|
+
/**
|
|
87
|
+
* Compile the inferred project containing a document, falling back to the document itself
|
|
88
|
+
* if it is not included. Additional options override server defaults and resolved configuration.
|
|
89
|
+
* Returns undefined for unsupported documents, unresolved entry points, cancelled or stale
|
|
90
|
+
* requests, or handled compilation failures.
|
|
91
|
+
*/
|
|
48
92
|
compile(document: TextDocument | TextDocumentIdentifier, additionalOptions: CompilerOptions | undefined, serverCompileOptions: ServerCompileOptions): Promise<CompileResult | undefined>;
|
|
93
|
+
/** Configure workspace roots and update callbacks, and return LSP and TypeSpec-specific capabilities. */
|
|
49
94
|
initialize(params: InitializeParams): Promise<InitializeResult>;
|
|
95
|
+
/** Enable debounced updates and flush queued log messages after client initialization completes. */
|
|
50
96
|
initialized(params: InitializedParams): void;
|
|
97
|
+
/** Apply added and removed workspace folders, resolving normalized paths for newly added roots. */
|
|
51
98
|
workspaceFoldersChanged(e: WorkspaceFoldersChangeEvent): Promise<void>;
|
|
99
|
+
/** Invalidate file and package caches for the client's watched-file change notifications. */
|
|
52
100
|
watchedFilesChanged(params: DidChangeWatchedFilesParams): void;
|
|
101
|
+
/** Format an open TypeSpec document using Prettier configuration, falling back to the client's indentation options. */
|
|
53
102
|
formatDocument(params: DocumentFormattingParams): Promise<TextEdit[]>;
|
|
103
|
+
/**
|
|
104
|
+
* Resolve a symbol's declarations or an import's target file.
|
|
105
|
+
* Returns an empty list when document analysis is unavailable or the position has no definition.
|
|
106
|
+
* Import lookup requires a resolvable target and rejects if module resolution fails.
|
|
107
|
+
*/
|
|
54
108
|
gotoDefinition(params: DefinitionParams): Promise<Location[]>;
|
|
109
|
+
/** Compute completion items at the requested position, including configuration-file completions. */
|
|
55
110
|
complete(params: CompletionParams): Promise<CompletionList>;
|
|
111
|
+
/** Find references to the selected symbol across the compiled program's source files. */
|
|
56
112
|
findReferences(params: ReferenceParams): Promise<Location[]>;
|
|
113
|
+
/** Find occurrences of the selected symbol within the requested document, marked as read highlights. */
|
|
57
114
|
findDocumentHighlight(params: DocumentHighlightParams): Promise<DocumentHighlight[]>;
|
|
115
|
+
/** Return the selected identifier's rename range, or undefined when no identifier can be renamed. */
|
|
58
116
|
prepareRename(params: PrepareRenameParams): Promise<Range | undefined>;
|
|
117
|
+
/** Build edits renaming references to the selected identifier; applying them is the caller's responsibility. */
|
|
59
118
|
rename(params: RenameParams): Promise<WorkspaceEdit>;
|
|
119
|
+
/** Process renamed files or folders, schedule recompilation, and ask the host to apply import-path repairs. */
|
|
60
120
|
renameFiles(params: RenameFilesParams): Promise<void>;
|
|
121
|
+
/** Classify TypeSpec source into tokens with absolute source offsets rather than LSP-encoded positions. */
|
|
61
122
|
getSemanticTokens(params: SemanticTokensParams): Promise<SemanticToken[]>;
|
|
123
|
+
/** Encode classified tokens as LSP semantic-token data using the legend advertised during initialization. */
|
|
62
124
|
buildSemanticTokens(params: SemanticTokensParams): Promise<SemanticTokens>;
|
|
125
|
+
/** Schedule diagnostics for a changed document, ignoring the initial change notification accompanying an open. */
|
|
63
126
|
checkChange(change: TextDocumentChangeEvent<TextDocument>): void;
|
|
127
|
+
/** Describe the symbol at the requested position; return empty contents when no description is available. */
|
|
64
128
|
getHover(params: HoverParams): Promise<Hover>;
|
|
129
|
+
/** Return debounced template or decorator signature help, or undefined for superseded requests or unsupported positions. */
|
|
65
130
|
getSignatureHelp(params: SignatureHelpParams): Promise<SignatureHelp | undefined>;
|
|
131
|
+
/** Compute multiline folding regions for comments, consecutive imports, decorators, and syntax nodes. */
|
|
66
132
|
getFoldingRanges(getFoldingRanges: FoldingRangeParams): Promise<FoldingRange[]>;
|
|
133
|
+
/** Build the hierarchical symbol outline for a TypeSpec document. */
|
|
67
134
|
getDocumentSymbols(params: DocumentSymbolParams): Promise<DocumentSymbol[]>;
|
|
135
|
+
/** Forget the document's opening version and clear its published diagnostics. */
|
|
68
136
|
documentClosed(change: TextDocumentChangeEvent<TextDocument>): void;
|
|
137
|
+
/** Record a document's opening version and schedule its initial diagnostics. */
|
|
69
138
|
documentOpened(change: TextDocumentChangeEvent<TextDocument>): void;
|
|
139
|
+
/** Offer unresolved quick fixes for published diagnostics, including file-wide fixes when applicable. */
|
|
70
140
|
getCodeActions(params: CodeActionParams): Promise<CodeAction[]>;
|
|
141
|
+
/** Populate a previously offered code action's edit from the current diagnostic index. */
|
|
71
142
|
resolveCodeAction(codeAction: CodeAction): Promise<CodeAction>;
|
|
143
|
+
/**
|
|
144
|
+
* Publish diagnostics for the result's open documents and clear stale diagnostics for files without errors.
|
|
145
|
+
* Does nothing when the result has no open document or that document is tspconfig.yaml.
|
|
146
|
+
*/
|
|
72
147
|
reportDiagnostics({ program, document, optionsFromConfig }: CompileResult): void;
|
|
148
|
+
/** Queue a message before initialized; afterwards flush queued messages and deliver it to the host. */
|
|
73
149
|
log(log: ServerLog): void;
|
|
150
|
+
/** Load the built-in project templates used by the editor's project-creation workflow. */
|
|
74
151
|
getInitProjectContext(): Promise<InitProjectContext>;
|
|
152
|
+
/** Validate a project template against the relaxed template schema, logging any validation diagnostics. */
|
|
75
153
|
validateInitProjectTemplate(param: {
|
|
154
|
+
/** Template definition selected or supplied by the client. */
|
|
76
155
|
template: InitTemplate;
|
|
77
156
|
}): Promise<boolean>;
|
|
157
|
+
/** Scaffold a project using the supplied configuration; log unexpected failures and return false on failure. */
|
|
78
158
|
initProject(param: {
|
|
159
|
+
/** Resolved project location, template, and user inputs used for scaffolding. */
|
|
79
160
|
config: InitProjectConfig;
|
|
80
161
|
}): Promise<boolean>;
|
|
162
|
+
/** Run a full compilation without reusing cached compilations or old programs, forwarding captured compiler logs to the host. */
|
|
81
163
|
internalCompile(param: {
|
|
164
|
+
/** Document used to infer the project to compile. */
|
|
82
165
|
doc: TextDocumentIdentifier;
|
|
166
|
+
/** Compiler options overriding the resolved project and server defaults. */
|
|
83
167
|
options: CompilerOptions;
|
|
84
168
|
}): Promise<InternalCompileResult>;
|
|
85
169
|
}
|
|
170
|
+
/** Compiler source file that may have been read from an open editor document instead of disk. */
|
|
86
171
|
export interface ServerSourceFile extends SourceFile {
|
|
172
|
+
/** Open document associated with this file when it was read; absent for files read from disk. */
|
|
87
173
|
readonly document?: TextDocument;
|
|
88
174
|
}
|
|
175
|
+
/** Workspace root paired with its normalized local path. */
|
|
89
176
|
export interface ServerWorkspaceFolder extends WorkspaceFolder {
|
|
177
|
+
/** Resolved, normalized path with a trailing separator, suitable for directory-prefix comparisons. */
|
|
90
178
|
path: string;
|
|
91
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* Token-type indices used by the server's semantic-token legend.
|
|
182
|
+
* Names map to LSP token types by lowercasing their first character, including docCommentTag.
|
|
183
|
+
*/
|
|
92
184
|
export declare enum SemanticTokenKind {
|
|
185
|
+
/** Namespace declarations, using directives, and bases of qualified references. */
|
|
93
186
|
Namespace = 0,
|
|
187
|
+
/** Scalar declarations and references classified syntactically as types. */
|
|
94
188
|
Type = 1,
|
|
189
|
+
/** LSP class category, reserved in the legend. */
|
|
95
190
|
Class = 2,
|
|
191
|
+
/** Enum and union declaration names. */
|
|
96
192
|
Enum = 3,
|
|
193
|
+
/** Interface declaration names. */
|
|
97
194
|
Interface = 4,
|
|
195
|
+
/** Model and alias declaration names. */
|
|
98
196
|
Struct = 5,
|
|
197
|
+
/** Template parameter declarations and named template arguments. */
|
|
99
198
|
TypeParameter = 6,
|
|
199
|
+
/** Function or decorator parameter declarations. */
|
|
100
200
|
Parameter = 7,
|
|
201
|
+
/** Constant declarations and parameter or property names in documentation tags. */
|
|
101
202
|
Variable = 8,
|
|
203
|
+
/** Model, object, and union properties, including union variants. */
|
|
102
204
|
Property = 9,
|
|
205
|
+
/** Enum member declaration names. */
|
|
103
206
|
EnumMember = 10,
|
|
207
|
+
/** LSP event category, reserved in the legend. */
|
|
104
208
|
Event = 11,
|
|
209
|
+
/** Operations, functions, and scalar constructors. */
|
|
105
210
|
Function = 12,
|
|
211
|
+
/** LSP method category, reserved in the legend. */
|
|
106
212
|
Method = 13,
|
|
213
|
+
/** Decorator uses and unrecognized documentation tags. */
|
|
107
214
|
Macro = 14,
|
|
215
|
+
/** Language keywords and compiler directives. */
|
|
108
216
|
Keyword = 15,
|
|
217
|
+
/** Ordinary comments and documentation text outside classified tags. */
|
|
109
218
|
Comment = 16,
|
|
219
|
+
/** String literals and the text portions of interpolated strings. */
|
|
110
220
|
String = 17,
|
|
221
|
+
/** Numeric literals in source. */
|
|
111
222
|
Number = 18,
|
|
223
|
+
/** LSP regular-expression category, reserved in the legend. */
|
|
112
224
|
Regexp = 19,
|
|
225
|
+
/** Punctuation and interpolation delimiters. */
|
|
113
226
|
Operator = 20,
|
|
227
|
+
/** Recognized documentation tags, including their leading at sign. */
|
|
114
228
|
DocCommentTag = 21
|
|
115
229
|
}
|
|
230
|
+
/** Classified source span before conversion into the LSP semantic-token encoding. */
|
|
116
231
|
export interface SemanticToken {
|
|
232
|
+
/** Index into the server's semantic-token legend. */
|
|
117
233
|
kind: SemanticTokenKind;
|
|
234
|
+
/** Inclusive start offset in UTF-16 code units within the source text. */
|
|
118
235
|
pos: number;
|
|
236
|
+
/** Exclusive end offset in UTF-16 code units within the source text. */
|
|
119
237
|
end: number;
|
|
120
238
|
}
|
|
239
|
+
/** TypeSpec-specific request method names implemented alongside standard LSP handlers. */
|
|
121
240
|
export type CustomRequestName = "typespec/getInitProjectContext" | "typespec/initProject" | "typespec/validateInitProjectTemplate" | "typespec/internalCompile";
|
|
241
|
+
/** Availability flags for the TypeSpec-specific requests advertised by server initialization. */
|
|
122
242
|
export interface ServerCustomCapacities {
|
|
243
|
+
/** Whether the server can supply built-in project templates. */
|
|
123
244
|
getInitProjectContext?: boolean;
|
|
245
|
+
/** Whether the server can validate client-supplied project templates. */
|
|
124
246
|
validateInitProjectTemplate?: boolean;
|
|
247
|
+
/** Whether the server can scaffold a project from a resolved configuration. */
|
|
125
248
|
initProject?: boolean;
|
|
249
|
+
/** Whether the server supports explicit full compilation with captured diagnostics. */
|
|
126
250
|
internalCompile?: boolean;
|
|
127
251
|
}
|
|
252
|
+
/** LSP initialization result extended with TypeSpec requests and compiler installation locations. */
|
|
128
253
|
export interface ServerInitializeResult extends InitializeResult {
|
|
254
|
+
/** Supported TypeSpec-specific requests; an absent flag does not advertise support. */
|
|
129
255
|
customCapacities?: ServerCustomCapacities;
|
|
256
|
+
/** Compiler package directory when discoverable from the server module's installed location. */
|
|
130
257
|
compilerRootFolder?: string;
|
|
258
|
+
/** Path to cmd/tsp.js within that compiler installation; absent when the package root cannot be inferred. */
|
|
131
259
|
compilerCliJsPath?: string;
|
|
132
260
|
}
|
|
261
|
+
/** Built-in template information needed to start the editor's project-creation workflow. */
|
|
133
262
|
export interface InitProjectContext {
|
|
134
263
|
/** provide the default templates current compiler/cli supports */
|
|
135
264
|
coreInitTemplates: LoadedCoreTemplates;
|
|
136
265
|
}
|
|
266
|
+
/** Resolved scaffolding inputs accepted by the server's project-creation request. */
|
|
137
267
|
export type InitProjectConfig = ScaffoldingConfig;
|
|
268
|
+
/** Project template definition exchanged with editor clients. */
|
|
138
269
|
export type InitProjectTemplate = InitTemplate;
|
|
270
|
+
/** Library dependency specification within an editor project template. */
|
|
139
271
|
export type InitProjectTemplateLibrarySpec = InitTemplateLibrarySpec;
|
|
272
|
+
/** Emitter configuration contributed by an editor project template. */
|
|
140
273
|
export type InitProjectTemplateEmitterTemplate = EmitterTemplate;
|
|
141
274
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/server/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,wBAAwB,EACxB,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,EACd,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,EAClB,KAAK,EACL,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,QAAQ,EACR,mBAAmB,EACnB,wBAAwB,EACxB,KAAK,EACL,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,2BAA2B,EAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,UAAU,EACV,cAAc,EACd,kBAAkB,EACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,mBAA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iB,SAAQ,UAAU;IAClD,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/server/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,wBAAwB,EACxB,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,EACd,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,EAClB,KAAK,EACL,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,QAAQ,EACR,mBAAmB,EACnB,wBAAwB,EACxB,KAAK,EACL,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,2BAA2B,EAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,UAAU,EACV,cAAc,EACd,kBAAkB,EACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAExF,gFAAgF;AAChF,MAAM,MAAM,cA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AC1F,MAAM,MAAM,iBAAiB,GACzB,gCAAgC,GAChC,sBAAsB,GACtB,sCAAsC,GACtC,0BAA0B,CAAC;AAC/B,iGAAiG;AACjG,MAAM,WAAW,sBAAsB;IACrC,gEAAgE;IAChE,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,yEAAyE;IACzE,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,+EAA+E;IAC/E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,uFAAuF;IACvF,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,qGAAqG;AACrG,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC9D,uFAAuF;IACvF,gBAAgB,CAAC,EAAE,sBAAsB,CAAC;IAC1C,gGAAgG;IAChG,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,6GAA6G;IAC7G,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,4FAA4F;AAC5F,MAAM,WAAW,kBAAkB;IACjC,kEAAkE;IAClE,iBAAiB,EAAE,mBAAmB,CAAC;CACxC;AAED,qFAAqF;AACrF,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAClD,iEAAiE;AACjE,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC;AAC/C,0EAA0E;AAC1E,MAAM,MAAM,8BAA8B,GAAG,uBAAuB,CAAC;AACrE,uEAAuE;AACvE,MAAM,MAAM,kCAAkC,GAAG,eAAe,CAAC"}
|
package/dist/src/server/types.js
CHANGED
|
@@ -1,26 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token-type indices used by the server's semantic-token legend.
|
|
3
|
+
* Names map to LSP token types by lowercasing their first character, including docCommentTag.
|
|
4
|
+
*/
|
|
1
5
|
export var SemanticTokenKind;
|
|
2
6
|
(function (SemanticTokenKind) {
|
|
7
|
+
/** Namespace declarations, using directives, and bases of qualified references. */
|
|
3
8
|
SemanticTokenKind[SemanticTokenKind["Namespace"] = 0] = "Namespace";
|
|
9
|
+
/** Scalar declarations and references classified syntactically as types. */
|
|
4
10
|
SemanticTokenKind[SemanticTokenKind["Type"] = 1] = "Type";
|
|
11
|
+
/** LSP class category, reserved in the legend. */
|
|
5
12
|
SemanticTokenKind[SemanticTokenKind["Class"] = 2] = "Class";
|
|
13
|
+
/** Enum and union declaration names. */
|
|
6
14
|
SemanticTokenKind[SemanticTokenKind["Enum"] = 3] = "Enum";
|
|
15
|
+
/** Interface declaration names. */
|
|
7
16
|
SemanticTokenKind[SemanticTokenKind["Interface"] = 4] = "Interface";
|
|
17
|
+
/** Model and alias declaration names. */
|
|
8
18
|
SemanticTokenKind[SemanticTokenKind["Struct"] = 5] = "Struct";
|
|
19
|
+
/** Template parameter declarations and named template arguments. */
|
|
9
20
|
SemanticTokenKind[SemanticTokenKind["TypeParameter"] = 6] = "TypeParameter";
|
|
21
|
+
/** Function or decorator parameter declarations. */
|
|
10
22
|
SemanticTokenKind[SemanticTokenKind["Parameter"] = 7] = "Parameter";
|
|
23
|
+
/** Constant declarations and parameter or property names in documentation tags. */
|
|
11
24
|
SemanticTokenKind[SemanticTokenKind["Variable"] = 8] = "Variable";
|
|
25
|
+
/** Model, object, and union properties, including union variants. */
|
|
12
26
|
SemanticTokenKind[SemanticTokenKind["Property"] = 9] = "Property";
|
|
27
|
+
/** Enum member declaration names. */
|
|
13
28
|
SemanticTokenKind[SemanticTokenKind["EnumMember"] = 10] = "EnumMember";
|
|
29
|
+
/** LSP event category, reserved in the legend. */
|
|
14
30
|
SemanticTokenKind[SemanticTokenKind["Event"] = 11] = "Event";
|
|
31
|
+
/** Operations, functions, and scalar constructors. */
|
|
15
32
|
SemanticTokenKind[SemanticTokenKind["Function"] = 12] = "Function";
|
|
33
|
+
/** LSP method category, reserved in the legend. */
|
|
16
34
|
SemanticTokenKind[SemanticTokenKind["Method"] = 13] = "Method";
|
|
35
|
+
/** Decorator uses and unrecognized documentation tags. */
|
|
17
36
|
SemanticTokenKind[SemanticTokenKind["Macro"] = 14] = "Macro";
|
|
37
|
+
/** Language keywords and compiler directives. */
|
|
18
38
|
SemanticTokenKind[SemanticTokenKind["Keyword"] = 15] = "Keyword";
|
|
39
|
+
/** Ordinary comments and documentation text outside classified tags. */
|
|
19
40
|
SemanticTokenKind[SemanticTokenKind["Comment"] = 16] = "Comment";
|
|
41
|
+
/** String literals and the text portions of interpolated strings. */
|
|
20
42
|
SemanticTokenKind[SemanticTokenKind["String"] = 17] = "String";
|
|
43
|
+
/** Numeric literals in source. */
|
|
21
44
|
SemanticTokenKind[SemanticTokenKind["Number"] = 18] = "Number";
|
|
45
|
+
/** LSP regular-expression category, reserved in the legend. */
|
|
22
46
|
SemanticTokenKind[SemanticTokenKind["Regexp"] = 19] = "Regexp";
|
|
47
|
+
/** Punctuation and interpolation delimiters. */
|
|
23
48
|
SemanticTokenKind[SemanticTokenKind["Operator"] = 20] = "Operator";
|
|
49
|
+
/** Recognized documentation tags, including their leading at sign. */
|
|
24
50
|
SemanticTokenKind[SemanticTokenKind["DocCommentTag"] = 21] = "DocCommentTag";
|
|
25
51
|
})(SemanticTokenKind || (SemanticTokenKind = {}));
|
|
26
52
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/server/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/server/types.ts"],"names":[],"mappings":"AAgQA;;;GAGG;AACH,MAAM,CAAN,IAAY,iBA8CX;AA9CD,WAAY,iBAAiB;IAC3B,mFAAmF;IACnF,mEAAS,CAAA;IACT,4EAA4E;IAC5E,yDAAI,CAAA;IACJ,kDAAkD;IAClD,2DAAK,CAAA;IACL,wCAAwC;IACxC,yDAAI,CAAA;IACJ,mCAAmC;IACnC,mEAAS,CAAA;IACT,yCAAyC;IACzC,6DAAM,CAAA;IACN,oEAAoE;IACpE,2EAAa,CAAA;IACb,oDAAoD;IACpD,mEAAS,CAAA;IACT,mFAAmF;IACnF,iEAAQ,CAAA;IACR,qEAAqE;IACrE,iEAAQ,CAAA;IACR,qCAAqC;IACrC,sEAAU,CAAA;IACV,kDAAkD;IAClD,4DAAK,CAAA;IACL,sDAAsD;IACtD,kEAAQ,CAAA;IACR,mDAAmD;IACnD,8DAAM,CAAA;IACN,0DAA0D;IAC1D,4DAAK,CAAA;IACL,iDAAiD;IACjD,gEAAO,CAAA;IACP,wEAAwE;IACxE,gEAAO,CAAA;IACP,qEAAqE;IACrE,8DAAM,CAAA;IACN,kCAAkC;IAClC,8DAAM,CAAA;IACN,+DAA+D;IAC/D,8DAAM,CAAA;IACN,gDAAgD;IAChD,kEAAQ,CAAA;IAER,sEAAsE;IACtE,4EAAa,CAAA;AACf,CAAC,EA9CW,iBAAiB,KAAjB,iBAAiB,QA8C5B"}
|
|
@@ -1,25 +1,38 @@
|
|
|
1
1
|
import type { TextDocumentIdentifier } from "vscode-languageserver";
|
|
2
2
|
import type { TextDocument } from "vscode-languageserver-textdocument";
|
|
3
3
|
import type { ServerLog } from "./types.js";
|
|
4
|
+
/** Most recent notification for one URI in a batch awaiting update processing. */
|
|
4
5
|
interface PendingUpdate {
|
|
6
|
+
/** Latest document or identifier scheduled for this URI, replacing earlier notifications in the batch. */
|
|
5
7
|
latest: TextDocument | TextDocumentIdentifier;
|
|
8
|
+
/** Time of the latest notification for this URI, as milliseconds since the Unix epoch. */
|
|
6
9
|
latestUpdateTimestamp: number;
|
|
7
10
|
}
|
|
11
|
+
/** Document lifecycle notification; only changed and renamed notifications advance the change version. */
|
|
8
12
|
export type UpdateType = "opened" | "changed" | "closed" | "renamed";
|
|
13
|
+
/**
|
|
14
|
+
* Process a batch containing the latest notification for each pending URI.
|
|
15
|
+
* triggeredBy is the document or identifier from the scheduling call that triggered this execution.
|
|
16
|
+
*/
|
|
9
17
|
type UpdateCallback<T> = (updates: PendingUpdate[], triggeredBy: TextDocument | TextDocumentIdentifier) => Promise<T>;
|
|
10
18
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
19
|
+
* Batch document notifications by URI and invoke a callback after a debounce delay.
|
|
20
|
+
* Processing waits for start(), allowing the client to finish loading settings.
|
|
21
|
+
* A newer scheduling call resolves earlier pending callers with undefined, but does
|
|
22
|
+
* not cancel a callback that has already started.
|
|
13
23
|
*/
|
|
14
24
|
export declare class UpdateManager<T = void> {
|
|
15
25
|
#private;
|
|
16
26
|
private name;
|
|
17
27
|
private _log;
|
|
28
|
+
/** Compute the current debounce delay in milliseconds using the supplied override or adaptive typing frequency. */
|
|
18
29
|
readonly getDebounceDelay: () => number;
|
|
19
30
|
/**
|
|
20
|
-
*
|
|
21
|
-
* @param name
|
|
22
|
-
* @param log
|
|
31
|
+
* Create an update queue that does not process notifications until start() is called.
|
|
32
|
+
* @param name Identifies this queue in debug messages.
|
|
33
|
+
* @param log Receives queue debug messages when update-manager debugging is enabled.
|
|
34
|
+
* @param getDebounceDelay Optional delay override in milliseconds. Otherwise the delay
|
|
35
|
+
* adapts to recent change frequency, starting at 500 ms.
|
|
23
36
|
*/
|
|
24
37
|
constructor(name: string, log: (sl: ServerLog) => void, getDebounceDelay?: () => number);
|
|
25
38
|
/**
|
|
@@ -27,7 +40,9 @@ export declare class UpdateManager<T = void> {
|
|
|
27
40
|
* We need to start explicitly to avoid compiling with incorrect settings when the lsp hasn't fully initialized (the client settings are not loaded yet.)
|
|
28
41
|
*/
|
|
29
42
|
start(): void;
|
|
43
|
+
/** Register or replace the batch processor. Updates processed without a callback return undefined. */
|
|
30
44
|
setCallback(callback: UpdateCallback<T>): void;
|
|
45
|
+
/** Monotonic server change counter, initially zero; advances for changed and renamed notifications only. */
|
|
31
46
|
get docChangedVersion(): number;
|
|
32
47
|
private bumpDocChangedVersion;
|
|
33
48
|
private pushDocChangedTimestamp;
|
|
@@ -37,8 +52,10 @@ export declare class UpdateManager<T = void> {
|
|
|
37
52
|
private getWindowedDocChangedTimesteps;
|
|
38
53
|
private getAdaptiveDebounceDelay;
|
|
39
54
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
55
|
+
* Queue or replace the latest notification for a URI and restart debounced processing.
|
|
56
|
+
* Changed and renamed notifications advance the change version immediately, even before start().
|
|
57
|
+
* Returns the callback result, or undefined when superseded by a newer scheduling call
|
|
58
|
+
* or processed without a registered callback. Superseding does not stop an executing callback.
|
|
42
59
|
*/
|
|
43
60
|
scheduleUpdate(document: TextDocument | TextDocumentIdentifier, updateType: UpdateType): Promise<T | undefined>;
|
|
44
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-manager.d.ts","sourceRoot":"","sources":["../../../src/server/update-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,UAAU,aAAa;IACrB,MAAM,EAAE,YAAY,GAAG,sBAAsB,CAAC;IAC9C,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAErE,KAAK,cAAc,CAAC,CAAC,IAAI,CACvB,OAAO,EAAE,aAAa,EAAE,EACxB,WAAW,EAAE,YAAY,GAAG,sBAAsB,KAC/C,OAAO,CAAC,CAAC,CAAC,CAAC;AAChB
|
|
1
|
+
{"version":3,"file":"update-manager.d.ts","sourceRoot":"","sources":["../../../src/server/update-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,kFAAkF;AAClF,UAAU,aAAa;IACrB,0GA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AeF;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,CAAC,EACnC,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAC9B,WAAW,EAAE,MAAM,OAAO,GAAG,SAAS,EACtC,QAAQ,EAAE,MAAM,MAAM,EACtB,GAAG,EAAE,CAAC,EAAE,EAAE,SAAS,KAAK,IAAI,GAC3B,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAiEpC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { debugLoggers } from "./debug.js";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Batch document notifications by URI and invoke a callback after a debounce delay.
|
|
4
|
+
* Processing waits for start(), allowing the client to finish loading settings.
|
|
5
|
+
* A newer scheduling call resolves earlier pending callers with undefined, but does
|
|
6
|
+
* not cancel a callback that has already started.
|
|
5
7
|
*/
|
|
6
8
|
export class UpdateManager {
|
|
7
9
|
name;
|
|
@@ -13,11 +15,14 @@ export class UpdateManager {
|
|
|
13
15
|
#docChangedTimesteps = [];
|
|
14
16
|
#isStarted = false;
|
|
15
17
|
_log;
|
|
18
|
+
/** Compute the current debounce delay in milliseconds using the supplied override or adaptive typing frequency. */
|
|
16
19
|
getDebounceDelay;
|
|
17
20
|
/**
|
|
18
|
-
*
|
|
19
|
-
* @param name
|
|
20
|
-
* @param log
|
|
21
|
+
* Create an update queue that does not process notifications until start() is called.
|
|
22
|
+
* @param name Identifies this queue in debug messages.
|
|
23
|
+
* @param log Receives queue debug messages when update-manager debugging is enabled.
|
|
24
|
+
* @param getDebounceDelay Optional delay override in milliseconds. Otherwise the delay
|
|
25
|
+
* adapts to recent change frequency, starting at 500 ms.
|
|
21
26
|
*/
|
|
22
27
|
constructor(name, log, getDebounceDelay) {
|
|
23
28
|
this.name = name;
|
|
@@ -42,9 +47,11 @@ export class UpdateManager {
|
|
|
42
47
|
start() {
|
|
43
48
|
this.#isStarted = true;
|
|
44
49
|
}
|
|
50
|
+
/** Register or replace the batch processor. Updates processed without a callback return undefined. */
|
|
45
51
|
setCallback(callback) {
|
|
46
52
|
this.#updateCb = callback;
|
|
47
53
|
}
|
|
54
|
+
/** Monotonic server change counter, initially zero; advances for changed and renamed notifications only. */
|
|
48
55
|
get docChangedVersion() {
|
|
49
56
|
return this.#docChangedVersion;
|
|
50
57
|
}
|
|
@@ -94,8 +101,10 @@ export class UpdateManager {
|
|
|
94
101
|
return this.DEFAULT_DELAY;
|
|
95
102
|
};
|
|
96
103
|
/**
|
|
97
|
-
*
|
|
98
|
-
*
|
|
104
|
+
* Queue or replace the latest notification for a URI and restart debounced processing.
|
|
105
|
+
* Changed and renamed notifications advance the change version immediately, even before start().
|
|
106
|
+
* Returns the callback result, or undefined when superseded by a newer scheduling call
|
|
107
|
+
* or processed without a registered callback. Superseding does not stop an executing callback.
|
|
99
108
|
*/
|
|
100
109
|
scheduleUpdate(document, updateType) {
|
|
101
110
|
if (updateType === "changed" || updateType === "renamed") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-manager.js","sourceRoot":"","sources":["../../../src/server/update-manager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"update-manager.js","sourceRoot":"","sources":["../../../src/server/update-manager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAsB1C;;;;;GAKG;AACH,MAAM,OAAO,aAAa;IAuBd,IAAI;IAtBd,eAAe,GAAG,IAAI,GAAG,EAAyB,CAAC;IACnD,SAAS,CAAqB;IAC9B,mEAAmE;IACnE,kBAAkB,GAAG,CAAC,CAAC;IACvB,oBAAoB,CAEQ;IAC5B,oBAAoB,GAAa,EAAE,CAAC;IACpC,UAAU,GAAG,KAAK,CAAC;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AsB;IAC9B,OAAO,CAA0B;IAEjC;QACE,IAAI,CAAC,QAAQ,GAAG,IAAI,OAAO,CAAI,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YAC1C,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;YACpB,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;QACrB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,cAAc,CAAC,KAAQ;QACrB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAED,aAAa,CAAC,MAAY;QACxB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { CodeFix, Diagnostic, Node } from "../core/types.js";
|
|
2
|
+
/** Expected-source assertion for a fix constructed from a parsed AST, without type checking. */
|
|
2
3
|
export interface CodeFixExpect {
|
|
4
|
+
/** Apply the fix to the cursor-free source and compare its output using {@link trimBlankLines}. */
|
|
3
5
|
toChangeTo(code: string): Promise<void>;
|
|
4
6
|
}
|
|
5
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-fix-testing.d.ts","sourceRoot":"","sources":["../../../src/testing/code-fix-testing.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAMlE,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,GAAG,aAAa,CA2BjG;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,KAAK,SAAS,OAAO,EAAE,GACnE,aAAa,CAqCf"}
|
|
1
|
+
{"version":3,"file":"code-fix-testing.d.ts","sourceRoot":"","sources":["../../../src/testing/code-fix-testing.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAMlE,gGAAgG;AAChG,MAAM,WAAW,aAAa;IAC5B,mGAAmG;IACnG,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,GAAG,aAAa,CA2BjG;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,KAAK,SAAS,OAAO,EAAE,GACnE,aAAa,CAqCf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-fix-testing.js","sourceRoot":"","sources":["../../../src/testing/code-fix-testing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,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,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE;aAC5D,CAAC,CAAC;QACL,CAAC;QACD,EAAE,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,kEAAkE,CAAC,CAAC;QAC/F,MAAM,SAAS,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;QACxC,4DAA4D;QAC5D,MAAM,IAAI,GAAG,MAAM,cAAc,EAAE,CAAC;QACpC,IAAI,cAAkC,CAAC;QACvC,MAAM,cAAc,CAClB;YACE,GAAG,IAAI,CAAC,YAAY;YACpB,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;gBAC/B,WAAW,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;gBAC9B,cAAc,GAAG,KAAK,CAAC;YACzB,CAAC;SACF,EACD,SAAS,CACV,CAAC;QACF,EAAE,CAAC,cAAc,CAAC,CAAC;QACnB,WAAW,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC;AAED,SAAS,cAAc,CAAC,IAAU;IAChC,aAAa,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE;QAC3B,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC;QAC3B,cAAc,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,41 +1,47 @@
|
|
|
1
1
|
import { type Diagnostic } from "../core/types.js";
|
|
2
2
|
/**
|
|
3
|
-
* Assert
|
|
3
|
+
* Assert that the collection contains neither warnings nor errors.
|
|
4
4
|
* @param diagnostics Diagnostics
|
|
5
5
|
*/
|
|
6
6
|
export declare function expectDiagnosticEmpty(diagnostics: readonly Diagnostic[]): void;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Partial expectations for one diagnostic. Omitted fields are not checked.
|
|
9
9
|
*/
|
|
10
10
|
export interface DiagnosticMatch {
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Exact diagnostic code, including the library prefix for library diagnostics.
|
|
13
13
|
*/
|
|
14
14
|
code?: string;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Exact message text, or a regular expression tested against the message.
|
|
17
17
|
*/
|
|
18
18
|
message?: string | RegExp;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Required severity; omitted to accept either warnings or errors.
|
|
21
21
|
*/
|
|
22
22
|
severity?: "error" | "warning";
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Source path, resolved against the virtual test root for strings, or matched as a full path by a regular expression.
|
|
25
25
|
*/
|
|
26
26
|
file?: string | RegExp;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* Zero-based UTF-16 start offset in the diagnostic's full source file, including generated test prefixes.
|
|
29
29
|
*/
|
|
30
30
|
pos?: number;
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* Exclusive UTF-16 end offset in the diagnostic's full source file.
|
|
33
33
|
*/
|
|
34
34
|
end?: number;
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
37
|
+
* Match diagnostics by index, checking only the specified fields of each expectation.
|
|
38
|
+
* Strict mode is enabled by default and also requires equal array lengths. With `strict: false`,
|
|
39
|
+
* extra diagnostics after the expected prefix are allowed; expectations are not searched for or reordered.
|
|
40
|
+
* File or offset expectations require the diagnostic to have a source target.
|
|
41
|
+
*
|
|
42
|
+
* @param diagnostics Diagnostics in reporting order.
|
|
43
|
+
* @param match A single expectation or an ordered array of expectations.
|
|
44
|
+
* @param options Controls whether extra diagnostics are rejected.
|
|
39
45
|
*/
|
|
40
46
|
export declare function expectDiagnostics(diagnostics: readonly Diagnostic[], match: DiagnosticMatch | DiagnosticMatch[], options?: {
|
|
41
47
|
strict: boolean;
|