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.

Missing json file settings for Visual Studio Code editor

See original GitHub issue

Where to find the issue

https://github.com/corona-warn-app/cwa-website/blob/master/.vscode/settings.json

Describe the issue

The Visual Studio Code project settings file does not provide any default settings for json files.

CHANGE_WEBSITE_CONTENT.md says:

  • JSON files use 4 space-character soft-tab indentation
  • Use a proper JSON formatter after making your changes (e.g. the format document option of VSCode) from time to time

and it leaves it to contributors to set up the corresponding settings.

Suggested change

Modify the Visual Studio Code project settings file to include settings which implement the 4 space-character soft-tab indentation.

Insert the following into .vscode/settings.json

"[json]": {
  "editor.detectIndentation": false,
  "editor.tabSize": 4,
  "editor.insertSpaces": true
}

which will modify the Workspace Settings for editing json files in the corona-warn-app/cwa-website repository with a Visual Studio Code editor.

Possibly "editor.trimAutoWhitespace": true should also be added, although this has not been specified as a convention for json files in the repository.

Similarly "files.insertFinalNewline": true could also be defined. Again this has not been specified as a repository convention so far.

Visual Studio Code - Reference information

User and Workspace Settings

Keybindings for different operating systems, for example: Windows Shift+Alt+F = Format document.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
MikeMcC399commented, Sep 10, 2021

#1726 is merged, so this issue can now be closed.

1reaction
MikeMcC399commented, Sep 10, 2021

@Ein-Tim Thanks for your positive feedback!

This is what I would propose for https://github.com/corona-warn-app/cwa-website/blob/master/.vscode/settings.json if the Open Source Team would like this added.

{
  "[html]": {
    "editor.formatOnSave": false
  },
  "[json]": {
    "editor.detectIndentation": false,
    "editor.tabSize": 4,
    "editor.insertSpaces": true,
    "editor.trimAutoWhitespace": true,
    "files.trimTrailingWhitespace": true,
    "files.insertFinalNewline": true,
    "files.trimFinalNewlines": true
  }
}
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 in VSCode's settings.json didn't work when there is a ...
This is by design. The VSCode settings are fallback only. If prettier finds a config file (editorconfig or prettier config) then only those ......
Read more >
Settings.json missing - Django - Code with Mosh Forum
I made this modification in the user settings and it works. Now the info about the interpreter path are stored in the .vscode/settings.json...
Read more >
Visual Studio Code - ArchWiki
vscodium AUR and related packages store their settings in ~/.config/VSCodium/User/settings.json . When migrating from Code to Codium (or vice ...
Read more >
User and Workspace Settings - vscode-docs
Below is a copy of the default settings.json file. Tip: While in the settings.json file, press kb(workbench.action.gotoSymbol) to ...
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