Go to file
Keen Yee Liau e1e1db3c01 fix(language-service): Paths on Windows should be normalized (#40492)
Many `ts.LanguageService` APIs accept a filename, for example
```ts
getQuickInfoAtPosition(fileName: string, position: number)
```
The requirement is that `fileName` is agnostic to the platform (Linux, Mac,
Windows, etc), and is always normalized to TypeScript's internal
`NormalizedPath`.

This is evident from the way these APIs are called from the language server:
```ts
  private onHover(params: lsp.TextDocumentPositionParams) {
    const lsInfo = this.getLSAndScriptInfo(params.textDocument);
    if (lsInfo === undefined) {
      return;
    }
    const {languageService, scriptInfo} = lsInfo;
    const offset = lspPositionToTsPosition(scriptInfo, params.position);
    const info = languageService.getQuickInfoAtPosition(scriptInfo.fileName, offset);
    // ...
  }
```
9fca9c6651/server/src/session.ts (L594)
Here `scriptInfo.fileName` is always a `ts.server.NormalizedPath`.

However, https://github.com/angular/angular/pull/39917 accidentally leaked
the platform-specific paths, and caused a mismatch between the incoming paths
and the paths stored in the internal data structure `fileToComponent`.

This PR fixes the bug by always normalizing the paths, and updating the
type to reflect the format of the underlying data.

Fixes https://github.com/angular/vscode-ng-language-service/issues/1063

PR Close #40492
2021-01-20 08:46:03 -08:00
.circleci docs: remove duplicated the (#40434) 2021-01-14 11:33:57 -08:00
.devcontainer build: update the recommended `Dockerfile` for VSCode remote development (#34697) 2020-01-09 13:31:14 -08:00
.github ci: update l2 triage label configuration for pull requests (#39954) 2020-12-03 13:43:02 -08:00
.husky build: update to husky@5 (#39739) 2020-11-18 11:11:41 -08:00
.ng-dev build: update config flags for snapshot builds (#40095) 2020-12-15 13:36:56 -08:00
.vscode build: use "outFiles" in .vscode/launch.json to speed up debugging sessions (#39848) 2020-12-17 11:23:13 -08:00
.yarn build: update to latest version of yarn (#38869) 2020-09-18 16:47:33 -07:00
aio docs: Return SVG topic to documentation; light edits for clarity (#40487) 2021-01-19 14:18:51 -08:00
dev-infra docs: remove duplicated the (#40434) 2021-01-14 11:33:57 -08:00
docs docs: correct some spellings (#40322) 2021-01-06 07:31:33 -08:00
goldens fix(core): `QueryList` should not fire changes if the underlying list did not change. (#40091) 2021-01-14 13:55:02 -08:00
integration docs: remove duplicated the (#40434) 2021-01-14 11:33:57 -08:00
modules build: support building with TypeScript 4.1 (#39571) 2020-11-25 11:10:01 -08:00
packages fix(language-service): Paths on Windows should be normalized (#40492) 2021-01-20 08:46:03 -08:00
scripts build: remove pre-check script from publish scripts as it no longer performs its check (#40422) 2021-01-13 14:42:59 -08:00
third_party docs: update links to use HTTPS as protocol (#39718) 2020-11-20 12:52:16 -08:00
tools feat(dev-infra): make ts-api-guardian compatible with rules_nodejs version 3 (#40353) 2021-01-11 15:36:29 -08:00
.bazelignore build: add npm package manifest to npm_integration_test (#35669) 2020-02-26 12:58:35 -08:00
.bazelrc build: update config flags for snapshot builds (#40095) 2020-12-15 13:36:56 -08:00
.bazelversion build: update bazelversion (#39351) 2020-10-21 11:59:40 -07:00
.clang-format feat(tooling): Add a .clang-format for automated JavaScript formatting. 2015-04-02 08:44:34 -07:00
.editorconfig build: use https link to editorconfig.org in .editorconfig (#27664) 2018-12-18 09:30:09 -08:00
.gitattributes test: fix ts api guardian and public guard tests on windows (#30105) 2019-04-26 16:32:22 -07:00
.gitignore fix(dev-infra): add vim .swp files to gitignore (#40094) 2020-12-14 11:39:41 -08:00
.gitmessage fix(platform-webworker): remove platform-webworker and platform-webworker-dynamic (#38846) 2020-09-30 09:13:59 -04:00
.mailmap build: add a Git .mailmap with my new name (#19550) 2017-10-09 14:35:30 -07:00
.nvmrc build: migrate to node@12.14.1 (#34955) 2020-01-27 09:31:22 -08:00
.pullapprove.yml build(docs-infra): error guides in docs (#40060) 2021-01-14 11:28:52 -08:00
.yarnrc build: update to latest version of yarn (#38869) 2020-09-18 16:47:33 -07:00
BUILD.bazel test(upgrade): run tests against AngularJS v1.8.x as well (#39972) 2020-12-07 09:40:49 -08:00
CHANGELOG.md docs: cherry-pick changelog from the 11.1.0-rc.0 release (#40421) 2021-01-13 13:59:24 -08:00
CODE_OF_CONDUCT.md docs: add Discord as an official communication channel (#39149) 2020-10-14 10:23:15 -07:00
CONTRIBUTING.md docs: add an exception for accepting contributions (#39611) 2020-11-24 08:40:22 -08:00
LICENSE docs: update links to use HTTPS as protocol (#39718) 2020-11-20 12:52:16 -08:00
README.md docs: add reason to use Angular in README (#36927) 2020-12-09 08:58:10 -08:00
WORKSPACE Revert "build: update bazel rules_nodejs to 2.3.2 (#40367)" (#40395) 2021-01-11 12:51:11 -08:00
browser-providers.conf.js ci: remove IE 9 and IE 10 from CI (#38931) 2020-09-25 14:31:10 -04:00
gulpfile.js build: remove check-env script (#39980) 2020-12-07 09:48:11 -08:00
karma-js.conf.js test(core): tag `render3` test targets as ivy-only (#40127) 2021-01-06 08:28:03 -08:00
package.json Update next branch to reflect new release-train "v11.2.0-next.0". (#40418) 2021-01-13 13:20:03 -08:00
test-events.js build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
test-main.js fix(platform-webworker): remove platform-webworker and platform-webworker-dynamic (#38846) 2020-09-30 09:13:59 -04:00
tslint.json build: exclude build-worker file from formatting (#40012) 2020-12-08 12:06:53 -08:00
yarn.lock Revert "build: update bazel rules_nodejs to 2.3.2 (#40367)" (#40395) 2021-01-11 12:51:11 -08:00
yarn.lock.readme.md build: remove travisci leftovers (#27979) 2019-01-09 10:41:16 -08:00

README.md

Angular - One framework. Mobile & desktop.

angular-logo
Angular is a development platform for building mobile and desktop web applications
using Typescript/JavaScript and other languages.

www.angular.io

Contributing Guidelines · Submit an Issue · Blog

CI status   Angular on npm   Discord conversation


Documentation

Get started with Angular, learn the fundamentals and explore advanced topics on our documentation website.

Advanced

Development Setup

Prerequisites

Setting Up a Project

Install the Angular CLI globally:

npm install -g @angular/cli

Create workspace:

ng new [PROJECT NAME]

Run the application:

cd [PROJECT NAME]
ng serve

Angular is cross-platform, fast, scalable, has incredible tooling, and is loved by millions.

Quickstart

Get started in 5 minutes.

Ecosystem

angular ecosystem logos

Changelog

Learn about the latest improvements.

Upgrading

Check out our upgrade guide to find out the best way to upgrade your project.

Contributing

Contributing Guidelines

Read through our contributing guidelines to learn about our submission process, coding rules and more.

Want to Help?

Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues in the hotlist: community-help.

Code of Conduct

Help us keep Angular open and inclusive. Please read and follow our Code of Conduct.

Community

Join the conversation and help the community.

Love Angular badge

Love Angular? Give our repo a star ⬆️.