-
Notifications
You must be signed in to change notification settings - Fork 123
Language service not loading with config option "files: []" #793
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
Comments
I have also tried using TypeScript 3.9.3 from the project TS version. |
I have tried setting |
From another workspace:
And the log file: |
Thanks for the report! I could not reproduce this with the steps you provided. Could you verify that you've opened VSCode to the root of the project, and the root contains |
@ayazhafiz You're welcome! Thanks for taking a look. Hoping I can figure out what's going on here. Been burning a lot of time without these features :/
Same behavior. When run from project directory: Ran VSCode:
Opened app.component.html, VSCode NGLS Log:
Completion / etc still not working :/ |
I also should have reported that this is occurring on MacOS. |
What other info should I be looking at / what can I provide to get to the bottom of this? |
My uneducated overview of the log file leads me to believe that there is an issue with the new reference-based tsconfig.json structure in Angular 10 projects causing the language service to fail to resolve typescript and other various other file roots and settings. But that doesn't hold up since you said it worked for you. Also doesn't explain why it was already failing before the upgrade to Angular 9. Something feels fishy. Log from the last attempt: |
I've been 'hacking' tsconfig.json a bit to try to get the angular language service to recognize it as an angular project... finally ended up with something a little different:
|
What did your tsconfig look like originally? |
The one listed in the log file is the output after the config file is parsed by TS, so it doesn't always line up (e.g. in regard to rootNames) |
The issue is that |
The original is the TS config file that was generated by angular when I created the example project in the reproduction steps listed in the original issue report. I will post it when I get back to my computer, but I believe you should have it on your computer if you generated the example. The example that I pasted, which was modified, was purely to try to work around the issue that the language service can't seem to resolve files in the original. |
Original tsconfig.json, as generated:
|
I guess it's worth noting that the Angular language service does resolve the referenced tsconfig.app.json/etc projects, and does enable language services for those... then subsequently fails to resolve configuration for any HTML files. As seen here: #793 (comment) This is what prompted me to go down the path of getting the primary tsconfig file to be recognized. |
That being said, I deleted Interesting that it's generating a tsconfig file that seems to break the language service, but... you said it worked for you. Out of curiosity, does your generated |
Failing to find a config for HTML files isn't a big deal, since the config files are only relevant for TS sources. The relevant validation code: vscode-ng-language-service/server/src/session.ts Lines 475 to 486 in da08740
I think we can fall back on trying to resolve node_modules if the project files are empty (not sure of all the implications of this), but for now removing |
(Also thank you for looking into this. At this point my environment is functional, so if you choose to call it resolved, that's fine, but I suspect that others would be running into this as well if my assumptions are correct -- and I'm happy to keep digging.) |
It didn't; I probably installed the cli locally when I tried this yesterday, but did it again an hour ago and got the same config you did. |
Yeah, let's leave this open for now. We don't want the only solution to be deleting a config auto-generated by Angular. |
Awesome. Glad I could be of assistance! Let me know if there's anything I can do to help. |
Thank you again. |
So we can either have functional typescript or functional angular :/ but not both at the same time. |
Adding the following to files: will at least get things working for the app sources, but I don't know what kind of other impacts this will have:
|
I was dumb, didn't realize the "solution" config comes with new editor features in ts39. See kyliau's comment at the bottom |
I might spend some more time on this later, but for anyone who doesn't care about performance or good practices and just wants to use this extension's features (don't thumbs me down for this):
Everything will work, but the extension will never properly initialize so you will see an infinite initializing message Here is the actual error, something is going on with the new structure:
|
@c0dybrown this sounds like a separate issue. Please see if #797 solves it; if not, feel free to open a new issue. |
tldr; Angular extension v0.1000.0-rc.0 has been released and can be downloaded here. If you'd like to try it out, please keep in mind that it has to be installed manually. See here for installation instructions.
Hopefully this clears up the confusion why the extension is not working for users who are currently using Angular v10 rc. As always, please let us know if you run into any issues, and thank you for helping us test v10 rc! |
I'm closing this issue in favor of #824. |
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. |
Describe the bug
Angular HTML Template syntax validation/completion/intelli-sense are not working.
To Reproduce
Steps to reproduce the behavior:
npm install -g @angular/cli@next
ng new angular10example
cd angular10example
npm i
Open project in VSCode with Angular Language Service extension installed
Expected behavior
Angular HTML template editor should provide validition, syntax checking, completion and "go to definition" functionality. Etc etc.
Logs
Please attach two logs:
nglangsvc.log
Screenshots
Additional context
Not sure when this stopped working. It actually hasn't been working for me for about a week, even in my Angular 9 project, and I haven't been able to figure out what's causing the problem, but I've since upgraded to Angular 10 and it's still not working.
The text was updated successfully, but these errors were encountered: