Home Download Buy Blog Forum Support

Overriding language definitions

Overriding language definitions

Postby FalconNL on Mon Jan 31, 2011 8:41 am

Has there been a change in the way language definitions are loaded in Sublime Text 2? Previously, I had a folder called Haskell2 with a modified language definition for .hs files that used to override the default one. In Sublime Text 2, however, this no longer seems to work, as the default one gets precedence. If this simply not implemented yet or is there a new way of overriding language definitions?
FalconNL
 
Posts: 67
Joined: Thu May 29, 2008 8:17 pm

Re: Overriding language definitions

Postby jps on Mon Jan 31, 2011 9:28 am

By overriding, do you mean which .tmLanguage file is selected when you open a .hs file?

If you use View/Syntax/Open all with current extension as, that setting should take precedence over what's listed in the tmLanguage files.
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm

Re: Overriding language definitions

Postby FalconNL on Mon Jan 31, 2011 9:53 am

Ah, never knew that was there. That does the trick just fine, thanks.
Where are these default filetype associations stored? It would be nice if they could be easily replicated to new computers along with all the other settings, but I was unable to find the file that stores it in the AppData/ST2 folder
FalconNL
 
Posts: 67
Joined: Thu May 29, 2008 8:17 pm

Re: Overriding language definitions

Postby jps on Mon Jan 31, 2011 10:22 am

If your file is called Haskell2.tmLanguage, then they should be stored in User/Haskell2.sublime-settings
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm

Re: Overriding language definitions

Postby FalconNL on Mon Jan 31, 2011 10:35 am

Ah, I see. Great, thanks.
FalconNL
 
Posts: 67
Joined: Thu May 29, 2008 8:17 pm

Re: Overriding language definitions

Postby corsen2000 on Fri Feb 22, 2013 12:55 am

I am also confused by this change.

If I want to override JavaScript.tmLanguage file, I can create a JavaScript.tmLanguage file in my use directory. If I don't give it a different name though the syntax drop down list has JavaScript twice. It shows a check mark next to both even though only 1 is really active.

I could call the language my-javascript instead to get around these problems but that seems weird. I just want to override the default JavaScript.tmLanguage file.

Am I doing something wrong?
corsen2000
 
Posts: 8
Joined: Fri Jan 13, 2012 12:16 pm

Re: Overriding language definitions

Postby skuroda on Fri Feb 22, 2013 1:32 am

corsen2000 wrote:I am also confused by this change.

If I want to override JavaScript.tmLanguage file, I can create a JavaScript.tmLanguage file in my use directory. If I don't give it a different name though the syntax drop down list has JavaScript twice. It shows a check mark next to both even though only 1 is really active.

I could call the language my-javascript instead to get around these problems but that seems weird. I just want to override the default JavaScript.tmLanguage file.

Am I doing something wrong?


You would override the JavaScript.tmLanguage file be creating at "Packages/JavaScript/JavaScript.tmLanguage". I wrote this plugin (link) to help view and override sublime-package defaults. In the command palette, search for PackageResourceViewer: Edit Package Resource". This will (or at least should) open a file in the proper location for you to edit.
skuroda
 
Posts: 685
Joined: Fri Oct 05, 2012 8:11 am


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Juje007 and 34 guests