@typespec/compiler 1.15.0-dev.16 → 1.15.0-dev.18
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/manifest.js +2 -2
- package/dist/src/ast/index.js +1 -1
- package/dist/src/ast/index.js.map +1 -1
- package/dist/src/config/config-interpolation.d.ts +2 -2
- package/dist/src/config/config-interpolation.d.ts.map +1 -1
- package/dist/src/config/config-interpolation.js.map +1 -1
- package/dist/src/config/config-loader.d.ts +2 -2
- package/dist/src/config/config-loader.d.ts.map +1 -1
- package/dist/src/config/config-loader.js.map +1 -1
- package/dist/src/config/config-schema.d.ts +1 -1
- package/dist/src/config/config-schema.d.ts.map +1 -1
- package/dist/src/config/config-to-options.d.ts +3 -3
- 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/index.d.ts +3 -2
- package/dist/src/config/index.d.ts.map +1 -1
- package/dist/src/config/index.js +0 -1
- package/dist/src/config/index.js.map +1 -1
- package/dist/src/core/binder.d.ts +2 -1
- package/dist/src/core/binder.d.ts.map +1 -1
- package/dist/src/core/binder.js +57 -53
- package/dist/src/core/binder.js.map +1 -1
- package/dist/src/core/charcode.js +145 -26
- package/dist/src/core/charcode.js.map +1 -1
- package/dist/src/core/checker.d.ts +2 -2
- package/dist/src/core/checker.d.ts.map +1 -1
- package/dist/src/core/checker.js +96 -82
- package/dist/src/core/checker.js.map +1 -1
- package/dist/src/core/cli/actions/compile/args.d.ts +2 -2
- package/dist/src/core/cli/actions/compile/args.d.ts.map +1 -1
- package/dist/src/core/cli/actions/compile/args.js.map +1 -1
- package/dist/src/core/cli/actions/compile/compile.d.ts +2 -2
- package/dist/src/core/cli/actions/compile/compile.d.ts.map +1 -1
- package/dist/src/core/cli/actions/compile/compile.js.map +1 -1
- package/dist/src/core/cli/actions/compile/watch.d.ts +3 -3
- package/dist/src/core/cli/actions/compile/watch.d.ts.map +1 -1
- package/dist/src/core/cli/actions/compile/watch.js.map +1 -1
- package/dist/src/core/cli/actions/format.d.ts +1 -1
- package/dist/src/core/cli/actions/format.d.ts.map +1 -1
- package/dist/src/core/cli/actions/info/emitter-options.d.ts +1 -1
- package/dist/src/core/cli/actions/info/emitter-options.d.ts.map +1 -1
- package/dist/src/core/cli/actions/info/emitter-options.js.map +1 -1
- package/dist/src/core/cli/actions/info.d.ts +1 -1
- package/dist/src/core/cli/actions/info.d.ts.map +1 -1
- package/dist/src/core/cli/actions/init.d.ts +2 -2
- package/dist/src/core/cli/actions/init.d.ts.map +1 -1
- package/dist/src/core/cli/actions/vs.d.ts +2 -2
- package/dist/src/core/cli/actions/vs.d.ts.map +1 -1
- package/dist/src/core/cli/actions/vs.js.map +1 -1
- package/dist/src/core/cli/actions/vscode.d.ts +2 -2
- package/dist/src/core/cli/actions/vscode.d.ts.map +1 -1
- package/dist/src/core/cli/actions/vscode.js.map +1 -1
- package/dist/src/core/cli/cli.d.ts +1 -1
- package/dist/src/core/cli/cli.d.ts.map +1 -1
- package/dist/src/core/cli/cli.js +1 -1
- package/dist/src/core/cli/cli.js.map +1 -1
- package/dist/src/core/cli/download-vsix.d.ts +2 -2
- package/dist/src/core/cli/download-vsix.d.ts.map +1 -1
- package/dist/src/core/cli/download-vsix.js.map +1 -1
- package/dist/src/core/cli/utils.d.ts +3 -3
- package/dist/src/core/cli/utils.d.ts.map +1 -1
- package/dist/src/core/cli/utils.js.map +1 -1
- package/dist/src/core/compiler-code-fixes/create-add-decorator/create-add-decorator.codefix.d.ts +1 -1
- package/dist/src/core/compiler-code-fixes/create-add-decorator/create-add-decorator.codefix.d.ts.map +1 -1
- package/dist/src/core/compiler-code-fixes/remove-unused-code.codefix.d.ts +1 -1
- package/dist/src/core/compiler-code-fixes/remove-unused-code.codefix.d.ts.map +1 -1
- package/dist/src/core/compiler-code-fixes/remove-unused-template-parameter.codefix.d.ts +1 -1
- package/dist/src/core/compiler-code-fixes/remove-unused-template-parameter.codefix.d.ts.map +1 -1
- package/dist/src/core/compiler-code-fixes/suppress.codefix.d.ts +2 -1
- package/dist/src/core/compiler-code-fixes/suppress.codefix.d.ts.map +1 -1
- package/dist/src/core/compiler-code-fixes/suppress.codefix.js.map +1 -1
- package/dist/src/core/compiler-code-fixes/utils.d.ts +1 -1
- package/dist/src/core/compiler-code-fixes/utils.d.ts.map +1 -1
- package/dist/src/core/decorator-utils.d.ts +1 -1
- package/dist/src/core/decorator-utils.d.ts.map +1 -1
- package/dist/src/core/decorator-utils.js +1 -1
- package/dist/src/core/decorator-utils.js.map +1 -1
- package/dist/src/core/deprecation.d.ts +1 -1
- package/dist/src/core/deprecation.d.ts.map +1 -1
- package/dist/src/core/deprecation.js.map +1 -1
- package/dist/src/core/diagnostics.d.ts +2 -1
- package/dist/src/core/diagnostics.d.ts.map +1 -1
- package/dist/src/core/diagnostics.js +3 -3
- package/dist/src/core/diagnostics.js.map +1 -1
- package/dist/src/core/entrypoint-resolution.d.ts +2 -2
- package/dist/src/core/entrypoint-resolution.d.ts.map +1 -1
- package/dist/src/core/external-error.d.ts +1 -1
- package/dist/src/core/external-error.d.ts.map +1 -1
- package/dist/src/core/formatter-fs.d.ts +1 -1
- package/dist/src/core/formatter-fs.d.ts.map +1 -1
- package/dist/src/core/formatter-fs.js.map +1 -1
- package/dist/src/core/helpers/discriminator-utils.d.ts +3 -3
- package/dist/src/core/helpers/discriminator-utils.d.ts.map +1 -1
- package/dist/src/core/helpers/discriminator-utils.js +1 -1
- package/dist/src/core/helpers/discriminator-utils.js.map +1 -1
- package/dist/src/core/helpers/index.d.ts +4 -2
- package/dist/src/core/helpers/index.d.ts.map +1 -1
- package/dist/src/core/helpers/index.js.map +1 -1
- package/dist/src/core/helpers/operation-utils.d.ts +1 -1
- package/dist/src/core/helpers/operation-utils.d.ts.map +1 -1
- package/dist/src/core/helpers/raw-text-cache.d.ts +1 -1
- package/dist/src/core/helpers/raw-text-cache.d.ts.map +1 -1
- package/dist/src/core/helpers/raw-text-cache.js.map +1 -1
- package/dist/src/core/helpers/syntax-utils.d.ts +1 -1
- package/dist/src/core/helpers/syntax-utils.d.ts.map +1 -1
- package/dist/src/core/helpers/syntax-utils.js +4 -4
- package/dist/src/core/helpers/syntax-utils.js.map +1 -1
- package/dist/src/core/helpers/usage-resolver.d.ts +1 -1
- package/dist/src/core/helpers/usage-resolver.d.ts.map +1 -1
- package/dist/src/core/inspector/symbol.d.ts.map +1 -1
- package/dist/src/core/inspector/symbol.js +18 -18
- package/dist/src/core/inspector/symbol.js.map +1 -1
- package/dist/src/core/intrinsic-type-state.d.ts +1 -1
- package/dist/src/core/intrinsic-type-state.d.ts.map +1 -1
- package/dist/src/core/js-marshaller.d.ts +1 -1
- package/dist/src/core/js-marshaller.d.ts.map +1 -1
- package/dist/src/core/library.d.ts +1 -1
- package/dist/src/core/library.d.ts.map +1 -1
- package/dist/src/core/linter-rules/unused-using.rule.d.ts.map +1 -1
- package/dist/src/core/linter-rules/unused-using.rule.js.map +1 -1
- package/dist/src/core/linter.d.ts +3 -3
- package/dist/src/core/linter.d.ts.map +1 -1
- package/dist/src/core/linter.js +1 -1
- package/dist/src/core/linter.js.map +1 -1
- package/dist/src/core/logger/console-sink.d.ts +1 -1
- package/dist/src/core/logger/console-sink.d.ts.map +1 -1
- package/dist/src/core/logger/dynamic-task.d.ts +1 -1
- package/dist/src/core/logger/dynamic-task.d.ts.map +1 -1
- package/dist/src/core/logger/tracer.d.ts +1 -1
- package/dist/src/core/logger/tracer.d.ts.map +1 -1
- package/dist/src/core/modifiers.d.ts +3 -2
- package/dist/src/core/modifiers.d.ts.map +1 -1
- package/dist/src/core/modifiers.js +17 -17
- package/dist/src/core/modifiers.js.map +1 -1
- package/dist/src/core/name-resolver.d.ts +9 -3
- package/dist/src/core/name-resolver.d.ts.map +1 -1
- package/dist/src/core/name-resolver.js +46 -41
- package/dist/src/core/name-resolver.js.map +1 -1
- package/dist/src/core/node-host.d.ts +1 -1
- package/dist/src/core/node-host.d.ts.map +1 -1
- package/dist/src/core/node-system-host.d.ts +1 -1
- package/dist/src/core/node-system-host.d.ts.map +1 -1
- package/dist/src/core/options.d.ts +2 -2
- package/dist/src/core/options.d.ts.map +1 -1
- package/dist/src/core/parser.d.ts +1 -1
- package/dist/src/core/parser.d.ts.map +1 -1
- package/dist/src/core/parser.js +22 -17
- package/dist/src/core/parser.js.map +1 -1
- package/dist/src/core/path-utils.js +140 -11
- package/dist/src/core/path-utils.js.map +1 -1
- package/dist/src/core/program.d.ts +3 -3
- package/dist/src/core/program.d.ts.map +1 -1
- package/dist/src/core/program.js +4 -4
- package/dist/src/core/program.js.map +1 -1
- package/dist/src/core/scanner.d.ts +2 -2
- package/dist/src/core/scanner.d.ts.map +1 -1
- package/dist/src/core/scanner.js +134 -128
- package/dist/src/core/scanner.js.map +1 -1
- package/dist/src/core/schema-validator.d.ts +1 -1
- package/dist/src/core/schema-validator.d.ts.map +1 -1
- package/dist/src/core/schema-validator.js +1 -1
- package/dist/src/core/schema-validator.js.map +1 -1
- package/dist/src/core/semantic-walker.d.ts +1 -1
- package/dist/src/core/semantic-walker.d.ts.map +1 -1
- package/dist/src/core/semantic-walker.js +1 -1
- package/dist/src/core/semantic-walker.js.map +1 -1
- package/dist/src/core/source-file.js +4 -3
- package/dist/src/core/source-file.js.map +1 -1
- package/dist/src/core/source-loader.d.ts +3 -2
- package/dist/src/core/source-loader.d.ts.map +1 -1
- package/dist/src/core/source-loader.js +5 -5
- package/dist/src/core/source-loader.js.map +1 -1
- package/dist/src/core/suppression-tracking.d.ts +3 -3
- package/dist/src/core/suppression-tracking.d.ts.map +1 -1
- package/dist/src/core/suppression-tracking.js +1 -1
- package/dist/src/core/suppression-tracking.js.map +1 -1
- package/dist/src/core/type-relation-checker.d.ts +3 -3
- package/dist/src/core/type-relation-checker.d.ts.map +1 -1
- package/dist/src/core/type-relation-checker.js +1 -1
- package/dist/src/core/type-relation-checker.js.map +1 -1
- package/dist/src/core/type-utils.d.ts +1 -1
- package/dist/src/core/type-utils.d.ts.map +1 -1
- package/dist/src/core/type-utils.js +3 -3
- package/dist/src/core/type-utils.js.map +1 -1
- package/dist/src/core/types.d.ts +9 -0
- package/dist/src/core/types.d.ts.map +1 -1
- package/dist/src/core/types.js +81 -0
- package/dist/src/core/types.js.map +1 -1
- package/dist/src/core/visibility/core.d.ts +1 -1
- package/dist/src/core/visibility/core.d.ts.map +1 -1
- package/dist/src/experimental/index.d.ts +2 -1
- package/dist/src/experimental/index.d.ts.map +1 -1
- package/dist/src/experimental/index.js.map +1 -1
- package/dist/src/experimental/mutators.d.ts +2 -2
- package/dist/src/experimental/mutators.d.ts.map +1 -1
- package/dist/src/experimental/realm.d.ts +2 -2
- package/dist/src/experimental/realm.d.ts.map +1 -1
- package/dist/src/experimental/typekit/index.d.ts +1 -1
- package/dist/src/experimental/typekit/index.d.ts.map +1 -1
- package/dist/src/formatter/index.d.ts +1 -1
- package/dist/src/formatter/index.d.ts.map +1 -1
- package/dist/src/formatter/parser.d.ts +1 -1
- package/dist/src/formatter/parser.d.ts.map +1 -1
- package/dist/src/formatter/parser.js.map +1 -1
- package/dist/src/formatter/print/comment-handler.d.ts +1 -1
- package/dist/src/formatter/print/comment-handler.d.ts.map +1 -1
- package/dist/src/formatter/print/comment-handler.js.map +1 -1
- package/dist/src/formatter/print/index.d.ts +1 -1
- package/dist/src/formatter/print/index.d.ts.map +1 -1
- package/dist/src/formatter/print/index.js +0 -1
- package/dist/src/formatter/print/index.js.map +1 -1
- package/dist/src/formatter/print/needs-parens.d.ts +2 -2
- package/dist/src/formatter/print/needs-parens.d.ts.map +1 -1
- package/dist/src/formatter/print/needs-parens.js.map +1 -1
- package/dist/src/formatter/print/printer.d.ts +3 -3
- package/dist/src/formatter/print/printer.d.ts.map +1 -1
- package/dist/src/formatter/print/printer.js +2 -2
- package/dist/src/formatter/print/printer.js.map +1 -1
- package/dist/src/formatter/print/types.d.ts +1 -1
- package/dist/src/formatter/print/types.d.ts.map +1 -1
- package/dist/src/formatter/types.d.ts +1 -1
- package/dist/src/formatter/types.d.ts.map +1 -1
- package/dist/src/index.d.ts +10 -5
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -4
- package/dist/src/index.js.map +1 -1
- package/dist/src/init/init-template-validate.d.ts +1 -1
- package/dist/src/init/init-template-validate.d.ts.map +1 -1
- package/dist/src/init/init-template.d.ts +1 -1
- package/dist/src/init/init-template.d.ts.map +1 -1
- package/dist/src/init/init.d.ts +2 -2
- package/dist/src/init/init.d.ts.map +1 -1
- package/dist/src/init/init.js.map +1 -1
- package/dist/src/install/install.d.ts.map +1 -1
- package/dist/src/install/install.js +1 -1
- package/dist/src/install/install.js.map +1 -1
- package/dist/src/internals/index.d.ts +1 -1
- package/dist/src/internals/index.d.ts.map +1 -1
- package/dist/src/lib/decorators.d.ts +4 -4
- package/dist/src/lib/decorators.d.ts.map +1 -1
- package/dist/src/lib/decorators.js +1 -1
- package/dist/src/lib/decorators.js.map +1 -1
- package/dist/src/lib/examples.d.ts +1 -1
- package/dist/src/lib/examples.d.ts.map +1 -1
- package/dist/src/lib/intrinsic/decorators.d.ts.map +1 -1
- package/dist/src/lib/intrinsic/decorators.js.map +1 -1
- package/dist/src/lib/key.d.ts +2 -2
- package/dist/src/lib/key.d.ts.map +1 -1
- package/dist/src/lib/paging.d.ts +1 -1
- package/dist/src/lib/paging.d.ts.map +1 -1
- package/dist/src/lib/service.d.ts +1 -1
- package/dist/src/lib/service.d.ts.map +1 -1
- package/dist/src/lib/visibility.d.ts +1 -1
- package/dist/src/lib/visibility.d.ts.map +1 -1
- package/dist/src/lib/visibility.js +1 -1
- package/dist/src/lib/visibility.js.map +1 -1
- package/dist/src/module-resolver/esm/resolve-package-exports.d.ts +2 -2
- package/dist/src/module-resolver/esm/resolve-package-exports.d.ts.map +1 -1
- package/dist/src/module-resolver/esm/resolve-package-exports.js +1 -1
- package/dist/src/module-resolver/esm/resolve-package-exports.js.map +1 -1
- package/dist/src/module-resolver/esm/resolve-package-imports-exports.d.ts +2 -2
- package/dist/src/module-resolver/esm/resolve-package-imports-exports.d.ts.map +1 -1
- package/dist/src/module-resolver/esm/resolve-package-imports-exports.js.map +1 -1
- package/dist/src/module-resolver/esm/resolve-package-imports.d.ts +2 -2
- package/dist/src/module-resolver/esm/resolve-package-imports.d.ts.map +1 -1
- package/dist/src/module-resolver/esm/resolve-package-imports.js +1 -1
- package/dist/src/module-resolver/esm/resolve-package-imports.js.map +1 -1
- package/dist/src/module-resolver/esm/resolve-package-target.d.ts +2 -2
- package/dist/src/module-resolver/esm/resolve-package-target.d.ts.map +1 -1
- package/dist/src/module-resolver/esm/resolve-package-target.js +1 -1
- package/dist/src/module-resolver/esm/resolve-package-target.js.map +1 -1
- package/dist/src/module-resolver/module-resolver.d.ts +1 -1
- package/dist/src/module-resolver/module-resolver.d.ts.map +1 -1
- package/dist/src/module-resolver/module-resolver.js.map +1 -1
- package/dist/src/module-resolver/node-package-resolver.d.ts +1 -1
- package/dist/src/module-resolver/node-package-resolver.d.ts.map +1 -1
- package/dist/src/module-resolver/types.d.ts +1 -1
- package/dist/src/module-resolver/types.d.ts.map +1 -1
- package/dist/src/package-manger/npm-package-download.d.ts +1 -1
- package/dist/src/package-manger/npm-package-download.d.ts.map +1 -1
- package/dist/src/runner.d.ts.map +1 -1
- package/dist/src/runner.js.map +1 -1
- package/dist/src/server/classify.d.ts +2 -2
- package/dist/src/server/classify.d.ts.map +1 -1
- package/dist/src/server/classify.js +1 -1
- package/dist/src/server/classify.js.map +1 -1
- package/dist/src/server/client-config-provider.d.ts +1 -1
- package/dist/src/server/client-config-provider.d.ts.map +1 -1
- package/dist/src/server/compile-service.d.ts +9 -9
- package/dist/src/server/compile-service.d.ts.map +1 -1
- package/dist/src/server/compile-service.js +1 -1
- package/dist/src/server/compile-service.js.map +1 -1
- package/dist/src/server/completion.d.ts +3 -3
- package/dist/src/server/completion.d.ts.map +1 -1
- package/dist/src/server/completion.js +8 -8
- package/dist/src/server/completion.js.map +1 -1
- package/dist/src/server/constants.d.ts +1 -1
- package/dist/src/server/constants.d.ts.map +1 -1
- package/dist/src/server/diagnostics.d.ts +1 -1
- package/dist/src/server/diagnostics.d.ts.map +1 -1
- package/dist/src/server/diagnostics.js.map +1 -1
- package/dist/src/server/entrypoint-resolver.d.ts +3 -3
- package/dist/src/server/entrypoint-resolver.d.ts.map +1 -1
- package/dist/src/server/file-service.d.ts +3 -3
- package/dist/src/server/file-service.d.ts.map +1 -1
- package/dist/src/server/file-system-cache.d.ts +4 -4
- package/dist/src/server/file-system-cache.d.ts.map +1 -1
- package/dist/src/server/lib-provider.d.ts +1 -1
- package/dist/src/server/lib-provider.d.ts.map +1 -1
- package/dist/src/server/npm-package-provider.d.ts +3 -3
- package/dist/src/server/npm-package-provider.d.ts.map +1 -1
- package/dist/src/server/npm-package-provider.js.map +1 -1
- package/dist/src/server/rename-file.d.ts +1 -1
- package/dist/src/server/rename-file.d.ts.map +1 -1
- package/dist/src/server/server-compile-manager.d.ts +2 -2
- package/dist/src/server/server-compile-manager.d.ts.map +1 -1
- package/dist/src/server/server-compile-manager.js +1 -1
- package/dist/src/server/server-compile-manager.js.map +1 -1
- package/dist/src/server/server-track-action-task.d.ts +2 -2
- package/dist/src/server/server-track-action-task.d.ts.map +1 -1
- package/dist/src/server/server.js +1 -1
- package/dist/src/server/server.js.map +1 -1
- package/dist/src/server/serverlib.d.ts +2 -2
- package/dist/src/server/serverlib.d.ts.map +1 -1
- package/dist/src/server/serverlib.js +4 -3
- package/dist/src/server/serverlib.js.map +1 -1
- package/dist/src/server/symbol-structure.d.ts.map +1 -1
- package/dist/src/server/symbol-structure.js.map +1 -1
- package/dist/src/server/tspconfig/completion.d.ts +6 -5
- package/dist/src/server/tspconfig/completion.d.ts.map +1 -1
- package/dist/src/server/tspconfig/completion.js +1 -1
- package/dist/src/server/tspconfig/completion.js.map +1 -1
- package/dist/src/server/type-details.js.map +1 -1
- package/dist/src/server/type-signature.js +2 -2
- package/dist/src/server/type-signature.js.map +1 -1
- package/dist/src/server/types.d.ts +5 -5
- package/dist/src/server/types.d.ts.map +1 -1
- package/dist/src/server/types.js.map +1 -1
- package/dist/src/server/update-manager.d.ts +3 -3
- package/dist/src/server/update-manager.d.ts.map +1 -1
- package/dist/src/server/yaml-resolver.d.ts +3 -3
- package/dist/src/server/yaml-resolver.d.ts.map +1 -1
- package/dist/src/server/yaml-resolver.js +1 -1
- package/dist/src/server/yaml-resolver.js.map +1 -1
- package/dist/src/testing/fs.d.ts +1 -1
- package/dist/src/testing/fs.d.ts.map +1 -1
- package/dist/src/testing/fs.js.map +1 -1
- package/dist/src/testing/rule-tester.d.ts +4 -4
- package/dist/src/testing/rule-tester.d.ts.map +1 -1
- package/dist/src/testing/rule-tester.js.map +1 -1
- package/dist/src/testing/test-compiler-host.d.ts +2 -2
- package/dist/src/testing/test-compiler-host.d.ts.map +1 -1
- package/dist/src/testing/test-compiler-host.js.map +1 -1
- package/dist/src/testing/test-host.d.ts +1 -1
- package/dist/src/testing/test-host.d.ts.map +1 -1
- package/dist/src/testing/test-host.js.map +1 -1
- package/dist/src/testing/test-server-host.d.ts +5 -5
- package/dist/src/testing/test-server-host.d.ts.map +1 -1
- package/dist/src/testing/test-server-host.js.map +1 -1
- package/dist/src/testing/test-utils.d.ts +2 -2
- package/dist/src/testing/test-utils.d.ts.map +1 -1
- package/dist/src/testing/tester.d.ts +1 -1
- package/dist/src/testing/tester.d.ts.map +1 -1
- package/dist/src/testing/tester.js.map +1 -1
- package/dist/src/testing/types.d.ts +3 -3
- package/dist/src/testing/types.d.ts.map +1 -1
- package/dist/src/typekit/create-diagnosable.d.ts +2 -2
- package/dist/src/typekit/create-diagnosable.d.ts.map +1 -1
- package/dist/src/typekit/define-kit.d.ts +2 -2
- package/dist/src/typekit/define-kit.d.ts.map +1 -1
- package/dist/src/typekit/index.d.ts +5 -3
- package/dist/src/typekit/index.d.ts.map +1 -1
- package/dist/src/typekit/index.js +1 -1
- package/dist/src/typekit/index.js.map +1 -1
- package/dist/src/typekit/kits/array.d.ts +1 -1
- package/dist/src/typekit/kits/array.d.ts.map +1 -1
- package/dist/src/typekit/kits/entity.d.ts +1 -1
- 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 +1 -1
- 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 +1 -1
- 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/literal.d.ts +1 -1
- package/dist/src/typekit/kits/literal.d.ts.map +1 -1
- package/dist/src/typekit/kits/model-property.d.ts +1 -1
- package/dist/src/typekit/kits/model-property.d.ts.map +1 -1
- package/dist/src/typekit/kits/model-property.js.map +1 -1
- package/dist/src/typekit/kits/model.d.ts +3 -3
- package/dist/src/typekit/kits/model.d.ts.map +1 -1
- package/dist/src/typekit/kits/model.js +1 -1
- package/dist/src/typekit/kits/model.js.map +1 -1
- package/dist/src/typekit/kits/operation.d.ts +3 -3
- package/dist/src/typekit/kits/operation.d.ts.map +1 -1
- package/dist/src/typekit/kits/operation.js.map +1 -1
- package/dist/src/typekit/kits/record.d.ts +1 -1
- package/dist/src/typekit/kits/record.d.ts.map +1 -1
- package/dist/src/typekit/kits/tuple.d.ts +1 -1
- package/dist/src/typekit/kits/tuple.d.ts.map +1 -1
- package/dist/src/typekit/kits/type.d.ts +2 -2
- 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/union-variant.d.ts +1 -1
- package/dist/src/typekit/kits/union-variant.d.ts.map +1 -1
- package/dist/src/typekit/kits/union-variant.js.map +1 -1
- package/dist/src/typekit/kits/union.d.ts +3 -3
- package/dist/src/typekit/kits/union.d.ts.map +1 -1
- package/dist/src/typekit/kits/union.js +1 -1
- package/dist/src/typekit/kits/union.js.map +1 -1
- package/dist/src/typekit/kits/value.d.ts +1 -1
- package/dist/src/typekit/kits/value.d.ts.map +1 -1
- package/dist/src/typekit/kits/value.js.map +1 -1
- package/dist/src/typekit/utils/get-plausible-name.d.ts +1 -1
- package/dist/src/typekit/utils/get-plausible-name.d.ts.map +1 -1
- package/dist/src/typekit/utils.d.ts +1 -1
- package/dist/src/typekit/utils.d.ts.map +1 -1
- package/dist/src/utils/io.d.ts +3 -2
- package/dist/src/utils/io.d.ts.map +1 -1
- package/dist/src/utils/io.js +1 -1
- package/dist/src/utils/io.js.map +1 -1
- package/dist/src/yaml/diagnostics.d.ts +2 -2
- package/dist/src/yaml/diagnostics.d.ts.map +1 -1
- package/dist/src/yaml/diagnostics.js.map +1 -1
- package/dist/src/yaml/index.d.ts +1 -1
- package/dist/src/yaml/index.d.ts.map +1 -1
- package/dist/src/yaml/index.js +0 -1
- package/dist/src/yaml/index.js.map +1 -1
- package/dist/src/yaml/parser.d.ts +2 -2
- package/dist/src/yaml/parser.d.ts.map +1 -1
- package/dist/src/yaml/parser.js.map +1 -1
- package/dist/src/yaml/types.d.ts +1 -1
- package/dist/src/yaml/types.d.ts.map +1 -1
- package/package.json +5 -5
- package/templates/__snapshots__/empty/main.tsp +0 -0
- package/templates/__snapshots__/empty/package.json +9 -0
- package/templates/__snapshots__/empty/tspconfig.yaml +18 -0
- package/templates/scaffolding.json +9 -0
package/dist/src/core/checker.js
CHANGED
|
@@ -22,7 +22,7 @@ import { Numeric } from "./numeric.js";
|
|
|
22
22
|
import { exprIsBareIdentifier, getFirstAncestor, getIdentifierContext, hasParseError, visitChildren, } from "./parser.js";
|
|
23
23
|
import { createTypeRelationChecker } from "./type-relation-checker.js";
|
|
24
24
|
import { getFullyQualifiedSymbolName, getParentTemplateNode, isArrayModelType, isErrorType, isNullType, isTemplateInstance, isType, isValue, } from "./type-utils.js";
|
|
25
|
-
import { IdentifierKind, ResolutionResultFlags, SyntaxKind, } from "./types.js";
|
|
25
|
+
import { IdentifierKind, ModifierFlags, ResolutionResultFlags, SymbolFlags, SyntaxKind, } from "./types.js";
|
|
26
26
|
var CheckFlags;
|
|
27
27
|
(function (CheckFlags) {
|
|
28
28
|
/** No flags set. */
|
|
@@ -229,7 +229,7 @@ export function createChecker(program, resolver) {
|
|
|
229
229
|
function initializeTypeSpecIntrinsics() {
|
|
230
230
|
// a utility function to log strings or numbers
|
|
231
231
|
mutate(typespecNamespaceBinding.exports).set("log", {
|
|
232
|
-
flags:
|
|
232
|
+
flags: SymbolFlags.Function,
|
|
233
233
|
name: "log",
|
|
234
234
|
value(p, ...strs) {
|
|
235
235
|
program.trace("log", strs.join(" "));
|
|
@@ -245,7 +245,7 @@ export function createChecker(program, resolver) {
|
|
|
245
245
|
];
|
|
246
246
|
for (const decorator of internalDecorators) {
|
|
247
247
|
if (decorator) {
|
|
248
|
-
mutate(decorator).flags |=
|
|
248
|
+
mutate(decorator).flags |= SymbolFlags.Internal;
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
// Until we have an `unit` type for `null`
|
|
@@ -259,7 +259,7 @@ export function createChecker(program, resolver) {
|
|
|
259
259
|
}
|
|
260
260
|
const sym = typespecNamespaceBinding?.exports?.get(name);
|
|
261
261
|
compilerAssert(sym, `Unexpected missing symbol to std type "${name}"`);
|
|
262
|
-
if (sym.flags &
|
|
262
|
+
if (sym.flags & SymbolFlags.Model) {
|
|
263
263
|
checkModelStatement(CheckContext.DEFAULT, sym.declarations[0]);
|
|
264
264
|
}
|
|
265
265
|
else {
|
|
@@ -1013,27 +1013,27 @@ export function createChecker(program, resolver) {
|
|
|
1013
1013
|
return entity;
|
|
1014
1014
|
}
|
|
1015
1015
|
function checkTypeOrValueReferenceSymbolWorker(ctx, sym, node, instantiateTemplates = true) {
|
|
1016
|
-
if (sym.flags &
|
|
1016
|
+
if (sym.flags & SymbolFlags.Const) {
|
|
1017
1017
|
return getValueForNode(sym.declarations[0], ctx.mapper);
|
|
1018
1018
|
}
|
|
1019
|
-
if (sym.flags &
|
|
1019
|
+
if (sym.flags & SymbolFlags.Decorator) {
|
|
1020
1020
|
reportCheckerDiagnostic(createDiagnostic({ code: "invalid-type-ref", messageId: "decorator", target: sym }));
|
|
1021
1021
|
return errorType;
|
|
1022
1022
|
}
|
|
1023
|
-
if (sym.flags &
|
|
1023
|
+
if (sym.flags & SymbolFlags.Function) {
|
|
1024
1024
|
return getValueForNode(sym.declarations[0], ctx);
|
|
1025
1025
|
}
|
|
1026
1026
|
const argumentNodes = node.kind === SyntaxKind.TypeReference ? node.arguments : [];
|
|
1027
1027
|
const symbolLinks = getSymbolLinks(sym);
|
|
1028
1028
|
let baseType;
|
|
1029
|
-
if (sym.flags &
|
|
1029
|
+
if (sym.flags & SymbolFlags.Declaration &&
|
|
1030
1030
|
sym.flags &
|
|
1031
|
-
(
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1031
|
+
(SymbolFlags.Model |
|
|
1032
|
+
SymbolFlags.Scalar |
|
|
1033
|
+
SymbolFlags.Alias |
|
|
1034
|
+
SymbolFlags.Interface |
|
|
1035
|
+
SymbolFlags.Operation |
|
|
1036
|
+
SymbolFlags.Union)) {
|
|
1037
1037
|
const decl = sym.declarations[0];
|
|
1038
1038
|
if (!isTemplatedNode(decl)) {
|
|
1039
1039
|
// Not a templated node, and we are moving through a typeref to a new declaration.
|
|
@@ -1049,14 +1049,14 @@ export function createChecker(program, resolver) {
|
|
|
1049
1049
|
target: node,
|
|
1050
1050
|
}));
|
|
1051
1051
|
}
|
|
1052
|
-
if (sym.flags &
|
|
1052
|
+
if (sym.flags & SymbolFlags.LateBound) {
|
|
1053
1053
|
compilerAssert(sym.type, "Expected late bound symbol to have type");
|
|
1054
1054
|
return sym.type;
|
|
1055
1055
|
}
|
|
1056
1056
|
else if (symbolLinks.declaredType) {
|
|
1057
1057
|
baseType = symbolLinks.declaredType;
|
|
1058
1058
|
}
|
|
1059
|
-
else if (sym.flags &
|
|
1059
|
+
else if (sym.flags & SymbolFlags.Member) {
|
|
1060
1060
|
baseType = checkMemberSym(innerCtx, sym);
|
|
1061
1061
|
}
|
|
1062
1062
|
else {
|
|
@@ -1089,11 +1089,11 @@ export function createChecker(program, resolver) {
|
|
|
1089
1089
|
target: node,
|
|
1090
1090
|
}));
|
|
1091
1091
|
}
|
|
1092
|
-
if (sym.flags &
|
|
1092
|
+
if (sym.flags & SymbolFlags.LateBound) {
|
|
1093
1093
|
compilerAssert(sym.type, `Expected late bound symbol to have type`);
|
|
1094
1094
|
return sym.type;
|
|
1095
1095
|
}
|
|
1096
|
-
else if (sym.flags &
|
|
1096
|
+
else if (sym.flags & SymbolFlags.TemplateParameter) {
|
|
1097
1097
|
const mapped = checkTemplateParameterDeclaration(ctx, symNode);
|
|
1098
1098
|
baseType = mapped;
|
|
1099
1099
|
}
|
|
@@ -1105,7 +1105,7 @@ export function createChecker(program, resolver) {
|
|
|
1105
1105
|
baseType = symbolLinks.declaredType;
|
|
1106
1106
|
}
|
|
1107
1107
|
else {
|
|
1108
|
-
if (sym.flags &
|
|
1108
|
+
if (sym.flags & SymbolFlags.Member) {
|
|
1109
1109
|
baseType = checkMemberSym(ctx, sym);
|
|
1110
1110
|
}
|
|
1111
1111
|
else {
|
|
@@ -1143,11 +1143,11 @@ export function createChecker(program, resolver) {
|
|
|
1143
1143
|
if (symbolLinks.declaredType) {
|
|
1144
1144
|
return symbolLinks.declaredType;
|
|
1145
1145
|
}
|
|
1146
|
-
if (sym.flags &
|
|
1146
|
+
if (sym.flags & SymbolFlags.LateBound) {
|
|
1147
1147
|
compilerAssert(sym.type, "Expected late bound symbol to have type");
|
|
1148
1148
|
return sym.type;
|
|
1149
1149
|
}
|
|
1150
|
-
if (sym.flags &
|
|
1150
|
+
if (sym.flags & SymbolFlags.Member) {
|
|
1151
1151
|
return checkMemberSym(ctx, sym);
|
|
1152
1152
|
}
|
|
1153
1153
|
else {
|
|
@@ -1162,15 +1162,15 @@ export function createChecker(program, resolver) {
|
|
|
1162
1162
|
* @returns The declared type for the given node.
|
|
1163
1163
|
*/
|
|
1164
1164
|
function checkDeclaredTypeOrIndeterminate(ctx, sym, node) {
|
|
1165
|
-
const type = sym.flags &
|
|
1165
|
+
const type = sym.flags & SymbolFlags.Model
|
|
1166
1166
|
? checkModelStatement(ctx, node)
|
|
1167
|
-
: sym.flags &
|
|
1167
|
+
: sym.flags & SymbolFlags.Scalar
|
|
1168
1168
|
? checkScalar(ctx, node)
|
|
1169
|
-
: sym.flags &
|
|
1169
|
+
: sym.flags & SymbolFlags.Alias
|
|
1170
1170
|
? checkAlias(ctx, node)
|
|
1171
|
-
: sym.flags &
|
|
1171
|
+
: sym.flags & SymbolFlags.Interface
|
|
1172
1172
|
? checkInterface(ctx, node)
|
|
1173
|
-
: sym.flags &
|
|
1173
|
+
: sym.flags & SymbolFlags.Operation
|
|
1174
1174
|
? checkOperation(ctx, node)
|
|
1175
1175
|
: checkUnion(ctx, node);
|
|
1176
1176
|
return type;
|
|
@@ -1372,7 +1372,7 @@ export function createChecker(program, resolver) {
|
|
|
1372
1372
|
const namespace = getParentNamespaceType(node);
|
|
1373
1373
|
compilerAssert(namespace, `Decorator ${node.id.sv} should have resolved a namespace or found the global namespace.`);
|
|
1374
1374
|
const name = node.id.sv;
|
|
1375
|
-
const isAuto = (node.modifierFlags &
|
|
1375
|
+
const isAuto = (node.modifierFlags & ModifierFlags.Auto) !== 0;
|
|
1376
1376
|
if (isAuto && !isCompilerFeatureEnabled(program, "auto-decorators", node)) {
|
|
1377
1377
|
reportCheckerDiagnostic(createDiagnostic({
|
|
1378
1378
|
code: "auto-decorator-disabled",
|
|
@@ -1936,7 +1936,7 @@ export function createChecker(program, resolver) {
|
|
|
1936
1936
|
if (sym) {
|
|
1937
1937
|
const relatedSource = getRelatedSymbolSource(sym);
|
|
1938
1938
|
if (relatedSource) {
|
|
1939
|
-
return sym.flags &
|
|
1939
|
+
return sym.flags & SymbolFlags.LateBound ? [sym, relatedSource] : [relatedSource];
|
|
1940
1940
|
}
|
|
1941
1941
|
return [sym];
|
|
1942
1942
|
}
|
|
@@ -2236,13 +2236,13 @@ export function createChecker(program, resolver) {
|
|
|
2236
2236
|
const memberExpression = identifier.parent;
|
|
2237
2237
|
let baseType = getCompletionBaseType(memberExpression.base);
|
|
2238
2238
|
let base = resolver.getNodeLinks(memberExpression.base).resolvedSymbol;
|
|
2239
|
-
if (base && base.flags &
|
|
2239
|
+
if (base && base.flags & SymbolFlags.Alias) {
|
|
2240
2240
|
base = getAliasedSymbol(CheckContext.DEFAULT, base);
|
|
2241
2241
|
}
|
|
2242
2242
|
if (!baseType && base) {
|
|
2243
2243
|
baseType = getCompletionBaseTypeFromSymbol(base);
|
|
2244
2244
|
}
|
|
2245
|
-
if (baseType && (!base || !!(base.flags &
|
|
2245
|
+
if (baseType && (!base || !!(base.flags & SymbolFlags.TemplateParameter))) {
|
|
2246
2246
|
if (memberExpression.selector === "::") {
|
|
2247
2247
|
addMetaCompletionsForType(baseType);
|
|
2248
2248
|
}
|
|
@@ -2298,10 +2298,13 @@ export function createChecker(program, resolver) {
|
|
|
2298
2298
|
scope = scope.parent;
|
|
2299
2299
|
}
|
|
2300
2300
|
if (scope && scope.kind === SyntaxKind.TypeSpecScript) {
|
|
2301
|
-
//
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2301
|
+
// The name of a `using` declared before the file namespace resolves from the global namespace only.
|
|
2302
|
+
if (!isUsingBeforeFileNamespace(identifier)) {
|
|
2303
|
+
// check any blockless namespace decls
|
|
2304
|
+
for (const ns of scope.inScopeNamespaces) {
|
|
2305
|
+
const mergedSymbol = getMergedSymbol(ns.symbol);
|
|
2306
|
+
addCompletions(mergedSymbol.exports);
|
|
2307
|
+
}
|
|
2305
2308
|
}
|
|
2306
2309
|
// check "global scope" declarations
|
|
2307
2310
|
addCompletions(resolver.symbols.global.exports);
|
|
@@ -2330,13 +2333,13 @@ export function createChecker(program, resolver) {
|
|
|
2330
2333
|
}
|
|
2331
2334
|
/** Resolve a completion base type from a symbol when node-based typing is unavailable. */
|
|
2332
2335
|
function getCompletionBaseTypeFromSymbol(base) {
|
|
2333
|
-
if (base.flags &
|
|
2336
|
+
if (base.flags & SymbolFlags.LateBound) {
|
|
2334
2337
|
const lateBoundType = base.type;
|
|
2335
2338
|
return lateBoundType && isType(lateBoundType)
|
|
2336
2339
|
? resolveCompletionType(lateBoundType)
|
|
2337
2340
|
: undefined;
|
|
2338
2341
|
}
|
|
2339
|
-
if (base.flags &
|
|
2342
|
+
if (base.flags & SymbolFlags.TemplateParameter) {
|
|
2340
2343
|
const mapped = checkTemplateParameterDeclaration(CheckContext.DEFAULT, getSymNode(base));
|
|
2341
2344
|
return isType(mapped) ? resolveCompletionType(mapped) : undefined;
|
|
2342
2345
|
}
|
|
@@ -2411,10 +2414,10 @@ export function createChecker(program, resolver) {
|
|
|
2411
2414
|
}
|
|
2412
2415
|
table = resolver.getAugmentedSymbolTable(table);
|
|
2413
2416
|
for (const [key, sym] of table) {
|
|
2414
|
-
if (sym.flags &
|
|
2417
|
+
if (sym.flags & SymbolFlags.DuplicateUsing) {
|
|
2415
2418
|
const duplicates = table.duplicates.get(sym);
|
|
2416
2419
|
for (const duplicate of duplicates) {
|
|
2417
|
-
if (duplicate.flags &
|
|
2420
|
+
if (duplicate.flags & SymbolFlags.Using) {
|
|
2418
2421
|
const fqn = getFullyQualifiedSymbolName(duplicate.symbolSource);
|
|
2419
2422
|
addCompletion(fqn, duplicate);
|
|
2420
2423
|
}
|
|
@@ -2426,7 +2429,7 @@ export function createChecker(program, resolver) {
|
|
|
2426
2429
|
}
|
|
2427
2430
|
}
|
|
2428
2431
|
function addCompletion(key, sym, options = {}) {
|
|
2429
|
-
if (sym.symbolSource && !(sym.flags &
|
|
2432
|
+
if (sym.symbolSource && !(sym.flags & SymbolFlags.LateBound)) {
|
|
2430
2433
|
sym = sym.symbolSource;
|
|
2431
2434
|
}
|
|
2432
2435
|
if (!shouldAddCompletion(sym)) {
|
|
@@ -2444,21 +2447,21 @@ export function createChecker(program, resolver) {
|
|
|
2444
2447
|
case IdentifierKind.ModelExpressionProperty:
|
|
2445
2448
|
case IdentifierKind.ModelStatementProperty:
|
|
2446
2449
|
case IdentifierKind.ObjectLiteralProperty:
|
|
2447
|
-
return !!(sym.flags &
|
|
2450
|
+
return !!(sym.flags & SymbolFlags.Member);
|
|
2448
2451
|
case IdentifierKind.Decorator:
|
|
2449
2452
|
// Only return decorators and namespaces when completing decorator
|
|
2450
|
-
return !!(sym.flags & (
|
|
2453
|
+
return !!(sym.flags & (SymbolFlags.Decorator | SymbolFlags.Namespace));
|
|
2451
2454
|
case IdentifierKind.Function:
|
|
2452
2455
|
// Only return functions and namespaces when completing function calls
|
|
2453
|
-
return !!(sym.flags & (
|
|
2456
|
+
return !!(sym.flags & (SymbolFlags.Function | SymbolFlags.Namespace));
|
|
2454
2457
|
case IdentifierKind.Using:
|
|
2455
2458
|
// Only return namespaces when completing using
|
|
2456
|
-
return !!(sym.flags &
|
|
2459
|
+
return !!(sym.flags & SymbolFlags.Namespace);
|
|
2457
2460
|
case IdentifierKind.TypeReference:
|
|
2458
2461
|
// Do not return decorators when completing types
|
|
2459
|
-
return !(sym.flags &
|
|
2462
|
+
return !(sym.flags & SymbolFlags.Decorator);
|
|
2460
2463
|
case IdentifierKind.TemplateArgument:
|
|
2461
|
-
return !!(sym.flags &
|
|
2464
|
+
return !!(sym.flags & SymbolFlags.TemplateParameter);
|
|
2462
2465
|
default:
|
|
2463
2466
|
compilerAssert(false, "We should have bailed up-front on other kinds.");
|
|
2464
2467
|
}
|
|
@@ -2531,7 +2534,7 @@ export function createChecker(program, resolver) {
|
|
|
2531
2534
|
return directTemplateAccessSym;
|
|
2532
2535
|
}
|
|
2533
2536
|
// when resolving a type reference based on an alias, unwrap the alias.
|
|
2534
|
-
if (base.flags &
|
|
2537
|
+
if (base.flags & SymbolFlags.Alias) {
|
|
2535
2538
|
if (!options.resolveDeclarationOfTemplate && isTemplatedNode(getSymNode(base))) {
|
|
2536
2539
|
// This is a bare identifier reference to a templated alias, so we need to actually check this type.
|
|
2537
2540
|
const ty = checkTypeReferenceSymbol(ctx.withMapper(undefined), base, node.base,
|
|
@@ -2629,7 +2632,7 @@ export function createChecker(program, resolver) {
|
|
|
2629
2632
|
* @returns A concrete or late-bound symbol for the mapped access, or `undefined`.
|
|
2630
2633
|
*/
|
|
2631
2634
|
function tryResolveMappedTemplateAccessSymbol(ctx, node, baseSym) {
|
|
2632
|
-
if (!ctx.mapper || !(baseSym.flags &
|
|
2635
|
+
if (!ctx.mapper || !(baseSym.flags & SymbolFlags.TemplateParameter)) {
|
|
2633
2636
|
return undefined;
|
|
2634
2637
|
}
|
|
2635
2638
|
const declared = checkTemplateParameterDeclaration(CheckContext.DEFAULT, getSymNode(baseSym));
|
|
@@ -2705,14 +2708,14 @@ export function createChecker(program, resolver) {
|
|
|
2705
2708
|
* Resolve the template entity (parameter or access) that acts as the base for a member expression.
|
|
2706
2709
|
*/
|
|
2707
2710
|
function getTemplateAccessBaseEntity(_ctx, baseNode, baseSym) {
|
|
2708
|
-
if (baseSym.flags &
|
|
2711
|
+
if (baseSym.flags & SymbolFlags.LateBound) {
|
|
2709
2712
|
const lateBoundType = baseSym.type;
|
|
2710
2713
|
if (lateBoundType && lateBoundType.kind === "TemplateParameterAccess") {
|
|
2711
2714
|
return lateBoundType;
|
|
2712
2715
|
}
|
|
2713
2716
|
return undefined;
|
|
2714
2717
|
}
|
|
2715
|
-
if (baseSym.flags &
|
|
2718
|
+
if (baseSym.flags & SymbolFlags.TemplateParameter) {
|
|
2716
2719
|
const baseSymbolNode = getSymNode(baseSym);
|
|
2717
2720
|
const mapped = checkTemplateParameterDeclaration(CheckContext.DEFAULT, baseSymbolNode);
|
|
2718
2721
|
return isType(mapped) && isTemplateAccessType(mapped) ? mapped : undefined;
|
|
@@ -2908,7 +2911,7 @@ export function createChecker(program, resolver) {
|
|
|
2908
2911
|
return undefined;
|
|
2909
2912
|
}
|
|
2910
2913
|
let memberSymbol = getMemberSymbol(containerSymbol, memberName);
|
|
2911
|
-
if (!memberSymbol?.type && containerSymbol.flags &
|
|
2914
|
+
if (!memberSymbol?.type && containerSymbol.flags & SymbolFlags.LateBound) {
|
|
2912
2915
|
lateBindMembers(containerType);
|
|
2913
2916
|
memberSymbol = getMemberSymbol(containerSymbol, memberName);
|
|
2914
2917
|
}
|
|
@@ -3030,7 +3033,7 @@ export function createChecker(program, resolver) {
|
|
|
3030
3033
|
constraint,
|
|
3031
3034
|
});
|
|
3032
3035
|
templateAccessCacheKeys.set(type, cacheKey);
|
|
3033
|
-
const symbol = createSymbol(node, node.id.sv,
|
|
3036
|
+
const symbol = createSymbol(node, node.id.sv, SymbolFlags.LateBound);
|
|
3034
3037
|
mutate(symbol).type = type;
|
|
3035
3038
|
if (useCache) {
|
|
3036
3039
|
templateAccessSymbolCache.set(cacheKey, symbol);
|
|
@@ -3071,8 +3074,8 @@ export function createChecker(program, resolver) {
|
|
|
3071
3074
|
function checkSymbolAccess(sourceLocation, node, symbol) {
|
|
3072
3075
|
if (!symbol)
|
|
3073
3076
|
return;
|
|
3074
|
-
const isInternalDeclaration = (symbol.flags & (
|
|
3075
|
-
(
|
|
3077
|
+
const isInternalDeclaration = (symbol.flags & (SymbolFlags.Internal | SymbolFlags.Declaration)) ===
|
|
3078
|
+
(SymbolFlags.Internal | SymbolFlags.Declaration);
|
|
3076
3079
|
if (isInternalDeclaration) {
|
|
3077
3080
|
// The source location can access internal declaration symbols if:
|
|
3078
3081
|
// 1. The source location is synthetic.
|
|
@@ -3124,13 +3127,13 @@ export function createChecker(program, resolver) {
|
|
|
3124
3127
|
// When the member wasn't found but the container has unknown members (e.g. from
|
|
3125
3128
|
// template spreads or `is`), force-check the container type so that late-bound
|
|
3126
3129
|
// members become available, then retry the lookup.
|
|
3127
|
-
if (node.selector === "." && base.flags &
|
|
3130
|
+
if (node.selector === "." && base.flags & SymbolFlags.MemberContainer) {
|
|
3128
3131
|
const resolvedMember = tryForceResolveLateBoundMember(ctx, base, node);
|
|
3129
3132
|
if (resolvedMember) {
|
|
3130
3133
|
return resolvedMember;
|
|
3131
3134
|
}
|
|
3132
3135
|
}
|
|
3133
|
-
if (base.flags &
|
|
3136
|
+
if (base.flags & SymbolFlags.Namespace) {
|
|
3134
3137
|
reportCheckerDiagnostic(createDiagnostic({
|
|
3135
3138
|
code: "invalid-ref",
|
|
3136
3139
|
messageId: "underNamespace",
|
|
@@ -3141,7 +3144,7 @@ export function createChecker(program, resolver) {
|
|
|
3141
3144
|
target: node,
|
|
3142
3145
|
}));
|
|
3143
3146
|
}
|
|
3144
|
-
else if (base.flags &
|
|
3147
|
+
else if (base.flags & SymbolFlags.Decorator) {
|
|
3145
3148
|
reportCheckerDiagnostic(createDiagnostic({
|
|
3146
3149
|
code: "invalid-ref",
|
|
3147
3150
|
messageId: "inDecorator",
|
|
@@ -3149,7 +3152,7 @@ export function createChecker(program, resolver) {
|
|
|
3149
3152
|
target: node,
|
|
3150
3153
|
}));
|
|
3151
3154
|
}
|
|
3152
|
-
else if (base.flags &
|
|
3155
|
+
else if (base.flags & SymbolFlags.Function) {
|
|
3153
3156
|
reportCheckerDiagnostic(createDiagnostic({
|
|
3154
3157
|
code: "invalid-ref",
|
|
3155
3158
|
messageId: "node",
|
|
@@ -3157,7 +3160,7 @@ export function createChecker(program, resolver) {
|
|
|
3157
3160
|
target: node,
|
|
3158
3161
|
}));
|
|
3159
3162
|
}
|
|
3160
|
-
else if (base.flags &
|
|
3163
|
+
else if (base.flags & SymbolFlags.MemberContainer) {
|
|
3161
3164
|
reportCheckerDiagnostic(createDiagnostic({
|
|
3162
3165
|
code: "invalid-ref",
|
|
3163
3166
|
messageId: node.selector === "." ? "member" : "metaProperty",
|
|
@@ -3284,17 +3287,17 @@ export function createChecker(program, resolver) {
|
|
|
3284
3287
|
}
|
|
3285
3288
|
/** Resolve the effective type used for member lookup on a base symbol. */
|
|
3286
3289
|
function getMemberResolutionType(_ctx, base) {
|
|
3287
|
-
if (base.flags &
|
|
3290
|
+
if (base.flags & SymbolFlags.LateBound) {
|
|
3288
3291
|
return base.type && isType(base.type) ? base.type : undefined;
|
|
3289
3292
|
}
|
|
3290
|
-
if (base.flags &
|
|
3293
|
+
if (base.flags & SymbolFlags.Member) {
|
|
3291
3294
|
return base.type && isType(base.type) ? base.type : undefined;
|
|
3292
3295
|
}
|
|
3293
3296
|
return undefined;
|
|
3294
3297
|
}
|
|
3295
3298
|
/** Create a late-bound symbol carrying a precomputed type for member resolution. */
|
|
3296
3299
|
function createLateBoundTypeSymbol(node, type) {
|
|
3297
|
-
const symbol = createSymbol(node, node.id.sv,
|
|
3300
|
+
const symbol = createSymbol(node, node.id.sv, SymbolFlags.LateBound);
|
|
3298
3301
|
mutate(symbol).type = type;
|
|
3299
3302
|
const symbolSource = getTemplateAccessSymbolSource(type);
|
|
3300
3303
|
if (symbolSource) {
|
|
@@ -3591,7 +3594,7 @@ export function createChecker(program, resolver) {
|
|
|
3591
3594
|
if (!exports)
|
|
3592
3595
|
return;
|
|
3593
3596
|
for (const sym of exports.values()) {
|
|
3594
|
-
if (sym.flags &
|
|
3597
|
+
if (sym.flags & SymbolFlags.Function && sym.flags & SymbolFlags.Implementation) {
|
|
3595
3598
|
const merged = getMergedSymbol(sym);
|
|
3596
3599
|
const hasFunctionDeclaration = merged.declarations.some((d) => d.kind === SyntaxKind.FunctionDeclarationStatement);
|
|
3597
3600
|
if (!hasFunctionDeclaration) {
|
|
@@ -3603,7 +3606,7 @@ export function createChecker(program, resolver) {
|
|
|
3603
3606
|
}
|
|
3604
3607
|
}
|
|
3605
3608
|
// Recurse into namespace symbols
|
|
3606
|
-
if (sym.flags &
|
|
3609
|
+
if (sym.flags & SymbolFlags.Namespace && sym.exports) {
|
|
3607
3610
|
checkSymbolTableForOrphanedFunctions(sym.exports, sourceFile);
|
|
3608
3611
|
}
|
|
3609
3612
|
}
|
|
@@ -4692,22 +4695,22 @@ export function createChecker(program, resolver) {
|
|
|
4692
4695
|
function lateBindMemberContainer(type) {
|
|
4693
4696
|
const existingSymbol = type.symbol;
|
|
4694
4697
|
if (existingSymbol &&
|
|
4695
|
-
!(isTemplateInstance(type) && !(existingSymbol.flags &
|
|
4698
|
+
!(isTemplateInstance(type) && !(existingSymbol.flags & SymbolFlags.LateBound))) {
|
|
4696
4699
|
return;
|
|
4697
4700
|
}
|
|
4698
4701
|
switch (type.kind) {
|
|
4699
4702
|
case "Model":
|
|
4700
|
-
type.symbol = createSymbol(type.node, type.name,
|
|
4703
|
+
type.symbol = createSymbol(type.node, type.name, SymbolFlags.Model | SymbolFlags.LateBound);
|
|
4701
4704
|
mutate(type.symbol).type = type;
|
|
4702
4705
|
break;
|
|
4703
4706
|
case "Interface":
|
|
4704
|
-
type.symbol = createSymbol(type.node, type.name,
|
|
4707
|
+
type.symbol = createSymbol(type.node, type.name, SymbolFlags.Interface | SymbolFlags.LateBound);
|
|
4705
4708
|
mutate(type.symbol).type = type;
|
|
4706
4709
|
break;
|
|
4707
4710
|
case "Union":
|
|
4708
4711
|
if (!type.name)
|
|
4709
4712
|
return; // don't make a symbol for anonymous unions
|
|
4710
|
-
type.symbol = createSymbol(type.node, type.name,
|
|
4713
|
+
type.symbol = createSymbol(type.node, type.name, SymbolFlags.Union | SymbolFlags.LateBound);
|
|
4711
4714
|
mutate(type.symbol).type = type;
|
|
4712
4715
|
break;
|
|
4713
4716
|
}
|
|
@@ -4720,27 +4723,27 @@ export function createChecker(program, resolver) {
|
|
|
4720
4723
|
switch (type.kind) {
|
|
4721
4724
|
case "Model":
|
|
4722
4725
|
for (const prop of walkPropertiesInherited(type)) {
|
|
4723
|
-
lateBindMember(prop,
|
|
4726
|
+
lateBindMember(prop, SymbolFlags.Member | SymbolFlags.Declaration);
|
|
4724
4727
|
}
|
|
4725
4728
|
break;
|
|
4726
4729
|
case "Scalar":
|
|
4727
4730
|
for (const member of type.constructors.values()) {
|
|
4728
|
-
lateBindMember(member,
|
|
4731
|
+
lateBindMember(member, SymbolFlags.Member | SymbolFlags.Declaration);
|
|
4729
4732
|
}
|
|
4730
4733
|
break;
|
|
4731
4734
|
case "Enum":
|
|
4732
4735
|
for (const member of type.members.values()) {
|
|
4733
|
-
lateBindMember(member,
|
|
4736
|
+
lateBindMember(member, SymbolFlags.Member | SymbolFlags.Declaration);
|
|
4734
4737
|
}
|
|
4735
4738
|
break;
|
|
4736
4739
|
case "Interface":
|
|
4737
4740
|
for (const member of type.operations.values()) {
|
|
4738
|
-
lateBindMember(member,
|
|
4741
|
+
lateBindMember(member, SymbolFlags.Member | SymbolFlags.Operation | SymbolFlags.Declaration);
|
|
4739
4742
|
}
|
|
4740
4743
|
break;
|
|
4741
4744
|
case "Union":
|
|
4742
4745
|
for (const variant of type.variants.values()) {
|
|
4743
|
-
lateBindMember(variant,
|
|
4746
|
+
lateBindMember(variant, SymbolFlags.Member | SymbolFlags.Declaration);
|
|
4744
4747
|
}
|
|
4745
4748
|
break;
|
|
4746
4749
|
}
|
|
@@ -4749,7 +4752,7 @@ export function createChecker(program, resolver) {
|
|
|
4749
4752
|
// don't bind anything for union expressions
|
|
4750
4753
|
return;
|
|
4751
4754
|
}
|
|
4752
|
-
const sym = createSymbol(member.node, member.name, kind |
|
|
4755
|
+
const sym = createSymbol(member.node, member.name, kind | SymbolFlags.LateBound, containerSym);
|
|
4753
4756
|
mutate(sym).type = member;
|
|
4754
4757
|
const symbolSource = getTypeSymbol(member);
|
|
4755
4758
|
if (symbolSource) {
|
|
@@ -5038,7 +5041,7 @@ export function createChecker(program, resolver) {
|
|
|
5038
5041
|
const relatedSource = getRelatedSymbolSource(sym);
|
|
5039
5042
|
return (docFromCommentForSym.get(sym) ??
|
|
5040
5043
|
(relatedSource && docFromCommentForSym.get(relatedSource)) ??
|
|
5041
|
-
(sym.flags &
|
|
5044
|
+
(sym.flags & SymbolFlags.LateBound && sym.type && isType(sym.type)
|
|
5042
5045
|
? getDocCommentForType(sym.type)
|
|
5043
5046
|
: undefined));
|
|
5044
5047
|
}
|
|
@@ -5089,7 +5092,7 @@ export function createChecker(program, resolver) {
|
|
|
5089
5092
|
// Error should already have been reported above
|
|
5090
5093
|
return undefined;
|
|
5091
5094
|
}
|
|
5092
|
-
if (!(sym.flags &
|
|
5095
|
+
if (!(sym.flags & SymbolFlags.Decorator)) {
|
|
5093
5096
|
reportCheckerDiagnostic(createDiagnostic({
|
|
5094
5097
|
code: "invalid-decorator",
|
|
5095
5098
|
format: { id: sym.name },
|
|
@@ -5327,19 +5330,19 @@ export function createChecker(program, resolver) {
|
|
|
5327
5330
|
}));
|
|
5328
5331
|
}
|
|
5329
5332
|
else if (links.finalSymbol?.flags &&
|
|
5330
|
-
~links.finalSymbol.flags &
|
|
5331
|
-
~links.finalSymbol.flags &
|
|
5333
|
+
~links.finalSymbol.flags & SymbolFlags.Declaration &&
|
|
5334
|
+
~links.finalSymbol.flags & SymbolFlags.Member) {
|
|
5332
5335
|
program.reportDiagnostic(createDiagnostic({
|
|
5333
5336
|
code: "augment-decorator-target",
|
|
5334
|
-
messageId: links.finalSymbol.flags &
|
|
5337
|
+
messageId: links.finalSymbol.flags & SymbolFlags.Model
|
|
5335
5338
|
? "noModelExpression"
|
|
5336
|
-
: links.finalSymbol.flags &
|
|
5339
|
+
: links.finalSymbol.flags & SymbolFlags.Union
|
|
5337
5340
|
? "noUnionExpression"
|
|
5338
5341
|
: "default",
|
|
5339
5342
|
target: node.targetType,
|
|
5340
5343
|
}));
|
|
5341
5344
|
}
|
|
5342
|
-
else if (links.finalSymbol?.flags && links.finalSymbol.flags &
|
|
5345
|
+
else if (links.finalSymbol?.flags && links.finalSymbol.flags & SymbolFlags.Alias) {
|
|
5343
5346
|
const aliasNode = getSymNode(links.finalSymbol);
|
|
5344
5347
|
program.reportDiagnostic(createDiagnostic({
|
|
5345
5348
|
code: "augment-decorator-target",
|
|
@@ -5356,13 +5359,24 @@ export function createChecker(program, resolver) {
|
|
|
5356
5359
|
function checkUsings(ctx, node) {
|
|
5357
5360
|
const usedSym = resolveTypeReferenceSym(ctx.withMapper(undefined), node.name);
|
|
5358
5361
|
if (usedSym) {
|
|
5359
|
-
if (~usedSym.flags &
|
|
5362
|
+
if (~usedSym.flags & SymbolFlags.Namespace) {
|
|
5360
5363
|
reportCheckerDiagnostic(createDiagnostic({ code: "using-invalid-ref", target: node.name }));
|
|
5361
5364
|
}
|
|
5362
5365
|
}
|
|
5363
5366
|
// If this was used to get a type this is invalid, only used for validation.
|
|
5364
5367
|
return errorType;
|
|
5365
5368
|
}
|
|
5369
|
+
/**
|
|
5370
|
+
* Check whether the given identifier is part of the name of a `using` statement declared at the file level,
|
|
5371
|
+
* before the blockless namespace declaration.
|
|
5372
|
+
*/
|
|
5373
|
+
function isUsingBeforeFileNamespace(identifier) {
|
|
5374
|
+
let node = identifier.parent;
|
|
5375
|
+
while (node?.kind === SyntaxKind.MemberExpression) {
|
|
5376
|
+
node = node.parent;
|
|
5377
|
+
}
|
|
5378
|
+
return node?.kind === SyntaxKind.UsingStatement && node.scopeNamespace === undefined;
|
|
5379
|
+
}
|
|
5366
5380
|
function checkDecorators(ctx, targetType, node) {
|
|
5367
5381
|
const sym = isMemberNode(node)
|
|
5368
5382
|
? (getSymbolForMember(node) ?? node.symbol)
|
|
@@ -5826,7 +5840,7 @@ export function createChecker(program, resolver) {
|
|
|
5826
5840
|
});
|
|
5827
5841
|
}
|
|
5828
5842
|
function isMemberNode(node) {
|
|
5829
|
-
return node.symbol && !!(node.symbol.flags &
|
|
5843
|
+
return node.symbol && !!(node.symbol.flags & SymbolFlags.Member);
|
|
5830
5844
|
}
|
|
5831
5845
|
function getMemberSymbol(parentSym, name) {
|
|
5832
5846
|
return parentSym ? resolver.getAugmentedSymbolTable(parentSym.members).get(name) : undefined;
|