question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Don't create workspace settings.json unless a color is chosen

See original GitHub issue

If Peacock is disabled and I open VSCode, no workspace folder is created:

$ ls -a
./  ../
$ code .
$ ls -a
./  ../

If Peacock is enabled (even with "peacock.surpriseMeOnStartup": false), it creates a workspace folder with default settings:

$ ls -a
./  ../
$ code .
$ ls -a
./  ../  .vscode/
$ bat --style=header .vscode/*
File: .vscode/settings.json
{
    "workbench.colorCustomizations": {
        "editor.selectionBackground": "#888",
        "editor.selectionHighlightBackground": "#555",
        "editor.findMatchHighlightBackground": "#2cdd1c65",
        "editorIndentGuide.activeBackground": "#888",
        "titleBar.activeBackground": "#777777",
        "titleBar.inactiveBackground": "#77777799",
        "titleBar.activeForeground": "#e7e7e7",
        "titleBar.inactiveForeground": "#e7e7e799",
        "tab.activeBorder": "#909090"
    }
}

I have .vscode directories with default settings littered all over because of this. Please only create settings if a color is specifically chosen (or if “surprise me on startup” is set, of course).

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
johnpapacommented, Jul 27, 2019

The accents are a new feature which can be turned on or off in settings (see the readme and changelog). The statusbar is just to show you what your color is. So these don’t affect it.

The memento is just a variable that stores the color you select. Previously Peacock was not storing your color, now it does (in a memento).

I just republished 2.5.2. Can you try with that version and report back?

1reaction
johnpapacommented, Jul 27, 2019

thanks …

I’m having trouble reproducing this. Can you help clarify … I think you are saying that if you open Peacock in a project that has no peacock colors in the workspace settings (.vscode/settings.json) that Peacock is writing colors to .vscode/settings.json. If so, that is a bug, but I cannot repro this.

Or are you saying you open one project, use Peacock and set to a color (blue), then open another project that uses Peacock and the colors are also set to blue. (color is being copied - which is undesired)

Also - if you open the “output” panel and choose “peacock” there may be some messages there as I log to it. Can you check what is there and share that?

thanks for the feedback

EDIT: Further investigation - I think the Reset Colors is was the fix, not the version change. I’m having to do this per project, where is this hidden setting stored?

2.5.0 introduced a workspace memento (a saved variable for your workspace) that stores the most recently used color for this specific workspace. This was needed due to the remote features introduced. I’m sensing (but cannot confirm) that somehow this memento is being read by peacock and then setting your colors to it. But … that memento is only set when you apply peacock to a specific folder/workspace (and there is one memento per folder/workspace). So this could happen if you set a color (blue), then remove the workspace settings, then reload and blue would be applied again. Why? Because the memento does not get written (cleared) when you manually delete a color (yet another reason i dont like this approach and will move to a setting).

But I am not sure if this explains your scenarios … because this would only happen if in the workspace you had previously set a color (which is what sets the memento) and then removed the colors manually (delete the file, remove the settings). This I can reproduce and is a bug. But it sounded like your scenario was going to a folder where Peacock never existed … and then it appears. That, i cant reproduce.

Please comment on these assertions I made above and let me know if I follow you correctly or not.

sidenote - The memento is likely going away in the next version as I prefer a user settings hidden variables

also, i am reverting 2.5.1 as while I am not sure it caused the problem , I am sure that it would make it more frequently appear. So 2.5.2 is published now (which reverts 2.5.1)

Read more comments on GitHub >

github_iconTop Results From Across the Web

User and Workspace Settings - Visual Studio Code
The error can be as simple as a missing comma or incorrect setting value. Open the settings.json file with the Preferences: Open Settings...
Read more >
Settings | JetBrains Fleet Documentation
Go to Settings/Preferences Ctrl+Alt+S and open the tab corresponding to your workspace. The 'SPRING-PETCLINIC' tab in Settings/Preferences. Edit ...
Read more >
How to Customize Visual Studio Code Settings.json - YouTube
How to Customize Visual Studio Code Settings. json. Watch later. Share. Copy link. Info. Shopping. Tap to unmute. If playback doesn't begin ...
Read more >
Visual Studio Code status bar color - Stack Overflow
json file. The easiest way to access it is menu command File → Preferences → Settings, search for "Color", choose an option "Workbench:...
Read more >
Advanced Visual Studio Code for Python Developers
If no results come up, make sure you have the Python extension installed. ... The workspace configuration for VS Code and all of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found