Commit Graph

15 Commits

Author SHA1 Message Date
Keen Yee Liau bbb2798d41 fix(language-service): Use tsLSHost.fileExists() to resolve modules (#32642)
The ModuleResolutionHost implementation inside ReflectorHost currently
relies on reading the snapshot to determine if a file exists, and use
the snapshot to retrieve the file content.
It is more straightforward and efficient to use the already existing
method fileExists() instead.

At runtime, the TypeScript LanguageServiceHost is really a Project, so
both fileExists() and readFile() methods are defined.

As a micro-optimization, skip fs lookup for tsx files.

PR Close #32642
2019-09-12 17:18:06 -07:00
Keen Yee Liau 6052b12fb3 fix(language-service): Use module resolution cache (#32479)
This PR fixes a critical performance issue where the language
service makes a MASSIVE number of filesystem calls when performing
module resolution.
This is because there is no caching. To make matters worse, module
resolution is performed for **every** program change (which means every
few keystrokes trigger a massive number of fs calls).

PR Close #32479
2019-09-10 06:31:59 -04:00
Keen Yee Liau a91ab15525 fix(language-service): Remove 'context' used for module resolution (#32015)
The language service relies on a "context" file that is used as the
canonical "containing file" when performing module resolution.
This file is unnecessary since the language service host's current
directory always default to the location of tsconfig.json for the
project, which would give the correct result.

This refactoring allows us to simplify the "typescript host" and also
removes the need for custom logic to find tsconfig.json.

PR Close #32015
2019-08-13 11:19:18 -07:00
Alan fd7dd4d9fc refactor: clean up language service from unused code and imports (#30534)
PR Close #30534
2019-05-17 13:32:06 -07:00
WilliamKoza 7c57293bee refactor(language-service): clean up imports language-service and misspellings in public API (#29097)
PR Close #29097
2019-03-05 09:46:45 -08:00
Rado Kirov c95437f15d build(bazel): Turning on strictPropertyInitialization for Angular. (#24572)
All errors for existing fields have been detected and suppressed with a
`!` assertion.

Issue/24571 is tracking proper clean up of those instances.

One-line change required in ivy/compilation.ts, because it appears that
the new syntax causes tsickle emitted node to no longer track their
original sourceFiles.

PR Close #24572
2018-06-25 07:57:13 -07:00
Chuck Jazdzewski 676d9c2c4b fix(language-service): ensure correct paths are passed to TypeScript (#21812)
The 2.6 version of TypeScript's `resolveModuleName`  started to
require paths passed to be separated by '/' instead of being
able to handle '\'.

`ngc` and `ng` already do this transformation.

Fixes: #21811

PR Close #21812
2018-01-26 14:49:23 -08:00
Chuck Jazdzewski e64b1e99c2 fix(compiler): make `.ngsummary.json` files idempotent (#21448)
Fixes: #21432

PR Close #21448
2018-01-10 16:20:53 -08:00
Misko Hevery 3d50fd7cac build: add bazel test rules for remainder of packages (#21053)
PR Close #21053
2017-12-22 13:10:51 -08:00
Tobias Bosch 8d45fefc31 refactor(compiler): remove old ngtools api and add listLazyRoutes to new api (#19836)
Usages of `NgTools_InternalApi_NG_2` from `@angular/compiler-cli` will now
throw an error.

Adds `listLazyRoutes` to `@angular/compiler-cli/ngtools2.ts` for getting
the lazy routes of a `ng.Program`.
PR Close #19836
2017-10-23 18:46:04 -04:00
Matias Niemelä 4695c69cf1 refactor(compiler): remove all source-level traces to tsc-wrapped (#18966)
- temporarily keeps the old sources under packages/tsc-wrapped
  until the build scripts are changed to use compiler-cli everywhere.
- removes the compiler options `disableTransformerPipeline` that was introduced
  in a previous beta of Angular 5, i.e. the transformer based compiler
  is now always enabled.

PR Close #18966
2017-09-13 20:47:37 -04:00
Chuck Jazdzewski bc22ff1517 fix(language-service): remove tsickle dependency
Removes the tsickle dependency added when tsickle was added to the
transform compiler.

Added a test to ensure stray dependencies are not added and no
errors are introduced during module flattening.
2017-08-16 11:33:49 -07:00
Chuck Jazdzewski 253345c0c0 fix(language-service): remove asserts for non-null expressions (#16422)
Reworked some of the code so asserts are no longer necessary.
Added additional and potentially redundant checks
Added checks where the null checker found real problems.

PR Close #16422
2017-04-28 22:50:31 -05:00
Miško Hevery 540581da3e fix(language-service): Update types for TypeScript nullability support 2017-04-12 11:36:19 -07:00
Jason Aden 3e51a19983 refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00