Save the file and then you will be able to close it.
You can use keyboard shortcuts (ctrl+s on Windows and Linux, and cmd+s on macOS). Or use the menu bar’s File > Save item, or use the File: Save command in the command palette.
If you try to close the editor tab while there are unsaved changes (or more precisely, the last editor tab for that file, since you can have multiple editor tabs open for the same file), you’ll get a popup that says something to the effect of "Do you want to save the changes you made to <filename>? Your changes will be lost if you don’t save them". And from that popup, you should be able to select from the following options: "Don’t Save", "Cancel", "Save".
So seeing that you tried to close the file, I’m quite perplexed as to how you didn’t figure this out on your own… Unless you didn’t get that popup for some reason, in which case something might be messed up with your VS Code installation. Or maybe you have an extension messing with VS Code’s builtin functionality, in which case you can do an extension bisect to see if that’s the case, and what extension could be causing it.
2
Answers
The white dot means that there are changes in the file that haven’t been saved. Press Ctrl+S to save your changes and the dot should disappear.
The white dot means there are unsaved changes.
Save the file and then you will be able to close it.
You can use keyboard shortcuts (ctrl+s on Windows and Linux, and cmd+s on macOS). Or use the menu bar’s
File > Save
item, or use theFile: Save
command in the command palette.If you try to close the editor tab while there are unsaved changes (or more precisely, the last editor tab for that file, since you can have multiple editor tabs open for the same file), you’ll get a popup that says something to the effect of "Do you want to save the changes you made to <filename>? Your changes will be lost if you don’t save them". And from that popup, you should be able to select from the following options: "Don’t Save", "Cancel", "Save".
So seeing that you tried to close the file, I’m quite perplexed as to how you didn’t figure this out on your own… Unless you didn’t get that popup for some reason, in which case something might be messed up with your VS Code installation. Or maybe you have an extension messing with VS Code’s builtin functionality, in which case you can do an extension bisect to see if that’s the case, and what extension could be causing it.