Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to open JSON.tmLanguage #4257

Closed
curtisyallop opened this issue May 26, 2021 · 7 comments
Closed

Unable to open JSON.tmLanguage #4257

curtisyallop opened this issue May 26, 2021 · 7 comments

Comments

@curtisyallop
Copy link

Description

Upgraded to build 4107 on 2021-05-26, get this error:

error: Error loading syntax file "Packages/JavaScript/JSON.tmLanguage": Unable to open Packages/JavaScript/JSON.tmLanguage

On startup if I have an open json tab. Or else whenever I paste json into a blank tab. Also the JSON has no syntax highlighting since I upgraded sublime.

It might be connected to package "Pretty JSON" however the error still happens when this package is removed.

Steps to reproduce

  1. Start Sublime Text with a untitled tab open containing JSON

Expected behavior

No error and color syntax highlighted JSON

Actual behavior

Message-box and console error as described above.

Environment

Build 4017
MacOS Catalina 10.15.7

@deathaxe
Copy link
Collaborator

JSON syntax was moved to Packages/JSON/JSON.sublime-syntax So closing all files (maybe deleting Cache directory) should resolve the issue.

@curtisyallop
Copy link
Author

Thanks. That fixed it.

Details: I first closed all my json tabs but that didn't fix it (although it made JSON.tmLanguage disappear from my sublime_state file). I actually happened to run "/Applications/Sublime Text.app/Contents/MacOS/sublime_text" from the command-line which I should not have (I was trying to create a "subl" command kind of thing only didn't notice subl or that I should add that subdir to my path). It created a second sublime window (normally there is only one) and when I quit, it forced me to close every single tab (normally, they just all stay open and are still open when sublime reopens). The windows were all still open in my other sublime window so I thought I was ok but when I restarted, they disappeared. Which probably was what fixed the JSON problem because it works now. I also removed package "Pretty JSON", quit and re-added it (it had a reference to JSON.tmLanguage). But that alone didn't immediately fix the problem.

In case anyone else runs into this problem, here is something to find clues on MacOS:

egrep -r 'JSON.tmLanguage' "/Applications/Sublime Text.app/" "/Users/USERNAME/Library/Application Support/Sublime Text 3/" "/Users/USERNAME/Library/Caches/Sublime Text 3/Cache/"

@curtisyallop
Copy link
Author

curtisyallop commented May 26, 2021

I notice that package "Pretty JSON" was updated 3 hours ago. When I reinstalled it this morning, it still had a reference to JSON.tmLanguage, I believe. Now it does not.

https://packagecontrol.io/packages/Pretty%20JSON

Change was made in github back in 2020-08-18: dzhibas/SublimePrettyJson@2d0881d#diff-7fe80f8c8dd5c5ef2950d6b2f63530033478e90c9fce79de1ac128330f408655

@deathaxe
Copy link
Collaborator

I already wondered why a "tmLanguage" file was referenced in those error message.

@deathaxe
Copy link
Collaborator

@Dygear
Copy link

Dygear commented Jan 30, 2022

FYI - This happens on fresh installs of Sublime Text 4, Build 4126 in all versions. Mac, Linux and Windows. What's more it was a fresh install of all versions of the operating system as well. So there is something set incorrectly in the default install options.

@deathaxe
Copy link
Collaborator

ST itself doesn't contain any reference to the old JSON.tmLanguage and I've never seen such an issue. So this can't be caused by any kind of "default install options".

The session_file of a previously opened ST instance may contain references to such a file (for open files) or a possibly remaining cached syntax file may cause it. Maybe any package or user preference may contain a reference to that file, too. All of them reside in ST's data directory (~/.config/sublime-text) which is not touched by installers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants