Unable to write in VScode settings - visual-studio-code

It seems i am unable to write in any new setting as my settings.json has an error of some kind. I have tried removing certain duplicate lines and also adding new brackets to see if it would assist with the issue but so far i have not been able to figure out the problem. Here is what i have managed to do so far,
{
"editor.suggest.localityBonus": true,
"editor.suggest.statusBar.visible": true,
"editor.quickSuggestions": null,
"editor.snippetSuggestions": "bottom",
"files.autoSave": "afterDelay",
"liveServer.settings.donotShowInfoMsg": true,
"workbench.iconTheme": "material-icon-theme",
"prettier.jsxSingleQuote": true,
"prettier.singleQuote": true,
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
"workbench.colorTheme": "Monokai Pro (Filter Spectrum)",
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"emmet.preferences": {
},
"workbench.editorAssociations": {
"*.ipynb": "jupyter.notebook.ipynb"
},
"mssql.connections": [
{
"server": "{{put-server-name-here}}",
"database": "{{put-database-name-here}}",
"user": "{{put-username-here}}",
"password": "{{put-password-here}}"
}
],
"security.workspace.trust.untrustedFiles": "open",
"editor.fontSize": 18,
"editor.tabSize": 3,
"editor.guides.bracketPairs": true
{
"editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs":"active"
}
}
I get an error saying "expected comma Ln33 col 3" and "end of file expected at Ln 37"

Change from:
"editor.guides.bracketPairs": true
{
"editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs":"active"
}
to
"editor.guides.bracketPairs": true, // choose true/false/active
// { // gat rid of this {
"editor.bracketPairColorization.enabled": true,
// "editor.guides.bracketPairs":"active"
// } // get rid of this }

Related

Troubleshooting VS Code 'settings.json'?

Hi guys I'm getting a message from VS Code that says "Unable to sync settings because the content in the file is not valid. Please open the file and correct it."
Why is it saying that and how could I fix it. I'm pasting my settings.json
{
"editor.fontSize": 16,
"editor.fontFamily": "Cascadia Code",
"editor.formatOnSave": true,
"terminal.integrated.fontSize": 16,
"terminal.integrated.fontWeight": 500,
"terminal.integrated.lineHeight": 1.1,
"prettier.tabWidth": 3,
"terminal.integrated.tabs.enableAnimation": false,
"workbench.iconTheme": "material-icon-theme",
"editor.guides.bracketPairs": true,
"editor.bracketPairColorization.independentColorPoolPerBracketType": true,
"workbench.colorCustomizations": {},
"editor.inlineSuggest.enabled": true,
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode", // worked!
"editor.defaultFormatter": "vscode.typescript-language-features" //Not worked?
}
"security.workspace.trust.untrustedFiles": "open", // expected comma error, but👈 has a comma. Where is the comma supposed to go?
"[css]": {
"editor.defaultFormatter": "aeschli.vscode-css-formatter"
},
"git.autofetch": true,
"editor.formatOnType": true,
"css.lint.emptyRules": "error",
"html-css-class-completion.enableEmmetSupport": true,
"editor.formatOnPaste": true,
"editor.defaultFormatter": "AndersEAndersen.html-class-suggestions",
"html.format.templating": true,
"emmet.triggerExpansionOnTab": true,
"workbench.colorTheme": "Brogrammer Plus",
"editor.fontWeight": "normal",
"eslint.codeActionsOnSave.rules": null
"editor.wordWrap" : "wordWrapColumn", // expected comma error, but👈 has a comma. Where is the comma supposed to go?
}
Where do the commas go for:
"editor.wordWrap" : "wordWrapColumn",
&
"security.workspace.trust.untrustedFiles": "open",
They 👆have commas?
You are missing some commas in the file.
Next time, you can verify that your settings.json file is valid by creating a new file in VSCode, setting its language to JSON (Select a language -> JSON) and pasting the content of your settings.json file - VSCode will mark any errors.
You were missing a comma after "eslint.codeActionsOnSave.rules": null and "editor.defaultFormatter": "vscode.typescript-language-features"}.
Here's a working version of your settings.json file, I checked it on my VSCode:
{
"editor.fontSize": 16,
"editor.fontFamily": "Cascadia Code",
"editor.formatOnSave": true,
"terminal.integrated.fontSize": 16,
"terminal.integrated.fontWeight": 500,
"terminal.integrated.lineHeight": 1.1,
"prettier.tabWidth": 3,
"terminal.integrated.tabs.enableAnimation": false,
"workbench.iconTheme": "material-icon-theme",
"editor.guides.bracketPairs": true,
"editor.bracketPairColorization.independentColorPoolPerBracketType": true,
"workbench.colorCustomizations": {},
"editor.inlineSuggest.enabled": true,
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"security.workspace.trust.untrustedFiles": "open",
"[css]": {
"editor.defaultFormatter": "aeschli.vscode-css-formatter"
},
"git.autofetch": true,
"editor.formatOnType": true,
"css.lint.emptyRules": "error",
"html-css-class-completion.enableEmmetSupport": true,
"editor.formatOnPaste": true,
"editor.defaultFormatter": "AndersEAndersen.html-class-suggestions",
"html.format.templating": true,
"emmet.triggerExpansionOnTab": true,
"workbench.colorTheme": "Brogrammer Plus",
"editor.fontWeight": "normal",
"eslint.codeActionsOnSave.rules": null,
"editor.wordWrap": "wordWrapColumn"
}

Is there a list of all VS Code settings.json fields?

In the example settings.json below, the html.fake setting is greyed out with the error Unknown Configuration Setting, meaning VSCode is aware of all possible config settings.
Is there a way to view this full list, or view an example settings.json with the default values for all accepted fields?
{
"html.autoClosingTags": "never",
"html.fake": "never"
}
I understand extensions may have their own config settings; I'm only interested in the base settings.
Please find the list of all default settings for VSCode(Link). I believe this is what you are looking for.
{
"files.autoSave": "afterDelay",
//"workbench.colorTheme": "Dracula Soft",
//"compile-hero.generate-minified-html": true,
//"compile-hero.generate-minified-css": true,
"php.validate.executablePath": "C:/php-7.4.28/php.exe",
"php.executablePath": "C:/php-7.4.28/php.exe",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
//"editor.renderIndentGuides": true,
"editor.fontWeight": "normal",
"editor.detectIndentation": false,
"editor.tabSize": 3,
"editor.suggestSelection": "first",
"editor.codeLensFontFamily": "Fira Code, Operator Mono",
"editor.codeLensFontSize": 16,
"breadcrumbs.enabled": false,
"editor.fontSize": 15,
"editor.fontFamily": "Fira Code, Operator Mono",
"editor.fontLigatures": "terminal.integrated.cursorWidth",
"editor.cursorWidth": 2,
"editor.lineHeight": 24,
// cursor
"editor.cursorSmoothCaretAnimation": true,
"editor.cursorBlinking": "expand",
"editor.quickSuggestions": {
"other": true,
"comments": true,
"strings": true,
"tag": true,
"class": true,
"id": true
},
// config related to code formatting
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": false,
"[javascript]": {
"editor.formatOnSave": true
},
"[javascriptreact]": {
"editor.formatOnSave": true
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.tslint": true,
"source.organizeImports": true
},
//terminal
//"terminal.integrated.cursorSmoothCaretAnimation": true,
"terminal.integrated.cursorBlinking": true,
"terminal.integrated.cursorStyle": "line",
"terminal.integrated.fontSize": 16,
"terminal.integrated.lineHeight": 1.5,
//"terminal.integrated.fontWeight": "normal",
"terminal.integrated.fontFamily": "Fira Code, Operator Mono",
"terminal.integrated.cursorWidth": 2,
// "terminal.integrated.shell.windows": "C:/Users/user/AppData/Local/Microsoft/WindowsApps/wt.exe",
"terminal.integrated.automationShell.windows": null,
// terminal customization
"workbench.colorCustomizations": {
"terminal.ansiBlack": "#171c2a",
"terminal.ansiRed": "#E35535",
"terminal.ansiGreen": "#52AB62",
"terminal.ansiYellow": "#ffd866",
"terminal.ansiBlue": "#00B3BD",
"terminal.ansiMagenta": "#e991e3",
"terminal.ansiCyan": "#78e8c6",
"terminal.ansiWhite": "#FFFFFFcc",
"terminal.ansiBrightBlack": "#00B3BD",
"terminal.ansiBrightRed": "#E35535",
"terminal.ansiBrightGreen": "#52AB62",
"terminal.ansiBrightYellow": "#ffd866",
"terminal.ansiBrightBlue": "#00B3BD",
"terminal.ansiBrightMagenta": "#e991e3",
"terminal.ansiBrightCyan": "#78e8c6",
"terminal.ansiBrightWhite": "#ffffff",
"terminal.background": "#171c2a",
"terminalCursor.background": "#ffd866",
"terminalCursor.foreground": "#ffd866",
// Editor customaize
// "editorIndentGuide.activeBackground": "#430f7e",
// "editorIndentGuide.background": "#3a383a",
// "activityBar.background": "#740ee9f8",
// "editorBracketMatch.background": "#430f7e",
// "editorBracketMatch.border": "#ffffff",
//"editor.wordHighlightStrongBackground": "#740ee9f8",
"editor.wordHighlightBorder": "#740ee9f8",
//"editor.rangeHighlightBackground": "#740ee9f8",
// "editor.rangeHighlightBorder": "#740ee9f8",
"editor.selectionBackground": "#c7c7c76b",
// "editor.selectionHighlightBorder": "#ffffff",
// "tab.activeBackground": "#5332a0",
// "tab.border": "#430f7e"
},
// "prettier.disableLanguages": ["html", "css"],
"dictCompletion.addSpaceAfterCompletion": true,
"beautify.language": {
"js": {
"type": ["javascript", "json", "jsonc"],
"filename": [".jshintrc", ".jsbeautifyrc"]
},
"css": ["css", "scss"],
"html": ["htm", "html", "css", "javascript", "php", "blade"],
"php": ["javascript", "php", "blade"]
},
"phpformatter.logging": true,
"[json]": {
"editor.quickSuggestions": {
"strings": true
},
"editor.suggest.insertMode": "replace"
},
"workbench.colorTheme": "Learn with Sumit - Peace of the eye",
"workbench.iconTheme": "vscode-icons",
"[php]": {
"editor.defaultFormatter": "bmewburn.vscode-intelephense-client"
},
"[html]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"cSpell.userWords": [
"backorder"
],
"explorer.confirmDelete": false,
"window.zoomLevel": 1,
}
I hope you got the answering.

VSCode Python Intellisense Not Working Properly

Python autocomplete in VSCode is messing up my code
Here is my system:
If I use Pylance, Intellisense does not work properly
and if I use Jedi, Intellisense does not work properly
When I press enter, my code is completely borked. This is just one example and has been frustrating the heck out of me!
Below is my settings.json file:
{
"AREPL.pythonPath": "${workspaceFolder}\\.venv\\Scripts\\python.exe",
"dicom.alwaysShowMenu": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"editor.formatOnSave": true,
"editor.insertSpaces": false,
"editor.rulers": [
90
],
"editor.suggestSelection": "first",
"explorer.compactFolders": false,
"explorer.confirmDragAndDrop": false,
"files.exclude": {
"**/.git": false
},
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"git-graph.defaultColumnVisibility": {
"Author": false,
"Commit": true,
"Date": false
},
"git-graph.referenceLabels.alignment": "Branches (aligned to the graph) & Tags (on the right)",
"glassit.alpha": 255,
"json.format.enable": true,
"mypy.dmypyExecutable": "${workspaceFolder}\\.venv\\Scripts\\dmypy.exe",
"mypy.runUsingActiveInterpreter": true,
"notebook.cellToolbarLocation": {
"default": "right",
"jupyter-notebook": "left"
},
"python.defaultInterpreterPath": "${workspaceFolder}\\.venv\\Scripts\\python.exe",
"python.formatting.blackArgs": [
"--line-length",
"90"
],
"python.formatting.provider": "black",
"python.languageServer": "Jedi",
"python.linting.enabled": true,
// "python.linting.flake8Args": [
// "--line-length",
// "90"
// ],
"python.linting.mypyEnabled": true,
"python.linting.mypyPath": "${workspaceFolder}\\.venv\\Scripts\\mypy.exe",
// "python.linting.pylintArgs": [
// "--generate-members"
// ],
// "python.linting.pylintEnabled": true,
"python.pythonPath": "${workspaceFolder}\\.venv\\Scripts\\python.exe",
"python.terminal.activateEnvironment": true,
"python.testing.pytestArgs": [
"${workspaceFolder}\\tests"
],
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": true,
"python.venvPath": ".venv",
"restructuredtext.builtDocumentationPath": "${workspaceFolder}\\docs\\build\\html",
"restructuredtext.confPath": "{workspaceFolder}\\docs\\source",
"restructuredtext.languageserver.disabled": true,
"restructuredtext.sphinxBuildPath": "${workspaceFolder}\\.venv\\Scripts\\sphinx-build.exe",
"screencastMode.keyboardOverlayTimeout": 1500,
"screencastMode.mouseIndicatorSize": 20,
"screencastMode.onlyKeyboardShortcuts": true,
"screencastMode.verticalOffset": 0,
"security.workspace.trust.untrustedFiles": "open",
"shellcheck.customargs": [
"-x"
],
"terminal.integrated.defaultProfile.windows": "PowerShell",
"terminal.integrated.fontFamily": "CaskaydiaCove Nerd Font Mono",
"terminal.integrated.tabs.enabled": true,
"trailing-spaces.syntaxIgnore": [
"markdown"
],
"update.enableWindowsBackgroundUpdates": false,
"vsicons.dontShowNewVersionMessage": true,
"workbench.colorTheme": "Predawn",
"workbench.editor.enablePreview": true,
"workbench.editorAssociations": {
"*.dcm": "default",
"*.ipynb": "jupyter-notebook",
"*.tiff": "tiff.preview",
"git-rebase-todo": "default"
},
"workbench.iconTheme": "material-icon-theme",
"workbench.settings.editor": "json",
"workbench.settings.openDefaultSettings": true,
"workbench.settings.useSplitJSON": true,
"workbench.startupEditor": "newUntitledFile"
}
Why is this happening and how can I fix my Intellisense?
Update:
Removing "editor.suggestSelection": "first" helped, but I still get errors:
Adding the following to my settings.json makes Intellisense work as expected:
"editor.acceptSuggestionOnEnter": "off",
"editor.tabCompletion": "on"
Why the defaults are "on" and "off", respectively, I will never know. Everyone expects to press tab if you want to use the suggestion (like in bash terminal), and no one wants the autocomplete to complete blindly upon hitting enter.

In VS Code this line /** #format */ always appears at the top of my .js files on save

I'm a little confused as to why this line :
/** #format */
Always appears at the top of my .js files when i save. I have prettier globally installed as well as the prettier extension installed in vs code, I have it configured to auto format on save as well. I can't find any info on how to make that line go away or what caused it to start showing up in the first place.
Here is what my settings.json file looks like in vs code:
{
"editor.tabSize": 2,
"editor.insertSpaces": true,
"files.trimTrailingWhitespace": true,
"materialTheme.fixIconsRunning": false,
"workbench.colorTheme": "Winter is Coming (Dark Blue)",
"explorer.confirmDragAndDrop": false,
"explorer.confirmDelete": false,
"workbench.iconTheme": "material-icon-theme",
"files.autoSave": "off",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[jsx]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[tsx]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[prisma]": {
"editor.defaultFormatter": "Prisma.prisma",
"editor.formatOnSave": true
},
"diffEditor.ignoreTrimWhitespace": true,
"liveshare.featureSet": "insiders",
"material-icon-theme.activeIconPack": "react",
"material-icon-theme.files.associations": {},
"workbench.startupEditor": "newUntitledFile",
"editor.snippetSuggestions": "bottom",
// "editor.quickSuggestions": null
"editor.quickSuggestionsDelay": 500,
"prettier.jsxSingleQuote": true,
"prettier.singleQuote": true,
"mssql.connections": [
{
"server": "{{put-server-name-here}}",
"database": "{{put-database-name-here}}",
"user": "{{put-username-here}}",
"password": "{{put-password-here}}"
}
],
"window.zoomLevel": -2,
"cSpell.userWords": [
"Signup",
"formik"
],
"prettier.insertPragma": true,
"settingsSync.ignoredExtensions": [
"esbenp.prettier-vscode"
]
}
For anyone running into the same issue, in the settings.json file, I changed this:
"prettier.insertPragma": true,
to false
"prettier.insertPragma": false,
that resolves the issue.

How to set indent and formatting behavior for each language in visual studio code?

Is there a way to make vscode format python files using 4 spaces while formatting files from other languages such JS, Typescript and HTML using 2 spaces only?
It`s pretty annoying to have to indent manually every time.
All of this trying is setting up a mess on my settings and still, I can`t make it work as I want.
This is what my settings.json looks like for the moment
{
"python.jediEnabled": false,
"miramac.node.terminalMode": false,
"python.pythonPath": "/usr/local/bin/python3",
"workbench.colorTheme": "Dracula",
"workbench.startupEditor": "newUntitledFile",
"workbench.editor.labelFormat": "short",
"terminal.integrated.fontSize": 12,
"editor.fontFamily": "Fira Code",
"editor.lineHeight": 19,
"editor.fontLigatures":true,
"editor.suggestSelection": "first",
"editor.renderLineHighlight": "gutter",
"editor.detectIndentation": true,
"editor.insertSpaces": false,
"editor.tabSize": 2,
"editor.autoIndent": "full",
"eslint.alwaysShowStatus": true,
"eslint.debug": true,
"eslint.format.enable": true,
"eslint.options": {
},
"python.languageServer": "Microsoft",
"liveServer.settings.donotVerifyTags": true,
"[html]": {
"editor.tabSize": 2,
"editor.codeActionsOnSave": {
"source.fixAll": true,
},
},
"liveServer.settings.donotShowInfoMsg": true,
"prettier.tabWidth": 2,
"[javascript]":{
"editor.codeActionsOnSave": {
"source.fixAll": true,
}
},
"[javascriptreact]":{
"editor.codeActionsOnSave": {
"source.fixAll": true,
}
},
"[typescript]":{
"editor.codeActionsOnSave": {
"source.fixAll": true,
},
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"[typescriptreact]":{
"editor.codeActionsOnSave": {
"source.fixAll": true,
},
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"[python]": {
"editor.tabSize": 4,
"editor.codeActionsOnSave": {
// "source.fixAll": true,
},
},
"extensions.ignoreRecommendations": true,
"explorer.compactFolders": false,
//perguntar se vc confirma delete e drag and drops
"explorer.confirmDragAndDrop": false,
"explorer.confirmDelete": false,
//mostra o caminho completo do arquivo
"breadcrumbs.enabled": true,
"javascript.updateImportsOnFileMove.enabled": "never",
"typescript.updateImportsOnFileMove.enabled": "never",
"python.linting.pylintArgs": [
"--extension-pkg-whitelist=pygame"
],
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
//set zsh theme to my terminal
//"terminal.integrated.shell.osx": "/bin/bash",
"terminal.integrated.shell.osx": "/bin/bash",
//"terminal.integrated.cwd": "",
"editor.renderControlCharacters": false,
"window.zoomLevel": -1,
"git.path": "/usr/local/git/bin/git",
"gitlens.views.repositories.files.layout": "list",
"gitlens.views.compare.files.layout": "tree",
"emmet.syntaxProfiles": {"javascript": "jsx"},
"emmet.includeLanguages": {"javascript": "javascriptreact"},
"typescript.tsserver.log": "verbose",
"javascript.suggest.autoImports": true,
"git.enableCommitSigning": true,
"git.enableSmartCommit": true,
"git.rebaseWhenSync": true,
"git.showPushSuccessNotification": true,
"workbench.sideBar.location": "left",
"workbench.activityBar.visible": true,
"terminal.integrated.automationShell.osx": "",
// "editor.defaultFormatter": "vscode.python",
// "editor.tokenColorCustomizationsExperimental": {},
"workbench.preferredDarkColorTheme": "Dracula",
"workbench.preferredHighContrastColorTheme": "Visual Studio Dark",
"material-icon-theme.activeIconPack": "nest",
"workbench.iconTheme": "material-icon-theme",
"material-icon-theme.folders.associations": {
"infra": "app",
"entities": "class",
"schemas": "class",
"typeorm": "database",
"repositories": "mappings",
"http": "container",
"migrations": "tools",
"modules": "components",
"implementations": "core",
"dtos": "typescript",
"fakes": "mock",
"coverage_reports": "tools",
},
"material-icon-theme.files.associations": {
"ormconfig.json": "database",
"routes.tsx": "routing",
"routes.ts": "routing",
"*.html": "html",
},
"sqlite.databaseExtensions": [
"db",
"db3",
"sdb",
"s3db",
"sqlite",
"sqlite3",
"ts"
],
}
Would there be anyone who can help in this issue?
I believe option + control + "B" should work
It is also a right click on the document and you should see a "format document" option.
It works for me