Alex Rickabaugh c573d91285 refactor(compiler-cli): allow program strategies to opt out of inlining (#38105)
The template type-checking engine relies on the abstraction interface
`TypeCheckingProgramStrategy` to create updated `ts.Program`s for
template type-checking. The basic API is that the type-checking engine
requests changes to certain files in the program, and the strategy provides
an updated `ts.Program`.

Typically, such changes are made to 'ngtypecheck' shim files, but certain
conditions can cause template type-checking to require "inline" operations,
which change user .ts files instead. The strategy used by 'ngc' (the
`ReusedProgramStrategy`) supports these kinds of updates, but other clients
such as the language service might not always support modifying user files.

To accommodate this, the `TypeCheckingProgramStrategy` interface was
modified to include a `supportsInlineOperations` flag. If an implementation
specifies `false` for inline support, the template type-checking system will
return diagnostics on components which would otherwise require inline
operations.

Closes #38059

PR Close #38105
2020-07-29 10:31:20 -07:00

39 lines
1.4 KiB
TypeScript

export declare enum ErrorCode {
DECORATOR_ARG_NOT_LITERAL = 1001,
DECORATOR_ARITY_WRONG = 1002,
DECORATOR_NOT_CALLED = 1003,
DECORATOR_ON_ANONYMOUS_CLASS = 1004,
DECORATOR_UNEXPECTED = 1005,
DECORATOR_COLLISION = 1006,
VALUE_HAS_WRONG_TYPE = 1010,
VALUE_NOT_LITERAL = 1011,
COMPONENT_MISSING_TEMPLATE = 2001,
PIPE_MISSING_NAME = 2002,
PARAM_MISSING_TOKEN = 2003,
DIRECTIVE_MISSING_SELECTOR = 2004,
UNDECORATED_PROVIDER = 2005,
DIRECTIVE_INHERITS_UNDECORATED_CTOR = 2006,
UNDECORATED_CLASS_USING_ANGULAR_FEATURES = 2007,
SYMBOL_NOT_EXPORTED = 3001,
SYMBOL_EXPORTED_UNDER_DIFFERENT_NAME = 3002,
CONFIG_FLAT_MODULE_NO_INDEX = 4001,
CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK = 4002,
HOST_BINDING_PARSE_ERROR = 5001,
NGMODULE_INVALID_DECLARATION = 6001,
NGMODULE_INVALID_IMPORT = 6002,
NGMODULE_INVALID_EXPORT = 6003,
NGMODULE_INVALID_REEXPORT = 6004,
NGMODULE_MODULE_WITH_PROVIDERS_MISSING_GENERIC = 6005,
NGMODULE_REEXPORT_NAME_COLLISION = 6006,
NGMODULE_DECLARATION_NOT_UNIQUE = 6007,
SCHEMA_INVALID_ELEMENT = 8001,
SCHEMA_INVALID_ATTRIBUTE = 8002,
MISSING_REFERENCE_TARGET = 8003,
MISSING_PIPE = 8004,
WRITE_TO_READ_ONLY_VARIABLE = 8005,
DUPLICATE_VARIABLE_DECLARATION = 8006,
INLINE_TCB_REQUIRED = 8900,
INLINE_TYPE_CTOR_REQUIRED = 8901,
INJECTABLE_DUPLICATE_PROV = 9001
}