0

I recently installed Dreamweaver CS6, and I'm having a problem when modifying a JSON file. No matter what I type, even the simplest, clearly valid JSON string, it keeps saying there is a syntax error in it:

There is a syntax error on line 1.

Apparently, Dreamweaver tries to validate the JSON file as JavaScript. Well, obviously a simple JSON string is not valid JavaScript, but it is valid JSON. In an attempt to fix it, I modified the Extensions.txt file in my Configuration to change

JS,JSON:JavaScript Documents

to

JS:JavaScript Documents

After restarting, Dreamweaver still tries to validate it as JavaScript. I even tried removing the JSON file type from the "All Documents" line (the very first line of Extensions.txt), which causes it to not recognize the file type or assign an icon, but it still attempts to validate it as JavaScript.

So how can I configure Dreamweaver CS6 to stop trying to syntax check files that end with a .json extension at all? Can I set it to just ignore files with that extension? I'm assuming this would also disable syntax highlighting for JSON, which I'd be perfectly fine with. Basically, can I make Dreamweaver treat a JSON file the same way it would treat a TXT file?

animuson
  • 323

1 Answers1

-1

Apparently that's not the only file you need to edit. In fact, you don't really even need to edit the Extensions.txt because that's just an aesthetics file used for displaying cute icons and stuff. What you really need to edit is the MMDocumentTypes file (it doesn't have an extension on it), located in the DocumentTypes folder inside the Configuration folder where the other text file is located.

Find this line:

<documenttype id="JavaScript" internaltype="Text" winfileextension="js,json" macfileextension="js,json" file="Default.js" writebyteordermark="false" mimetype="text/javascript">

Replace it with this (just removing the json part from it):

<documenttype id="JavaScript" internaltype="Text" winfileextension="js" macfileextension="js" file="Default.js" writebyteordermark="false" mimetype="text/javascript">

Reload Dreamweaver and it will not think that your JSON files are JavaScript anymore and will display it simply as a text file (no syntax highlighting or checking, just plain black text).

animuson
  • 323