SourceCodeSyntaxHighlight
SourceCodeSyntaxHighlight copied to clipboard
On macOS 13.0, JSON files are still handled by system
I have tested many source code files and they have been previewed perfectly by SourceCodeSyntaxHighlight.
But .json
files are not working correctly (though .jsonc
files are working)
Here is my config:
-
mdls -name kMDItemContentType JSONPATH
->kMDItemContentType = "public.json"
-
qlmanage -m | grep public.json
->public.json -> /System/Library/QuickLook/Text.qlgenerator (961)
- System preferences:
- SyntaxHighlight preferences:
Also, after turning on debug mode, previewing a .json
file does not generate a .log
file on my desktop.
At the moment I have no way to test macOS 13. But if the operating system has reserved the use of the json extension it will not be possible to solve the problem in any way.
At the moment I have no way to test macOS 13. But if the operating system has reserved the use of the json extension it will not be possible to solve the problem in any way.
Is there a way to check whether this is reserved by system?
no, if a custom Quick Look Extension do not handle the .json, the format is likely to be managed by the system...
I've stumbled at this very same issue. It was working before I upgraded to Ventura.
It's very weird, but now it's working:

I had the same problem
On my system the json extension is handled correctly.
From the Terminal, what is the output of this command?
mdls -name kMDItemContentType JSONPATH
I have tested many source code files and they have been previewed perfectly by SourceCodeSyntaxHighlight. But
.json
files are not working correctly (though.jsonc
files are working)Here is my config:
mdls -name kMDItemContentType JSONPATH
->kMDItemContentType = "public.json"
qlmanage -m | grep public.json
->public.json -> /System/Library/QuickLook/Text.qlgenerator (961)
- System preferences:
On my system the json extension is handled correctly.
From the Terminal, what is the output of this command?
mdls -name kMDItemContentType JSONPATH
@sbarex Now, the output of mdls -name kMDItemContentType JSONPATH
is
kMDItemContentType = "public.json"
. (just the same as when I opened this issue)
It's very weird, but now it's working:
![]()
I think this preview is not generated by my application. I don't have the button to expand/collapse the items (unless you have activated some plugin).
I have tested many source code files and they have been previewed perfectly by SourceCodeSyntaxHighlight. But
.json
files are not working correctly (though.jsonc
files are working) Here is my config:
mdls -name kMDItemContentType JSONPATH
->kMDItemContentType = "public.json"
qlmanage -m | grep public.json
->public.json -> /System/Library/QuickLook/Text.qlgenerator (961)
- System preferences:
On my system the json extension is handled correctly. From the Terminal, what is the output of this command?
mdls -name kMDItemContentType JSONPATH
@sbarex Now, the output of
mdls -name kMDItemContentType JSONPATH
iskMDItemContentType = "public.json"
. (just the same as when I opened this issue)
maybe the extension is being handled by other applications which is not working well....
You can search in the output of this command which app uses the public.json uti:
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump
Limit the search only to extension point ID: com.apple.quicklook.preview
and type id: com.apple.quicklook-generator
I think this preview is not generated by my application. I don't have the button to expand/collapse the items (unless you have activated some plugin).
Indeed, I've installed brew install --cask quicklook-json
maybe the extension is being handled by other applications which is not working well....
You can search in the output of this command which app uses the public.json uti:
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump
Limit the search only toextension point ID: com.apple.quicklook.preview
andtype id: com.apple.quicklook-generator
Here is my script:
filename = '/Users/hywhu/Downloads/dump.txt'
divider = '--------------------------------------------------------------------------------'
with open(filename, mode='r') as f:
records = f.read().split(divider)
print(f"len = {len(records)}")
for r in records:
bool1 = r.find('public.json') > 0
bool2 = r.find('com.apple.quicklook.preview') > 0
bool3 = r.find('com.apple.quicklook-generator') > 0
if bool1 and (bool2 or bool3):
print([line for line in r.splitlines() if line.startswith('path')][0])
Its output is:
len = 10239
path: /Applications/Syntax Highlight.app/Contents/PlugIns/Syntax Highlight Quicklook Extension.appex (0x851c)
path: /System/Library/Frameworks/QuickLookUI.framework/Versions/A/PlugIns/QLPreviewGenerationExtension.appex (0x76fc)
It is correct.
Then try to open the Console.app, start the monitor and open a quicklook preview for a json file and see if in the log exists some error messages.
It is correct.
Then try to open the Console.app, start the monitor and open a quicklook preview for a json file and see if in the log exists some error messages.
(
I used the keyword quicklook
to filter out log items
)
When quicklook a
json
file, no log is listed;
When quicklook a normal js
file, there are some log items about Syntax Highlight.app listed.
@alanwilter Hi, I also have the quicklook-json extension installed, but json files are still handled by Syntax Highlight. Do you happen to know how to prioritize one extension over another? I’m using Ventura as well.
Did you happened to instal quicklook-json
after syntax-highlight
? This is only thing I did. Aside from that I'm afraid I have no clue.
Before Ventura it was possible to reorder the plugin list from the system preferences and (perhaps) it would be used as a priority criteria. In Ventura this feature is gone.
I temporally uninstalled syntax highlight, but quicklook-json is just not working at all 😅 ok then.
even if you removed both then install only quicklook-json
?
I realised now there are two other things you may want to try to:
-
qlmanage -r
- restart
Finder
app.
Running into the same issue. The system I'm on