Cleanup the logic in TypeScriptHost as to when langauge service state
should be synchronized with the editor state.
The model employed follows that of tsserver, in which case it is the
caller's responsiblity to synchronize host data before any LS methods
are called.
PR Close#32017
This PR changes the language service to work in two different modes:
1. TS + Angular
Plugin augments TS language service to provide additonal Angular
information. This only works with inline template and is meant to be
used as a local plugin (configured via tsconfig.json).
2. Angular only
Plugin only provides information on Angular templates, no TS info at
all. This effectively disables native TS features and is meant for
internal use only.
Default mode is `angularOnly = false` so that we don't break any users
already using Angular LS as local plugin.
As part of the refactoring, `undefined` is removed from type aliases
because it is considered bad practice.
go/tsstyle#nullableundefined-type-aliases
```
Type aliases must not include |null or |undefined in a union type.
Nullable aliases typically indicate that null values are being passed
around through too many layers of an application, and this clouds the
source of the original issue that resulted in null. They also make it
unclear when specific values on a class or interface might be absent.
```
PR Close#31935
Fixes all TypeScript failures caused by enabling the `--strict`
flag for test source files. We also want to enable the strict
options for tests as the strictness enforcement improves the
overall codehealth, unveiled common issues and additionally it
allows us to enable `strict` in the `tsconfig.json` that is picked
up by IDE's.
PR Close#30993
```
NgLSHost: AngularLanguageServiceHost
NgLS: AngularLanguageService
```
NgLSHost should not depend on NgLS, because it introduces circular
dependency.
Instead, the `getTemplateAst` and `getTemplatAstAtPosition` methods should
be moved to NgLSHost and exposed as public methods.
This removes the circular dependency, and also removes the need for the
awkward 'setSite' method in NgLSHost.
PR Close#31122
This PR fixes a bug in autocompletion for @Input/@Output decorator with
an alias. The current implementation ignores the alias.
Credit for this work is attributed to @edgardmessias
The original work fixed the bug, but was lacking test.
PR Close#27959
PR Close#28904
This commit fixes the options passed to ReflectorHost to include 'paths'
if it's specified in compiler options, so that dependency modules can
be loaded.
PR Close#20222