phpadobe-brackets

Brackets json configuration file modification for PHP support


I am trying to use PHP Support in Brackets. My OS and configuration are as below;

OS: Ubuntu 20.04.2LTS
Brackets version: 1.14 build 1.14.1-17752
Bitnami LAMP Stack 8.0.2-0 installed for PHP, Apache Web Server, and MySQL database.
Bitnami install location: /opt/lampstack-8.0.2-0

On this system, I am trying to modify 'brackets.json' file to enable PHP support followed by the guideline mentioned here.

And my json code is as follows;

{
    "brackets-eslint.gutterMarks": true,
    "brackets-eslint.useLocalESLint": false,
    "fonts.fontSize": "12px",
    "fonts.fontFamily": "'SourceCodePro-Medium', MS ゴシック, 'MS Gothic', monospace",
    "themes.theme": "dark-theme",
    "useTabChar": false,
},
        "php": {"enablePhpTooling": true,
        "executablePath": "/opt/lampstack-8.0.2-0/php/bin/php",
         "memoryLimit": "4095M",
            "validateOnType": "false"},

I double-checked every , and {} but formatting seems fine. However, Brackets keep shows me this message.

Your Preferences file is not valid JSON. The file will be opened so that you can correct the format. You will need to restart Brackets for the changes to take effect.

Is there any advice to change the configuration code? Thank you very much for spending time and attention to my question.


Solution

  • Try this:

    {
        "brackets-eslint.gutterMarks": true,
        "brackets-eslint.useLocalESLint": false,
        "fonts.fontSize": "12px",
        "fonts.fontFamily": "'SourceCodePro-Medium', MS ゴシック, 'MS Gothic', monospace",
        "themes.theme": "dark-theme",
        "useTabChar": false,
        "php": {
            "enablePhpTooling": true,
            "executablePath": "/opt/lampstack-8.0.2-0/php/bin/php",
            "memoryLimit": "4095M",
            "validateOnType": "false"
        }
    }
    

    Think of JSON as a Javascript object hierarchy, with a single object (or array) at the root. So if you follow the opening { to its balanced closing }, that should be the end of the file. But in your example above, the closing } is immediately followed by , and then the "php" bit on the next lines – which makes it not valid JSON.