Skip to content
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

Intellisense for Angular Templates not working in v0.900.0-next.1 #416

Closed
prasworld opened this issue Oct 11, 2019 · 17 comments
Closed

Intellisense for Angular Templates not working in v0.900.0-next.1 #416

prasworld opened this issue Oct 11, 2019 · 17 comments

Comments

@prasworld
Copy link

After the latest upgrade the angular intellisense has ceased to work.
Cli version @angular/cli 7.3.0
Platform Windows
VS Code Version 1.39.1

@iamcco
Copy link
Contributor

iamcco commented Oct 11, 2019

Seems need @angular/language-service >= v9.0.0 to work

@kyliau
Copy link
Contributor

kyliau commented Oct 11, 2019

Thanks for trying out the beta version!
Could you please open the "Output" console in vscode and paste the logs here?
It should look something like this:

Screen Shot 2019-10-11 at 10 43 23 AM

@iamcco
Copy link
Contributor

iamcco commented Oct 15, 2019

I have this log:

[Info  - 2:33:10 PM] Using typescript v3.5.3 from /Users/aioi/.vscode/extensions/angular.ng-template-0.900.0-next.1/node_modules/typescript
[Info  - 2:33:10 PM] Using @angular/language-service v9.0.0-next.10 from /Users/aioi/.vscode/extensions/angular.ng-template-0.900.0-next.1/server/node_modules/@angular/language-service
[Info  - 2:33:10 PM] Log file: /Users/aioi/Library/Application Support/Code/logs/20191015T142646/exthost1/Angular.ng-template/nglangsvc.log
[Info  - 2:33:18 PM] Disabling language service for /Users/aioi/workspace/pxn/anduin/tsconfig.json because it is not an Angular project.

It's weird the log it is not an Angular project.

@kyliau
Copy link
Contributor

kyliau commented Oct 15, 2019

@iamcco Could you please make sure the project node_modules has @angular/core installed?

@kyliau kyliau changed the title Intellisense for Angular Templates not working Intellisense for Angular Templates not working in v0.900.0-next.1 Oct 15, 2019
@iamcco
Copy link
Contributor

iamcco commented Oct 16, 2019

image

I have @angular/core installed and it works with previous version。

@kyliau
Copy link
Contributor

kyliau commented Oct 16, 2019

@iamcco Do you mind sharing your tsconfig.json please? Is node_modules excluded?

@iamcco
Copy link
Contributor

iamcco commented Oct 17, 2019

The tsconfig.json

{
  "compileOnSave": false,
  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "module": "esnext",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "allowJs": true,
    "target": "es2015",
    "lib": [
      "es2017",
      "dom"
    ],

    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "noUnusedLocals": true,
    "skipLibCheck": true,

    // "strict": true,
    "alwaysStrict": true,
    "noImplicitAny": false,
    "noImplicitThis": true,
    "strictFunctionTypes": true,
    "strictNullChecks": true
  }
}

kyliau added a commit to kyliau/vscode-ng-language-service that referenced this issue Oct 17, 2019
This PR reverts the change to disable the language service if
@angular/core is not detected in a project while
angular#416 is
being investigated.
@andrius-pra
Copy link
Collaborator

Which version of @angular/core do you use? You can find version in package.json file.

kyliau added a commit to kyliau/vscode-ng-language-service that referenced this issue Oct 17, 2019
This PR reverts the change to disable the language service if
@angular/core is not detected in a project while
angular#416 is
being investigated.
@kyliau
Copy link
Contributor

kyliau commented Oct 17, 2019

@iamcco The tsconfig looks fine. Based on the screenshot you shared, it looks like there's another issue that could be the probable cause. It says "No config file for ..."
Please make sure you open a TypeScript file that has Angular directives in it and try again. It would be helpful if you could actually share the entire output messages and also the log file. Thank you!

@iamcco
Copy link
Contributor

iamcco commented Oct 18, 2019

@andrius-pra I have @angular/core": "8.2.6"

@kyliau
this is the full log when open ts file first.

[Info  - 10:40:37 AM] Using typescript v3.5.3 from /Users/aioi/.vscode/extensions/angular.ng-template-0.900.0-next.1/node_modules/typescript
[Info  - 10:40:37 AM] Using @angular/language-service v9.0.0-next.10 from /Users/aioi/.vscode/extensions/angular.ng-template-0.900.0-next.1/server/node_modules/@angular/language-service
[Info  - 10:40:37 AM] Log file: /Users/aioi/Library/Application Support/Code/logs/20191018T103958/exthost3/Angular.ng-template/nglangsvc.log
[Info  - 10:40:45 AM] Disabling language service for /Users/aioi/workspace/pxn/anduin/tsconfig.json because it is not an Angular project.

if i first open html file it will have the No config file for... log

[Info  - 10:43:52 AM] Using typescript v3.5.3 from /Users/aioi/.vscode/extensions/angular.ng-template-0.900.0-next.1/node_modules/typescript
[Info  - 10:43:52 AM] Using @angular/language-service v9.0.0-next.10 from /Users/aioi/.vscode/extensions/angular.ng-template-0.900.0-next.1/server/node_modules/@angular/language-service
[Info  - 10:43:52 AM] Log file: /Users/aioi/Library/Application Support/Code/logs/20191018T103958/exthost4/Angular.ng-template/nglangsvc.log
[Info  - 10:43:56 AM] Disabling language service for /Users/aioi/workspace/pxn/anduin/tsconfig.json because it is not an Angular project.
[Error - 10:43:56 AM] No config file for /Users/aioi/workspace/pxn/anduin/src/app/modules/new-pos/new-pos-earnings.component.html
[Info  - 10:44:36 AM] Disabling language service for /Users/aioi/workspace/pxn/anduin/tsconfig.json because it is not an Angular project.

log.log

@kyliau
Copy link
Contributor

kyliau commented Oct 18, 2019

@iamcco Thank you so much for sharing the log file, it's very helpful. In your case, there are files in your project which exceeded the hard-coded limit in tsserver. Specifically, it's this line:

Info 38   [10:44:30.409] Non TS file size exceeded limit (22477522). Largest files: /Users/aioi/workspace/pxn/anduin/dist/trading-view/charting_library.min.d.ts:49496, /Users/aioi/workspace/pxn/anduin/vendor/trading-view/charting_library.min.d.ts:49496, /Users/aioi/workspace/pxn/anduin/src/app/models/eos-proxy-abi.ts:34245, /Users/aioi/workspace/pxn/anduin/src/app/modules/kyc/countries.ts:24028, /Users/aioi/workspace/pxn/anduin/src/app/modules/kyc-result/countries.ts:24028

The total size of your project exceeded 22477522 bytes, which causes tsserver to automatically disable the language service. The message about the project not being Angular is just a red herring.
Do you actually get native TypeScript language features? The same should be happening to the native tsserver.

kyliau added a commit to kyliau/vscode-ng-language-service that referenced this issue Oct 18, 2019
When making the check to determine if a project is Angular, it could be
the case that the language service is already disabled. This happens
when there are files in the project that exceeded limit.

This PR fixes the issue by first checking if the language service is
already disabled. Also added much more information to the logs to help
users diagnose the problem. Messages are logged to both remote console
(vscode) and file so that the former could inform users in their editor,
and the latter makes it much easier to correlate the sequence of events
in both TypeScript and Angular.

Related: angular#416
kyliau added a commit to kyliau/vscode-ng-language-service that referenced this issue Oct 18, 2019
When making the check to determine if a project is Angular, it could be
the case that the language service is already disabled. This happens
when there are files in the project that exceeded limit.

This PR fixes the issue by first checking if the language service is
already disabled. Also added much more information to the logs to help
users diagnose the problem. Messages are logged to both remote console
(vscode) and file so that the former could inform users in their editor,
and the latter makes it much easier to correlate the sequence of events
in both TypeScript and Angular.

Related: angular#416
kyliau added a commit to kyliau/vscode-ng-language-service that referenced this issue Oct 18, 2019
When making the check to determine if a project is Angular, it could be
the case that the language service is already disabled. This happens
when there are files in the project that exceeded limit.

This PR fixes the issue by first checking if the language service is
already disabled. Also added much more information to the logs to help
users diagnose the problem. Messages are logged to both remote console
(vscode) and file so that the former could inform users in their editor,
and the latter makes it much easier to correlate the sequence of events
in both TypeScript and Angular.

Related: angular#416
kyliau added a commit to kyliau/vscode-ng-language-service that referenced this issue Oct 18, 2019
When making the check to determine if a project is Angular, it could be
the case that the language service is already disabled. This happens
when there are files in the project that exceeded limit.

This PR fixes the issue by first checking if the language service is
already disabled. Also added much more information to the logs to help
users diagnose the problem. Messages are logged to both remote console
(vscode) and file so that the former could inform users in their editor,
and the latter makes it much easier to correlate the sequence of events
in both TypeScript and Angular.

Related: angular#416
kyliau added a commit that referenced this issue Oct 18, 2019
When making the check to determine if a project is Angular, it could be
the case that the language service is already disabled. This happens
when there are files in the project that exceeded limit.

This PR fixes the issue by first checking if the language service is
already disabled. Also added much more information to the logs to help
users diagnose the problem. Messages are logged to both remote console
(vscode) and file so that the former could inform users in their editor,
and the latter makes it much easier to correlate the sequence of events
in both TypeScript and Angular.

Related: #416
@iamcco
Copy link
Contributor

iamcco commented Oct 19, 2019

It's weird, I can also have native tsserver completion items.

update plugin to latst version and still get this error.

If delete dist directory I get this log now.

log.log

@kyliau
Copy link
Contributor

kyliau commented Oct 21, 2019

@iamcco It looks like you have an old version of @angular/language-service in /Users/aioiyuuko/workspaces/pxn/anduin/node_modules/. Could you please try to update to the latest v9 version and try again?
Even though there's a v9 version bundled with the extension as a fallback, it looks like tsserver prioritizes the node_modules directory where TS is found over the provided pluginProbeLocations.

@kyliau
Copy link
Contributor

kyliau commented Oct 21, 2019

I filed an issue with TypeScript: microsoft/TypeScript#34616

@iamcco
Copy link
Contributor

iamcco commented Oct 22, 2019

It works if install the latest version of @angular/language-service

@kyliau
Copy link
Contributor

kyliau commented Oct 22, 2019

I'll mark this issue closed for now. Please open another issue if similar problem occurs.

@kyliau kyliau closed this as completed Oct 22, 2019
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants