What are the contents of the default brackets.json file? - json

I accidentally deleted my brackets.json file.
Could somebody with the Brackets Editor open it up, go to Debug, opens the settings file, and paste it into an answer?
Here is the file that Brackets generates for me:
{
"fonts.fontSize": "12px",
"fonts.fontFamily": "'SourceCodePro-Medium', MS ゴシック, 'MS Gothic', monospace",
"linting.collapsed": true,
"autoSavePrefs.on_save": false,
"dragDropText": true,
}
Unfortunately, this causes the following message to appear every time I start the editor:
your settings file doesn't contain a valid json file. The file will be opened so you can correct the format. You have to restart Brackets, so the changes affect brackets.
and I'm not sure how to fix it.

JSON doesn't permit trailing commas in object members or array elements.
If you change "dragDropText": true, to "dragDropText": true your file will become valid JSON and your error message should go away.

What I did and it worked was remove all references to the json file, leaving just {
}
It will create another default settings.

Related

Filter out certain parts of a json file on git commit

I am looking to filter out specific parts of a json file so that the given part of the file does not get pulled into a git repository. My use case is that I am setting up a repository to keep some working files, including settings for vsCode. I have a plugin for window colors that sets different colors for different windows that are open. The current color is saved in the .vscode/setting.json file for that window.
I found where it is possible to use the .gitattributes file to apply a filter to a file or set of files, and then use "$git config" to remove certain lines from what is committed, based on a sed command per this previous question.
I would like to apply this to the "workbench.colorCustomizations" object within the following json file, so that this object does not get committed, while other settings in the file may be committed, such as the "editor.formatOnPaste" object. Does anyone know of a way to do this?
{
"workbench.colorCustomizations": {
"activityBar.background": "#102D56",
"titleBar.activeBackground": "#173F79",
"titleBar.activeForeground": "#F8FAFE"
},
"editor.formatOnPaste": true
}

How can we tell Prettier to ignore a specific JSON file?

I am using VS Code and would like to exclude a specific json file data.json from being formatted by Prettier on save. Say it's in the root, then I create a file .prettierignore and add a line data.json (according to the docs).
This works fine with other types of files, but not with json files. In fact, even writing *.json will still format the json files.
There is a setting in VS Code
JSON > Format:Enable
Enable/disabled default JSON formatter
which is enabled. When I disabled it, however, no json file will be formatted on save. This is not what I want. I only want to exclude a specific json file. How can I achieve this?
I have already seen the related question 46409892.
I think your VS Code formatter is not Prettier by default for JSON (or maybe not your default formatter for all documents ?)
To define a formatter by default, according to Prettier doc, you have to set your VS Code settings file like this :
{
// For all files
"editor.defaultFormatter": "esbenp.prettier-vscode",
// For JSON specifically
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
Then, you can define ignored files in your .prettierignore using same syntax as .gitignore.

Visual Studio Code JSON completion

I'm making my first videogame in Unity and I was messing around with storing data in JSON files. More specifically, language localization files. Each file stores key-value pairs of strings. Keys are grouped in categories (like "menu.pause.quit").
Now, since each language file is essentially going to have the same keys (but different values), it would be nice if VS code recognized and helped me write these keys with tooltips.
For example, if you open settings.json in VS code, if you try to write something, there's some kind of autocompletion going on:
How does that work?
The auto completion for json files is done with json schemas. It is described in the documentation:
https://code.visualstudio.com/docs/languages/json#_json-schemas-and-settings
Basically you need to create a json schema which describes your json file and you can map it to json files via your user or workspace settings:
// settings.json
{
// ... other settings
"json.schemas": [
{
"fileMatch": [
"/language-file.json"
],
"url": "./language-file-schema.json"
}
]
}
This will provide auto completion for language-file.json (or any other file matched by the pattern) based on language-file-schema.json(in your workspace folder, but you can also use absolute paths)
The elements of fileMatch may be patterns which will match against multiple files.

how to set json with comment in vscode?

I often use Vs code to open json files. sometimes there're some comments in my json files. in this case,there will be a lot of warnings.
So I click below button to change the format to "json with comment (jsonc)"
but when I open a JSON file next time, it will by default switch to JSON format (without comment)
How can I make 'jsonc' the default format of json file? so that I do not need to change it every time.
Thanks
You can set a file association between json files and jsonc language formatting.
In VS Code open Settings in JSON view by using the Command Pallet (Cmd + Shift + P) and enter Preferences: Open Settings (JSON). Next, add the following (or append to the existing files.associations object if it already exists):
"files.associations": {
"*.json": "jsonc"
}

JMeter reads %3CEOF%3E from CSV file

I use CSV Data Set Config in JMeter to provide username/password data to testsuite. In some cases it reads %3CEOF%3E from file instead of data. File is located in /bin folder.
Structure of file:
username1,password1
username2,password2
There isn't any empty lines at the end of the file.
Recycle on EOF: True
Stop Thread on EOF: False
Although you should not be seeing this issue normally you can work it around by putting your request under the If Controller and setting the following condition using __groovy() function:
${__groovy(!vars.get('foo').equals('<EOF>'),)}
Replace foo with the variable reference name from the CSV Data Set Config.
I faced the exact same problem and ran into a solution by accident. Although the txt had no empty lines when opened with "notepad" when I opened the same txt file using "notepad++" I found an empty line. I removed it from notepad++ and saved and the problem was solved.