Why vs Code Contains Emphasized Items but No Error?

I'm writing a React project in VS code. I met this problem in VS code. In my project, this folder shows Contains emphasized items and I know it means there is an error in my files. But in the picture:

,

I have checked all files but no error was found. So this makes me feel confused.

I have searched this problem on google and found a similar GitHub issue.

26 Answers

Use the command, CTRL+SHIFT+P on windows or COMMAND+SHIFT+P on mac, then search "Developer: reload window", click on it, your vs will reload.

Unlike in this earlier answer, I did not have to reset the cache.

5

Committing once with git can be resolved.

4
  1. Run react-native start --reset-cache
  2. Reload VS with the command Ctrl + shift + p and searching Developer: Reload Window

Just to know I was in an Angular project, using Windows, WSL, I created a service and after that I renamed it, when I committed the changes, I noticed this red mark.

I just pressed Ctrl + Shift + P and then typed: Developer: Reload Window. It will just reload the entire project and the mark will disappear.

3

I saw this message after moving a file from one folder to another, renaming and committing everything to git.

The Visual Studio "Problems" window showed an issue with the "deleted" file. Somehow VS had left a window open for the original location of the file and in it's tab the file was labeled as "deleted". Closing that tab in VS got rid of the "Contains emphasized items"

This happens when you've deleted some files/folders from project and haven't yet added the event to a commit.

There is multiple solutions

Option 1: Close the VS code and open it again

Option 2: Commit your code chages in git(if you are using)

Option 3: Reload the VS code - Use the command, CTRL+SHIFT+P on windows or COMMAND+SHIFT+P on mac, then search "Developer: reload window", click on it

When I was working on a angular application in the Visual Studio Code editor, I observed this. And resolved it by simply restarting VSCode.

1

Had the same issue.

Committing multiple times from within the VS Code did not help.

However, once I added the files and committed from the shell, everything fell in place.

I noticed this when I working on a Rails application using Visual Studio Code editor.

I used an underscore for a directory name, that is instead of staticpages, I named the directory static_pages.

However, committing the code change using the below commands fixed it:

git add .
git commit -m "commit message"

That's all.

I hope this helps

In my case, the already deleted files were opened in the VS code. Closing those files resolved my issue.

0

This is an edge case but I am putting it here just in case it helps someone in the future...

I had accidentally done a git add . before I had fully set up my .gitignore file, so it had staged a couple folders with hundreds of files (mostly the entire Electron out folder) that I definitely didn't want in the repo.

This is the procedure I went thru to clean up my staged files:

  • updated .gitignore so that when I reverted the add I could be sure that GIT was ignoring the right files and folders (which worked, hundreds to 7, the moment I did the git reset)
  • git reset -f
  • noting that the correct files were now in line to be staged, I did:
    • git add .
    • git commit -m "message"
    • git push

When I returned to the regular file list, I noticed that node_modules was showing the "emphasized items" indicator. So just to make sure that I had actually gotten everything committed and such I tweaked .gitignore again (added node_modules/** just in case lol), did another commit, and still had the issue. Nothing helped, and like I said, it was confusing because the indicated files were under node_modules and it was in the ignore list.

So I hit cmd-p and ran Developer: Reload Window. It turned out out all I had to do was reload the window and the emphasized items went away entirely. Simple fix, confusing problem.

Apparently adding, reverting, then adding a subset of my directories confused vs code and it just needed to reload the window.

I had the same issue, pushing to git didn't solve the problem. I simply closed all files, cancelled my dev server and restarted VS Code. The emphasizing was gone.

git add . git commit -m "your commit description"

If this not helps, after commit restart the VS CODE

1

Select this tab from toolbar - View -> Problems or Ctrl + Shift + M and on bottom Terminal you will see whats problem is it.

In addition to this answer, I also had to commit after closing.

For me it's because of the folder contains the .DS_Store file generated by my mac.

1

This error occurs because there are pending changes to be saved in git, so to solve this problem, open a command terminal and go to the folder where your project is located, execute the following commands

git add .
git commit -m "your commit description"

In my case it works with this.

1

VSCode using React. Changed a folder name in the src folder. Would not pass compilation after changing names of components. Committed to git. Restarted the app with npm start. All is well.

You may have hidden files. My Explorer was not listing hidden files in those directories. Hidden files on Linux begin with a . (for example, .hidden.txt)

Had the same issue, had copied files from a folder into another folder. git commit as suggested solved the issue.

1

commit the changes, if still, the error is there, reopen the vscode

answers mostly amazing. if your problem still doesn't recover after tried Developer: Reload Window and committing again, maybe you open a folder in vscode that inside your current folder. if your project folder has a folder that contains second .git folder, delete the second one (in inside folder). then try;

git add <folder_name>
git commit -m "your_msg"

i hope it works for someone

I just had same issue and was resolved using ctrl+shift+Pand searched for 'Developer:reload windows'. It got the issue resolved for me when I was planning of creating a new project to replace that. Hopping this helps! This issue occurred after refactoring my project files; Renaming, deleting and relocating of files and folders I mean. Looking at why this happened,I got this;beccause those folders and files wasn't yet committed and upon changes the editor couldn't identify it so it see's it an issue. I am using <#Flutter>

For anyone who may be encountering a similar issue, but is using Perforce, and for whom the Developer: Reload Window command doesn't work, the thing that worked for me was to revert the whole folder. I was seeing the red dot 🔴 even though no files were showing an error, and no files were checked out. Doing a revert on the entire folder made the red dot go away.

Sometimes it is not about code errors or editor bugs, but only a temporary advice if you started to write some codes (without errors), but it is still not completed, and you save the document.

Example: Usually, when I need to write a JS functions or a CSS class name that requires well-organized names and structures, before I write the codes or properties themselves, I write empty structures like:

function createSomething(){};
function editSomething(){};
function deleteSomething(){};

Or:

.class-name-a{}
.class-name-b{}
.class-name-c{}

So, after writing a good order of codes with good functions names or class names, I finally start to fill each function or CSS class, and when I save the final file, the message "contains emphasized items" will be gone.

uninstall any extension if you have installed in vs code.It will be solved.

1
Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article