Vscode-ng-language-service: v0.1000.0 does not support solution-style tsconfig

Created on 21 Jun 2020  Â·  33Comments  Â·  Source: angular/vscode-ng-language-service

image

To Reproduce

Steps to reproduce the behavior:
git clone https://github.com/keatkeat87/angular-10rc6-language-service-issue.git
yarn install
check app.component.html

Expected behavior
should able to F12 go to component definition.

Angular CLI: 10.0.0-rc.5
Node: 12.18.0
OS: win32 x64

Angular: 10.0.0-rc.6
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package Version

@angular-devkit/architect 0.1000.0-rc.5
@angular-devkit/build-angular 0.1000.0-rc.5
@angular-devkit/build-optimizer 0.1000.0-rc.5
@angular-devkit/build-webpack 0.1000.0-rc.5
@angular-devkit/core 10.0.0-rc.5
@angular-devkit/schematics 10.0.0-rc.5
@angular/cdk 10.0.0-rc.2
@angular/cli 10.0.0-rc.5
@angular/material 10.0.0-rc.2
@ngtools/webpack 10.0.0-rc.5
@schematics/angular 10.0.0-rc.5
@schematics/update 0.1000.0-rc.5
rxjs 6.5.5
typescript 3.9.5
webpack 4.43.0

bug

Most helpful comment

I'll fix this in @angular/language-service v10.0.1 which will be released July 1, 2020.

All 33 comments

Can you please provide the extension output and logs?

how to do it ?

Sure, see the “Logs” section in the issue template:

Please attach two logs:

Console output (Go to toolbar --> View --> Output, and copy the contents)
Log file (Path is printed to the console output at startup)

[Info - 7:35:19 am] Angular language server process ID: 16852
[Info - 7:35:19 am] Using typescript v3.8.3 from c:\Users\keatk.vscode\extensions\angular.ng-template-0.901.11\node_modules\typescript\lib\tsserverlibrary.js
[Info - 7:35:19 am] Using @angular/language-service v9.1.11 from c:\Users\keatk.vscode\extensions\angular.ng-template-0.901.11\server\node_modules\@angular\language-service\bundles\language-service.umd.js
[Info - 7:35:19 am] Log file: c:\Users\keatk\AppData\Roaming\Code\logs\20200622T073458\exthost1\Angular.ng-template\nglangsvc.log
[Info - 7:35:29 am] Disabling language service for c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.json because it is not an Angular project ('@angular/core/core.d.ts' could not be found). If you believe you are seeing this message in error, please reinstall the packages in your package.json.
[Error - 7:35:29 am] No config file for c:\keatkeat\my projects\angular\10.0\simple-test\src\app\app.component.ts

Okay, thanks. Looks like your extension version is not using the version 10 rc. If you would like to use an Angular 10 app with the VSCode Angular language service extension, you will need to load install v0.1000.0-rc of the extension. Instructions for how to do this can be found at https://github.com/angular/vscode-ng-language-service/issues/793#issuecomment-636136958.

Let me know if that resolves your issue.

i just done the installation, but it still not working.

image


Log output

Log:
Info 0 [8:0:52.551] Format host information updated
Info 1 [8:0:52.552] reload projects.
Info 2 [8:0:52.552] Before ensureProjectForOpenFiles:
Info 3 [8:0:52.552] After ensureProjectForOpenFiles:
Info 4 [8:0:52.552] Host file extension mappings updated
Info 5 [8:0:52.567] Search path: c:/keatkeat/my projects/angular/10.0/simple-test/src/app
Info 6 [8:0:52.569] For info: c:/keatkeat/my projects/angular/10.0/simple-test/src/app/app.component.html :: Config file name: c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.json
Info 7 [8:0:52.570] Opened configuration file c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.json
Info 8 [8:0:52.587] Config: c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.json : {
"rootNames": [],
"options": {
"configFilePath": "c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.json"
},
"projectReferences": [
{
"path": "c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.app.json",
"originalPath": "./tsconfig.app.json"
},
{
"path": "c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.spec.json",
"originalPath": "./tsconfig.spec.json"
},
{
"path": "c:/keatkeat/my projects/angular/10.0/simple-test/e2e/tsconfig.json",
"originalPath": "./e2e/tsconfig.json"
}
]
}
Info 9 [8:0:52.588] Loading global plugin @angular/language-service
Info 10 [8:0:52.588] Enabling plugin @angular/language-service from candidate paths: c:\Users\keatk.vscode\extensions\angular.ng-template-0.1000.0-rc.1\server\node_modules\@angular\language-service\bundles\language-service.umd.js,c:/Users/keatk/.vscode/extensions/angular.ng-template-0.1000.0-rc.1/node_modules/typescript/lib/tsserverlibrary.js/../../..
Info 11 [8:0:52.589] Loading @angular/language-service from c:\Users\keatk.vscode\extensions\angular.ng-template-0.1000.0-rc.1\server\node_modules\@angular\language-service\bundles\language-service.umd.js (resolved to c:/Users/keatk/.vscode/extensions/angular.ng-template-0.1000.0-rc.1/server/node_modules/@angular/language-service/bundles/language-service.umd.js/node_modules)
Info 12 [8:0:52.724] Plugin validation succeded
Info 13 [8:0:52.761] Starting updateGraphWorker: Project: c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.json
Info 14 [8:0:52.830] Finishing updateGraphWorker: Project: c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.json Version: 1 structureChanged: true Elapsed: 69ms
Info 15 [8:0:52.830] Project 'c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.json' (Configured)
Info 16 [8:0:52.830] Files (0)

Info 17 [8:0:52.830] -----------------------------------------------
Info 18 [8:0:52.831] Starting updateGraphWorker: Project: c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.json
Info 19 [8:0:52.832] Finishing updateGraphWorker: Project: c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.json Version: 2 structureChanged: false Elapsed: 1ms
Info 20 [8:0:52.835] Disabling language service for c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.json because it is not an Angular project ('@angular/core/core.d.ts' could not be found). If you believe you are seeing this message in error, please reinstall the packages in your package.json.
Info 21 [8:0:52.835] Opened configuration file c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.app.json
Info 22 [8:0:52.848] Config: c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.app.json : {
"rootNames": [
"c:/keatkeat/my projects/angular/10.0/simple-test/src/main.ts",
"c:/keatkeat/my projects/angular/10.0/simple-test/src/polyfills.ts"
],
"options": {
"baseUrl": "c:/keatkeat/my projects/angular/10.0/simple-test",
"outDir": "c:/keatkeat/my projects/angular/10.0/simple-test/out-tsc/app",
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": 2,
"importHelpers": true,
"target": 2,
"module": 6,
"lib": [
"lib.es2018.d.ts",
"lib.dom.d.ts"
],
"types": [],
"configFilePath": "c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.app.json"
}
}
Info 23 [8:0:52.849] Loading global plugin @angular/language-service
Info 24 [8:0:52.849] Enabling plugin @angular/language-service from candidate paths: c:\Users\keatk.vscode\extensions\angular.ng-template-0.1000.0-rc.1\server\node_modules\@angular\language-service\bundles\language-service.umd.js,c:/Users/keatk/.vscode/extensions/angular.ng-template-0.1000.0-rc.1/node_modules/typescript/lib/tsserverlibrary.js/../../..
Info 25 [8:0:52.849] Loading @angular/language-service from c:\Users\keatk.vscode\extensions\angular.ng-template-0.1000.0-rc.1\server\node_modules\@angular\language-service\bundles\language-service.umd.js (resolved to c:/Users/keatk/.vscode/extensions/angular.ng-template-0.1000.0-rc.1/server/node_modules/@angular/language-service/bundles/language-service.umd.js/node_modules)
Info 26 [8:0:52.862] Plugin validation succeded
Info 27 [8:0:52.865] Starting updateGraphWorker: Project: c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.app.json
Info 28 [8:0:56.426] Finishing updateGraphWorker: Project: c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.app.json Version: 1 structureChanged: true Elapsed: 3561ms
Info 29 [8:0:56.426] Project 'c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.app.json' (Configured)
Info 30 [8:0:56.426] Files (307)

Info 31 [8:0:56.426] -----------------------------------------------
Info 32 [8:0:56.427] Starting updateGraphWorker: Project: c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.app.json
Info 33 [8:0:56.432] Finishing updateGraphWorker: Project: c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.app.json Version: 2 structureChanged: false Elapsed: 5ms
Info 34 [8:0:56.434] Opened configuration file c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.spec.json
Info 35 [8:0:56.449] Config: c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.spec.json : {
"rootNames": [
"c:/keatkeat/my projects/angular/10.0/simple-test/src/test.ts",
"c:/keatkeat/my projects/angular/10.0/simple-test/src/polyfills.ts"
],
"options": {
"baseUrl": "c:/keatkeat/my projects/angular/10.0/simple-test",
"outDir": "c:/keatkeat/my projects/angular/10.0/simple-test/out-tsc/spec",
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": 2,
"importHelpers": true,
"target": 2,
"module": 6,
"lib": [
"lib.es2018.d.ts",
"lib.dom.d.ts"
],
"types": [
"jasmine"
],
"configFilePath": "c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.spec.json"
}
}
Info 36 [8:0:56.450] Loading global plugin @angular/language-service
Info 37 [8:0:56.450] Enabling plugin @angular/language-service from candidate paths: c:\Users\keatk.vscode\extensions\angular.ng-template-0.1000.0-rc.1\server\node_modules\@angular\language-service\bundles\language-service.umd.js,c:/Users/keatk/.vscode/extensions/angular.ng-template-0.1000.0-rc.1/node_modules/typescript/lib/tsserverlibrary.js/../../..
Info 38 [8:0:56.450] Loading @angular/language-service from c:\Users\keatk.vscode\extensions\angular.ng-template-0.1000.0-rc.1\server\node_modules\@angular\language-service\bundles\language-service.umd.js (resolved to c:/Users/keatk/.vscode/extensions/angular.ng-template-0.1000.0-rc.1/server/node_modules/@angular/language-service/bundles/language-service.umd.js/node_modules)
Info 39 [8:0:56.464] Plugin validation succeded
Info 40 [8:0:56.466] Starting updateGraphWorker: Project: c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.spec.json
Info 41 [8:0:57.389] Finishing updateGraphWorker: Project: c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.spec.json Version: 1 structureChanged: true Elapsed: 923ms
Info 42 [8:0:57.389] Project 'c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.spec.json' (Configured)
Info 43 [8:0:57.389] Files (99)

Info 44 [8:0:57.389] -----------------------------------------------
Info 45 [8:0:57.390] Starting updateGraphWorker: Project: c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.spec.json
Info 46 [8:0:57.391] Finishing updateGraphWorker: Project: c:/keatkeat/my projects/angular/10.0/simple-test/tsconfig.spec.json Version: 2 structureChanged: false Elapsed: 1ms
Info 47 [8:0:57.392] Opened configuration file c:/keatkeat/my projects/angular/10.0/simple-test/e2e/tsconfig.json
Info 48 [8:0:57.399] Config: c:/keatkeat/my projects/angular/10.0/simple-test/e2e/tsconfig.json : {
"rootNames": [
"c:/keatkeat/my projects/angular/10.0/simple-test/e2e/src/app.e2e-spec.ts",
"c:/keatkeat/my projects/angular/10.0/simple-test/e2e/src/app.po.ts"
],
"options": {
"baseUrl": "c:/keatkeat/my projects/angular/10.0/simple-test",
"outDir": "c:/keatkeat/my projects/angular/10.0/simple-test/out-tsc/e2e",
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": 2,
"importHelpers": true,
"target": 5,
"module": 1,
"lib": [
"lib.es2018.d.ts",
"lib.dom.d.ts"
],
"types": [
"jasmine",
"jasminewd2",
"node"
],
"configFilePath": "c:/keatkeat/my projects/angular/10.0/simple-test/e2e/tsconfig.json"
}
}
Info 49 [8:0:57.400] Loading global plugin @angular/language-service
Info 50 [8:0:57.400] Enabling plugin @angular/language-service from candidate paths: c:\Users\keatk.vscode\extensions\angular.ng-template-0.1000.0-rc.1\server\node_modules\@angular\language-service\bundles\language-service.umd.js,c:/Users/keatk/.vscode/extensions/angular.ng-template-0.1000.0-rc.1/node_modules/typescript/lib/tsserverlibrary.js/../../..
Info 51 [8:0:57.400] Loading @angular/language-service from c:\Users\keatk.vscode\extensions\angular.ng-template-0.1000.0-rc.1\server\node_modules\@angular\language-service\bundles\language-service.umd.js (resolved to c:/Users/keatk/.vscode/extensions/angular.ng-template-0.1000.0-rc.1/server/node_modules/@angular/language-service/bundles/language-service.umd.js/node_modules)
Info 52 [8:0:57.421] Plugin validation succeded
Info 53 [8:0:57.424] Starting updateGraphWorker: Project: c:/keatkeat/my projects/angular/10.0/simple-test/e2e/tsconfig.json
Info 54 [8:0:58.886] Finishing updateGraphWorker: Project: c:/keatkeat/my projects/angular/10.0/simple-test/e2e/tsconfig.json Version: 1 structureChanged: true Elapsed: 1462ms
Info 55 [8:0:58.886] Project 'c:/keatkeat/my projects/angular/10.0/simple-test/e2e/tsconfig.json' (Configured)
Info 56 [8:0:58.886] Files (123)

Info 57 [8:0:58.886] -----------------------------------------------
Info 58 [8:0:58.887] Starting updateGraphWorker: Project: c:/keatkeat/my projects/angular/10.0/simple-test/e2e/tsconfig.json
Info 59 [8:0:58.889] Finishing updateGraphWorker: Project: c:/keatkeat/my projects/angular/10.0/simple-test/e2e/tsconfig.json Version: 2 structureChanged: false Elapsed: 2ms
Info 60 [8:0:58.890] Disabling language service for c:/keatkeat/my projects/angular/10.0/simple-test/e2e/tsconfig.json because it is not an Angular project ('@angular/core/core.d.ts' could not be found). If you believe you are seeing this message in error, please reinstall the packages in your package.json.
Info 61 [8:0:58.891] Loading global plugin @angular/language-service
Info 62 [8:0:58.891] Enabling plugin @angular/language-service from candidate paths: c:\Users\keatk.vscode\extensions\angular.ng-template-0.1000.0-rc.1\server\node_modules\@angular\language-service\bundles\language-service.umd.js,c:/Users/keatk/.vscode/extensions/angular.ng-template-0.1000.0-rc.1/node_modules/typescript/lib/tsserverlibrary.js/../../..
Info 63 [8:0:58.891] Loading @angular/language-service from c:\Users\keatk.vscode\extensions\angular.ng-template-0.1000.0-rc.1\server\node_modules\@angular\language-service\bundles\language-service.umd.js (resolved to c:/Users/keatk/.vscode/extensions/angular.ng-template-0.1000.0-rc.1/server/node_modules/@angular/language-service/bundles/language-service.umd.js/node_modules)
Info 64 [8:0:58.904] Plugin validation succeded
Info 65 [8:0:58.910] Starting updateGraphWorker: Project: /dev/null/inferredProject1*
Info 66 [8:0:59.911] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* Version: 1 structureChanged: true Elapsed: 1001ms
Info 67 [8:0:59.911] Project '/dev/null/inferredProject1*' (Inferred)
Info 68 [8:0:59.911] Files (100)

Info 69 [8:0:59.911] -----------------------------------------------

Can you confirm that auto completion/go to reference isn’t working?

yup, you can clone my repository, i have update to latest
issue1

Interesting, I guess the files from project references aren't properly passed up to the solution-style tsconfig, which takes ownership for the project. Fixing this needs some more investigation. In the meantime, a workaround is to comment out files: [] in the main tsconfig.json.

cc @kyliau

Kind of surprised this wasn't reported earlier

after i try the working around, comment out files: []
other error come out.
image
and
image

@kyliau, getDefaultProjectForScriptInfo method attaches external file to the wrong project when using the solution-style tsconfig. It attaches app.component.html file to tsconfig.json instead of tsconfig.app.json project

It works as expected when the language service plugin has GetExternalFiles() implementation.

@andrius-pra thank you for the investigation. Yes, I can confirm your finding.

The problem here is that given an Angular template (.html) file, language service relies on the closest ancestor tsconfig.json to determine the Project it belongs to.
It works well before solution-style tsconfig was introduced, and is generally more performant because it reduces overhead in the language service without querying getExternalFiles() on every ts.Program update.
With solution-style tsconfig, the root tsconfig.json on its own does not include any files, and acts more like a "shell" of sub-projects. In this case, there is practically no way for the Angular extension to determine which sub-project the Angular template belongs to, unless the sub-project itself declares the template as external file.
It does seem to me our best bet here is to reinstate getExternalFiles().

Separately, the CLI team has received reports of slowness in IDE performance when solution-style tsconfig is used.
The issue is tracked in https://github.com/microsoft/TypeScript/issues/39144
@alan-agius4 proposed that we add tsconfig.json to each application. That'd also solve this problem, with the sole exception in the case where the workspace itself is the application (root tsconfig.json is reserved for solution-style tsconfig).

@alan-agius4 proposed that we add tsconfig.json to each application

would this be something the CLI does?

@kyliau the project level tsconfig.json would still be a solution style typescript configuration file. So it won't fix the problem.

@andrius-pra, indeed this cannot be fixed by removing files: [] as this changes the sematics of the root tsconfig file from a solutions tsconfig file to a composite project tsconfig file.

@ayazhafiz, yeah the CLI would update the workspace and create the new tsconfig files.

I'll fix this in @angular/language-service v10.0.1 which will be released July 1, 2020.

https://github.com/angular/angular/pull/37750 has been created to reinstate getExternalFiles().

For users who are interested in knowing why this fix did not get shipped in v0.1000.0, it's because we've already entered "code freeze" period in our RC release stage when this issue was filed. I apologize to anyone who tried out Angular v10 and got frustrated that the language service did not work out of the box (for new projects). Sorry for the inconvenience.

Going forward, we're going to implement tighter integration between language service and CLI, so that we could detect problems like this much sooner.

Reopening this until fix gets released next week.

This has been fixed in v0.1000.1 which just got released.
https://github.com/angular/vscode-ng-language-service/releases/tag/v0.1000.1
I'll close this issue for now, please open a new issue if you run into problem with solution-style tsconfig.

@kyliau see my comment here https://github.com/angular/angular/issues/37781#issuecomment-650508843 . This is still not working.

@JohnnyDevNull, could you provide Console output (Go to toolbar --> View --> Output, and copy the contents)?
Does it work in new project?

npm install -g @angular/cli
ng new ng10
code ng10

@andrius-pra see my issue linked above. I've done the same proccess as described there fresh and clean. Also with fresh installed angular cli.

Edit: by the way i've also done a uninstall und re-install of the angular-cli globally

@JohnnyDevNull Could you please show the console output? It should look similar to this

Screen Shot 2020-06-27 at 7 44 03 AM

@kyliau here it is:

image

Edit: This was a complete fresh install, also after re-installing the cli globally
Edit 2: Oh by the way i'am actually using CodeOSS because i'am on a Manjaro KDE if that matters

@JohnnyDevNull It looks like Angular LS is activated on tsconfig.app.json, but you are expecting autocomplete for library components / directives, which are presumably in another project (configured by another tsconfig.*.json)?

@kyliau what i've done is

tldr; i think you should repoen issue https://github.com/angular/angular/issues/37781 because it sill does not work

ng new ng-test --create-application=false --skipGit
ng g library my-test --prefix=mt
ng g library my-test2 --prefix=mt2
ng g application my-tester --routing=true --style=scss
ng build --project=my-test
ng build --project=my-test2

when you now import the MyTestModule into the AppModule at the my-tester App no path matching is working.
And also right out of the box the tsconfig.base.json inheritance is not working because of the decorators error.

All files are auto-generated from the cli and not modified from me!

The errors are just the same with the updated version as mentioned in my issue:

image

I've done the clean Angular-Cli setup to be sure that no of my configurations in my library project breaks something.
But this as i mentioned does not work right out of the box with the auto generated Angular Template from the cli and the schematics scaffholding.

By the way it's correct that the Angular LS loads the tsconfig.app.json. This inherits from the tsconfig.base.json and there the path matchings are configurated.

tsconfig.app.json

/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
  "extends": "../../tsconfig.base.json",
  "compilerOptions": {
    "outDir": "../../out-tsc/app",
    "types": []
  },
  "files": [
    "src/main.ts",
    "src/polyfills.ts"
  ],
  "include": [
    "src/**/*.d.ts"
  ]
}

tsconfig.base.json

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2015",
    "module": "es2020",
    "lib": [
      "es2018",
      "dom"
    ],
    "paths": {
      "my-test": [
        "dist/my-test/my-test",
        "dist/my-test"
      ]
    }
  }
}

tsconfig.json (solution tsconfig)

/*
  This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience.
  It is not intended to be used to perform a compilation.

  To learn more about this file see: https://angular.io/config/solution-tsconfig.
*/
{
  "files": [],
  "references": [
    {
      "path": "./projects/my-test/tsconfig.lib.json"
    },
    {
      "path": "./projects/my-test/tsconfig.spec.json"
    },
    {
      "path": "./projects/my-tester/tsconfig.app.json"
    },
    {
      "path": "./projects/my-tester/tsconfig.spec.json"
    },
    {
      "path": "./projects/my-tester/e2e/tsconfig.json"
    }
]
}

@JohnnyDevNull, Did you remove "files": [], from tsconfig.json in root directory?

I don't get any error. I did these steps:

Create workspace:

ng new ng-test --create-application=false --skipInstall --skipGit
cd ng-test
ng g library my-test --prefix=mt
ng g library my-test2 --prefix=mt2
ng g application --name my-tester --routing=false --style=css
ng build --project=my-test
ng build --project=my-test2
code . projects\my-tester\src\app\app.module.ts

add imports to app.module.ts:

import { MyTestModule } from 'my-test'
import { MyTest2Module } from 'my-test2'

console output:

[Info  - 19:08:58] Angular language server process ID: 24660
[Info  - 19:08:58] Using typescript v3.9.5 from c:\Users\Andrius\.vscode\extensions\angular.ng-template-0.1000.1\node_modules\typescript\lib\tsserverlibrary.js
[Info  - 19:08:58] Using @angular/language-service v10.0.1 from c:\Users\Andrius\.vscode\extensions\angular.ng-template-0.1000.1\server\node_modules\@angular\language-service\bundles\language-service.umd.js
[Info  - 19:08:58] Log file: c:\Users\Andrius\AppData\Roaming\Code\logs\20200627T190857\exthost3\Angular.ng-template\nglangsvc.log
[Info  - 19:09:02] Disabling language service for d:/a/ng-test/tsconfig.json because it is not an Angular project ('@angular/core/core.d.ts' could not be found). If you believe you are seeing this message in error, please reinstall the packages in your package.json.
[Info  - 19:09:02] Enabling language service for d:/a/ng-test/projects/my-test/tsconfig.lib.json.
[Info  - 19:09:02] Enabling language service for d:/a/ng-test/projects/my-test/tsconfig.spec.json.
[Info  - 19:09:02] Enabling language service for d:/a/ng-test/projects/my-test2/tsconfig.lib.json.
[Info  - 19:09:02] Enabling language service for d:/a/ng-test/projects/my-test2/tsconfig.spec.json.
[Info  - 19:09:02] Enabling language service for d:/a/ng-test/projects/my-tester/tsconfig.app.json.

@andrius-pra

https://github.com/angular/vscode-ng-language-service/issues/824#issuecomment-650579235

All files are auto-generated from the cli and not modified from me!

Note: please don’t remove "files": [] this changes the sematics and meaning of the root tsconfig. When remove the empty array you are opting out of solutions style tsconfig.

Removing this, will cause undefined behaviour, and by no means is supported.

I think what you are experiencing sound similar to https://github.com/angular/angular-cli/issues/16708

Does this same issue persists when restarting the LS?

I think i have found the problem for VSCode:

VSCode (Or in my case Code OSS) uses per default the shipped Version TypeScript 3.8.3 by now which does not support solution config with inheritance.

I've put that into settings.json, so that the workspace version is used

{
  "typescript.tsdk": "node_modules/typescript/lib"
}

My output still is the same, but the errors are gone:

image

@JohnnyDevNull, indeed you need to make sure that you force VSCode to use the project level TypeScript package.

@alan-agius4 are you sure it fixed the problem? I am on latest stable of Everything I could've updated. Dependencies and vscode +plugins and the issue persist, even with version 10.0.1, when the mentioned files: [] is at root tsconfig.json, the VScode wont autocomplete anything.

EDIT: it's working, it's just I had more than one tsconfig (tsconfig.app.json and tsconfig.demo.json) and had multiple exclude scenarios, now VScode refuses to import modules in the excluded files, which I think is wrong.

Example, I exclude all files in the tsconfig.app.json under path src/app/demo/** but it's not excluded in the tsconfig.demo.json (because I have more build targets) and VScode will never offer me help in the src/app/demo/**, I am currently thinking about how to solve this.

Another thing, the important stuff is the include: [] at tsconfig.app.json, the angular 10 now defautls to value *.d.ts compared to *.ts prior causing VScode to not traverse many files if *.d.ts is left there or include array completely ommited. In either scenario, the compilation always succeeds just VScode plugins have troubles.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings