Visual Studio Code - Missing most syntax highlighting for JavaScript - javascript

When editing JavaScript files in Visual Studio Code on my Mac I'm only seeing very basic syntax highlighting. The same also applies for TypeScript files.
I'm certain there used to be more syntax highlighting when editing JavaScript and TypeScript files.
I already tried to disable all extensions but it didn't help.
Visual Studio Code version: 1.25.1
How can I re-enable proper syntax highlighting in Visual Studio Code?

Uninstall Visual Studio Code using the description here: How to completely uninstall vscode on mac
After a reinstall of Visual Studio Code syntax highlighting works fine again.

Please try to switch color theme back and forth (Ctrl/CMD+Shift+P and type theme and then select random one. Repet procedure to revert to one you choose).
For me it solves issues with syntax highlighting in version 1.38.1

I had some problems with my js/ts codes syntax highlighting.
(In the basic theme, 'functions' don't turn yellow, 'booleans' don't turn dark blue, 'types' don't turn green. However, when I hovered them, they showed the right colors)
I looked for the answer everywhere but not solved. Today I accidentally uninstalled the extension "Syntax Highlighter", and it just solved.
enter image description here
I believe this is not the problem of the extension, but it may somehow cover the config of original js/ts.
Hope this can help someone who has the same problem.

Related

My js code doesn't show any definition when hover or press ctrl+k or ctrl+space

My question simply is:
I can't show any definition when hover on my specially my javaScript code
even by hovering or pressing ctrl+k or ctrl+space
I tried my ways but I can't reach this point
Installing the Visual Studio IntelliCode extension will fix that.
But even with that installed, since JavaScript is a loosely typed language, things like variables will just show any when you hover over them.
Installing IntelliSense removed this issue for me.

Visual Studio 2019 doesn't indent or have Intellisense in JavaScript after [Enter]

VS 2019 Community 16.7.3. When editing JavaScript, I finish a line, press [Enter] and the cursor goes to column 1 rather than keeping the indent. This used to work and still does if I'm editing C#. I've tried resetting all options, deleting .suo and user files, changing indent options: none, block, smart, switching between tabs and spaces, but nothing changes.
Secondly, Intellisense doesn't work in JavaScript either. Code is not displayed and no color difference within the script tags.
How can I make the editor indent and intellisense work when writing JavaScript?
If you have the Visual Studio Intellicode extension disabled, you may have to re-enable it.
I use TypeScript and when this happened it was because of a bug that when the Visual Studio Intellicode extension was disabled, the TypeScript editor would break and treat the files as a regular text file. After re-enabling the extension the editor worked as expected. I'm unsure if it affects the JavaScript editor. Here is a link to the submitted issue.

Red Squiggly Lines in VS Code

My Visual Studio code editor keeps underlining my code incorrectly and I don't know how to stop it.
Here is an example of my JavaScript being squiggled:
I have tried installing prettier, eslint but it does nothing to solve this.
How can I stop these squiggly lines from appearing incorrectly? I want them IF they are correct.
If I click on the problems tab, it shows this:
Solved! Thanks to zscoop98's answer, I was able to find this page which showed there exists an option standard.enable in settings.json that, after setting that from true to false, it solved the issue and there are no longer these annoying red squiggly lines.
And you can uninstall ESLint extension in vs code to get rid of red lines.You can search ESLint extension in extions folder of vscode

VS code Intellisense support in PHTML-files for inline css / inline javascript

I am using Visual Studio Code since a few days and I was wondering if it is possible to have support for Intellisense inside inlined css-blocks and/or inlined javascript in '.phtml'-files.
I could not find a solution online only a few people complaining about this not working from a few months back but I nothing that worked for me.
It would really help me a lot if someone has any idea how to solve this or at least a step in the right direction, or if I have to move the css and js into external files (of course thats better(!) but thats not the point here ;))
Thanks in advance.
This works for me after 2 changes in vscode.
User settings
I added below to the user settings
"files.associations": {
"*.phtml": "php"
},
Extension
Installing the intelliphense extension
And now both php as well as css intellisense works
Make sure you have no other conflicting extension enabled which may cause issue.
Also do have a look at the below open thread
https://github.com/Microsoft/vscode/issues/670

Javascript code folding only works for functions with Web Essentials

I've got Web Essentials 2.5.3 installed in Visual Studio 2013 and the code folding feature works fine for function declarations but fails to show expand/collapse icons for object literals and array literals. Its driving me nuts and I can't seem to find anything in the Web Essentials settings to control these settings.
Has anyone encountered this issue or know of a solution?
I have the same issue. But I have found a work around for this, follow these 2 steps
1.select code snippet you want fold.
2.right click on selection, go to outlining Hide Selection. Short cut: (Ctrl+M, Ctrl+H)
This will work for you.

Categories