-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v0.1000.0 does not support solution-style tsconfig #824
Comments
Can you please provide the extension output and logs? |
how to do it ? |
Sure, see the “Logs” section in the issue template:
|
[Info - 7:35:19 am] Angular language server process ID: 16852 |
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 #793 (comment). Let me know if that resolves your issue. |
i just done the installation, but it still not working. Log outputLog: Info 17 [8:0:52.830] ----------------------------------------------- Info 31 [8:0:56.426] ----------------------------------------------- Info 44 [8:0:57.389] ----------------------------------------------- Info 57 [8:0:58.886] ----------------------------------------------- Info 69 [8:0:59.911] ----------------------------------------------- |
Can you confirm that auto completion/go to reference isn’t working? |
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 cc @kyliau |
Kind of surprised this wasn't reported earlier |
typescript 3.9.5 contains latest bug fixes. Upgrading to latest before investigating angular#824
typescript 3.9.5 contains latest bug fixes. Upgrading to latest before investigating angular#824
typescript 3.9.5 contains latest bug fixes. Upgrading to latest before investigating #824
@kyliau, getDefaultProjectForScriptInfo method attaches external file to the wrong project when using the solution-style tsconfig. It attaches 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 Separately, the CLI team has received reports of slowness in IDE performance when solution-style tsconfig is used. |
would this be something the CLI does? |
@kyliau the project level @andrius-pra, indeed this cannot be fixed by removing @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. |
`getExternalFiles()` is an API that could optionally be provided by a tsserver plugin to notify the server of any additional files that should belong to a particular project. This API was removed in angular#34260 mainly due to performance reasons. However, with the introduction of "solution-style" tsconfig in typescript 3.9, the Angular extension could no longer reliably detect the owning Project solely based on the ancestor tsconfig.json. In order to support this use case, we have to reinstate `getExternalFiles()`. Fixes angular/vscode-ng-language-service#824
angular/angular#37750 has been created to reinstate 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. |
`getExternalFiles()` is an API that could optionally be provided by a tsserver plugin to notify the server of any additional files that should belong to a particular project. This API was removed in #34260 mainly due to performance reasons. However, with the introduction of "solution-style" tsconfig in typescript 3.9, the Angular extension could no longer reliably detect the owning Project solely based on the ancestor tsconfig.json. In order to support this use case, we have to reinstate `getExternalFiles()`. Fixes angular/vscode-ng-language-service#824 PR Close #37750
Reopening this until fix gets released next week. |
This has been fixed in v0.1000.1 which just got released. |
@kyliau see my comment here angular/angular#37781 (comment) . This is still not working. |
@JohnnyDevNull, could you provide Console output (Go to toolbar --> View --> Output, and copy the contents)?
|
@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 |
@kyliau here it is: Edit: This was a complete fresh install, also after re-installing the cli globally |
@JohnnyDevNull It looks like Angular LS is activated on |
@kyliau what i've done is tldr; i think you should repoen issue angular/angular#37781 because it sill does not work
when you now import the MyTestModule into the AppModule at the my-tester App no path matching is working. 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: I've done the clean Angular-Cli setup to be sure that no of my configurations in my library project breaks something. 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 I don't get any error. I did these steps: Create workspace:
add imports to app.module.ts:
console output:
|
|
Note: please don’t remove Removing this, will cause undefined behaviour, and by no means is supported. I think what you are experiencing sound similar to angular/angular-cli#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
My output still is the same, but the errors are gone: |
@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 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. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
`getExternalFiles()` is an API that could optionally be provided by a tsserver plugin to notify the server of any additional files that should belong to a particular project. This API was removed in angular#34260 mainly due to performance reasons. However, with the introduction of "solution-style" tsconfig in typescript 3.9, the Angular extension could no longer reliably detect the owning Project solely based on the ancestor tsconfig.json. In order to support this use case, we have to reinstate `getExternalFiles()`. Fixes angular/vscode-ng-language-service#824 PR Close angular#37750
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
The text was updated successfully, but these errors were encountered: