简体   繁体   中英

Visual studio 2022 intellisense not working on javascript

I am using VS 2022 and working on a ASP.NET Core Web App .NET 6.0 I have added a script tag with javascript type, writing code inside the tags is like writing inside notepad. The intellisense is not picking up or is very slow.

Is there a way to activate a better intellisense or increase the response time of it?

You can gather logs from the TypeScript & JavaScript language service by setting an environment variable TSS_LOG to a value such as -file C:/temp/logs/tsserver.log -level verbose and then launching VS. (Note: The folder specified, eg C:\temp\logs , must already exist for the logs to get created). The log files can get large, so remove the setting after investigations are done.

If new projects are showing the issue too, then sticking with File / New Project and creating an empty ASP.NET web app, then adding a .js file to it and trying to get intellisense, would be the simplest to investigate.

If you don't see the log file getting created after reproducing the issue, then I'd verify that the language service process is even starting. The easiest way to do this is to open a .js file in VS (so it definitely should be running), then open Task manager and do to the "Details" tab. If you sort by process name you should have a few instances of node.exe running. If you right click on the columns and add the "Command line" column, you can identify the language service one by its arguments (it'll be the one running tsserver.js with the --expose-gc flag). See below for a screen shot from my machine.

If everything is running fine, you should get two log files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM