-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Visual Studio not syntax highlighting with the new JavaScript language service #20680
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'm experiencing the same issue with Visual Studio 2017 Version 15.4.4 |
does the file has a line with more than 10k characters? |
I'm seeing this in 15.5.5. No lines with >10k characters. I also don't get any intellisense features unless I use the old language service. With the new language service enabled, typescript files are highlighted and intellisense works. However, javascript files are not highlighted and don't have any intellisense suggestions. |
Thanks for the details @owen2! (It would be great if @JCKodel and @edwlee could confirm that they're seeing the same.) Do you happen to know which version of TypeScript you're using? If you're not setting it explicitly, I find the easiest way to find out for sure is to find the In @JCKodel's original screenshots, the navigation bar (at the top left of the editor pane) shows that the JS file is in a project. Are you seeing the same? It would be strange to see that but not get IntelliSense. |
Aha, it sounds like there's an issue with TextMate caching in 15.5.*. Can you try deleting |
@amcasey Visual Studio gave me a lot of issues (including the Aero quick menu stopped showing my last/pinned projects), so I had to reinstall Windows (you know, too much gargabe, uninstall always leave some trash behind, anyway... until Windows have a decent package manager (aka apt-get), we have to suffer the consequences if we want the Amazing-Visual-Studio-Sorry-VSCode-You-Are-No-Match) Since then, I didn't have any issues regarding this anymore. Honestly, I did forget about this issue (I had to go to options right now to be sure I'm using the new language service). So far, so good (note: I'm using js only, no typescript, using vue and framework7). I have also figured out that the best kind of project to work with javascript is shared projects. It's not perfect (for instance: File Nesting plugin doesn't work), but at least, so far, it had no problems. Node folder is kept hidden, no bin/obj folder, Resharper works fine, etc. These screenshots are for the same kind of project, but inside a .net core asp.net project (but, again, even this project is working, AFAIK). |
@JCKodel thanks for the update! We've definitely had cases where the TextMate extension needed to be repaired. Maybe that was the issue you were seeing. In any case, glad things are working now. |
My project file specifies typescript 1.8, but we use gulp to compile/bundle everything. I did try deleting my textmate cache as @amcasey suggested and turned the new language service back on. I now see unhighlighted javascript. |
@owen2 is it just the highlighting that's giving you trouble or Intellisense too? Is there anything in the Navigation Bars? |
No intellisense, but I have stuff in the navigation bars. |
Just noticed my "Visual Studio Extension for Textmate Grammars" extension was disabled. I think I disabled it when I had performance issues and disabled all extensions I didn't recognize. |
Actually, I don't believe the language service in VS 15.5 supports TS 1.8. Can you try rolling forward to 2.1 (our current minimum) or 2.7 (our current release)? |
Enabling that extension brought back all of the missing functionality. :) |
Disabling that extension would prevent colorization. 😄 |
I'll go ahead and close this issue then? |
I'm good and it looks like @JCKodel isn't experiencing this anymore. |
Thanks! @edwlee, please post an update if you're still having problems. |
I don't know why this has to be reported in TypeScript repository, but, whatever...
Expected behavior:

[ ] Enable the new JavaScript language service.
Actual behavior:

[X] Enable thre new JavaScript language service.
(Whenever this setting is changed inside VS, you need to close and reopen the .js)
The text was updated successfully, but these errors were encountered: