Sublime Forum

Custom syntax theme is not working

#1

Hi,
My team is working on a custom language. The extension of the script file is mtl. A sample script is attached below.

TestButtonClick
"Verify SeeAll button is displayed and is clickable "

preconditions:
    verbose logging is "enabled"
    package "Amazing1" is installed via web


steps:
    replace host file entry "127.0.0.0" as "url1"
    wait for "15" seconds
    verify ui element "view-all-protected-devices" by "data-autom-id" exists

tracking:
    status: 
        version=15.0: InProgress
        
    owner: Amazing User
    qcid: 100
    notes: "Verify SeeAll button is displayed and is clickable "
    created date: Feb. 6, 2017, 2:48 p.m.

    last modified date: Feb. 13, 2017, 2:27 p.m.

Currently, Sublime Text is choosing the plain text as the syntax highlighter for mtl files. I have installed PackageDevelopment package and created the following

---
name: Metal
scopeName: source.mtl
fileTypes: [mtl]
uuid: 53b59856-3aa9-47d5-b229-32aeba872826

patterns:
- name: keywords.other.mtl
  match: "preconditions"

I named the file as Metal.tmLanguage and saved in the ‘Sublime Text 3\Packages\User’ folder.

However , Metal does not appear in the list of languages that I can choose to apply.

Can you please help me out with this ?

thanks

0 Likes

#2

I’m not at a computer at the moment, but your problem might be that your syntax looks like it’s in the YAML format but you’ve named the file after the PLIST XML format instead. You might try renaming the file to have an extension of sublime-syntax and see if that helps.

Another possible problem might be that you’re missing the %YAML 1.2 line at the top of the file (if that isn’t just a mis-paste), although I think in that case you would get an error message in the console.

1 Like

#3

Thanks… I got it working… Much appreciated.

0 Likes