Vscode-ng-language-service: Not working in standalone HTML files in larger project

Created on 15 Dec 2016  路  16Comments  路  Source: angular/vscode-ng-language-service

Hi,

i have found very strange behavior. I tried your extension in my project, but it is working only in inline templates, not in standalone html files. But in my project i`m using our company npm packages which are not in public npm repository. So i wanted to reduce project to smaller footprint which i can put on github to reproduce problem.

But when i reduced it it started working also in standalone html files. Well i have to try to find when it stops working, but currently i don`t have that case. But definitely there is some problem when it stops working in standalone html files.

bug

Most helpful comment

Finaly i`ve manage to create sample that should illustrate problem.

https://github.com/kukjevov/ngls-standalone-html-problem

I have latest VSCode and 0.0.11 ngls. I have other plugins too, but i think they do not interfere.
In sample:

  • it is working in standalone template in navigation.component.html
  • it is working in inline template in forbidden.component.ts
  • it is not working in standalone template in home.component.html (and probably also in others in pages dir)

Thank you for your help.
Have a nice Christmas :-)

All 16 comments

Others have seen the same issue but I haven't been able to reproduce it either.

Can you continue to try to narrow it down?

I tested on a large project and seems not working, it work only in small app

I try to reproduce it as soon as possible.

Just one more question. If i understand it correctly, application must be compilable? If you provide solution with npm packages which cant be downloaded it won`t work, am i right?

Generally that is true, especially for the diagnostic errors. In some cases I can provide completions in an application that is not AoT compliant but the results are not very accurate.

Hi,

i have been playing with it, but only for a while, but another interesting happened. In one project it is working in one template and not working in another one. I hope i will have time tomorrow for this. To get you some data to work with.

Finaly i`ve manage to create sample that should illustrate problem.

https://github.com/kukjevov/ngls-standalone-html-problem

I have latest VSCode and 0.0.11 ngls. I have other plugins too, but i think they do not interfere.
In sample:

  • it is working in standalone template in navigation.component.html
  • it is working in inline template in forbidden.component.ts
  • it is not working in standalone template in home.component.html (and probably also in others in pages dir)

Thank you for your help.
Have a nice Christmas :-)

I'm having the same problem. A small project works fine, but a large one does not.

Can you attach a copy of the log output of the language service?

Hi.

I will provide log from VSCode, but since current version is not supporting typescript 2.2.x i cant test it so far. I will provide output when there will be support for typescript and as i have seen in other issues it will sometimes soon :).

Confirming that in inline templates it works, but in my standalone templates, urls look like this:
templateUrl: Config.Basic.viewsPath + 'orders/details.html',
Does the dynamic nature of the url affect its behavior?

@ayyash Yes. The language service uses the same mechanism used by AOT to determine how to find the templates. If AOT cannot find them then neither will the language service.

Hi @chuckjaz i have tested latest version of vscode-ng-language-service with typescript 2.3 RC.

I updated project to be AOT compliant and it is working even in standalone templates for bigger project.

Only thing that is in logs which is caused by plugin that it does not support 2.3 RC is

Config errors encountered and need to be reported: 1
Unknown compiler option 'plugins'

I look forward for your update to RC 2.3 of typescript. It will be great.

I was thinking about one thing. Is it possible that if project is not AOT compliant that then it will not work in standalone templates? Because when i was creating this issue my project was not using AOT and it was not working. Now im using AOT and i did not had any problem with it now.

I am closing this issue because for me it is working now, since my project is compilable using AOT.

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

Related issues

frederikschubert picture frederikschubert  路  3Comments

BorntraegerMarc picture BorntraegerMarc  路  5Comments

crisz picture crisz  路  5Comments

seangwright picture seangwright  路  4Comments

sheikalthaf picture sheikalthaf  路  5Comments