Posts

Showing posts with the label vsc

Fix Inability to Move Files to Trash in VSC

You need to configure an environment variable to tell Electron (what VSC is built on) how to trash things. In ~/.profile add: export ELECTRON_TRASH=trash-put You'll need to install trash-put separately. "gio trash" might be a pre-installed alternative. I thought that's what I was using but apparently not.

VSC Vanishing Go Imports

With the Go extension installed in VSC, by default if you have an unused import, when you save, it will disappear. If you're like me and you may habitually press ctrl+s, this is very frustrating. After a lot of messing around in VSC's settings. I learned that this "feature" has nothing to do with the settings pertaining to linting or formatting. It's actually to do with automatic import organisation, which you can configure as follows in VSC's settings.json. "[go]" : { "editor.codeActionsOnSave" : { "source.organizeImports" : false, }, } This solution comes from this StackOverflow answer. You can still organise imports with the shortcut shift+alt+o.