Sublime Forum

[SOLVED] View...Syntax...Open all with current extension as...SCSS :-)

#1

Hi there, I use Sublime Text 3 every day and love it !
2 key packages I have installed are the “Sass” and “SCSS” syntax color schemes.

Since the recent update to Build 3103, the color scheme formatting for both SASS and SCSS syntax files needs to be selected manually every time you open them.

Open *.scss file. The text color is mainly white.
View … Syntax … SCSS
Proper color scheme is applied, and all good. :grinning:

View … Syntax … Open all with current extension asSCSS
Open another SCSS file.
NO, must set the SCSS syntax color scheme yet again. :confused:

The blog post release notes for Build 3103 say … Added new Syntax Definition file format, .sublime-syntax

Is that my problem ? Is there some fix for this please ? Surely there are other Sublime Text 3 users out there who have encountered this problem ?

I realise the very same issue was raised here years ago. But here it is again, so any advice about how to resolve it would be very much appreciated.

0 Likes

#2

Do you perhaps use the Material theme?

What syntax is used for .scss files by default in your ST instance?

0 Likes

#3

Thanks for the reply @FichteFoll

No, I don’t use the Material theme.

When I first open a .scss file (always lowercase file extension), in bottom right corner, the syntax says SCSS (uppercase).
However, click those letters to open the View … Syntax menu and discover that SCSS is not ticked.
In fact there is NO syntax format selected at all.

You must manually select SCSS in that menu. And only then is the proper colour scheme syntax formatting applied.
Close that file. Open it once again. Discover that you must manually select SCSS yet again.

Tried “Open all with current extension as” … SCSS
=> When I do that, then go into menu Preferences … Settings – More … Syntax Specific – User
a file opens named
SCSS.sublime-settings
{
“extensions”:
[
“scss.erb”,
“less”,
“sass”,
“scss”
]
}

Close all files. Open a .scss file once again. And guess what ? No syntax formatting.
Go into menu Preferences … Settings – More … Syntax Specific – User
Yes, I get to see the same file SCSS.sublime-settings

But just cannot get the SCSS syntax selection to stick. You must manually select that syntax color formatting selection every time you open a file.

Close all files. Blank screen.
Go into menu Preferences … Settings – More … Syntax Specific – User
Now a file opens named Plain text.sublime-settings
containing no text entries at all.

============================
I can provide this Sublime Text 3 config information.

Preferences … Package Settings … Package Control … Settings – User Package Control.sublime-settings – User
{
“bootstrapped”: true,
“in_process_packages”:
[
],
“installed_packages”:
[
“ApacheConf.tmLanguage”,
“BracketGuard”,
“BracketHighlighter”,
“Color Highlighter”,
“CSS Format”,
“CSS3”,
“Emmet”,
“Foundation 5 Snippets”,
“Generic Config”,
“Monokai Extended”,
“Numix Theme”,
“Package Control”,
“Sass”,
“SCSS”,
“SFTP”,
“SideBarEnhancements”,
“SublimeLinter”,
“SublimeLinter-csslint”,
“SublimeLinter-jshint”,
“SublimeLinter-json”,
“SublimeLinter-php”,
“Terminal”,
“Theme - Cobalt2”,
“Theme - Cyanide”,
“Theme - Flatland”,
“Theme - Soda”
]
}

Preferences … Settings – User. Preferences.sublime-settings
{
“bold_folder_labels”: false,
“caret_style”: “phase”,
“centurion_folder_icons”: true,
“color_scheme”: “Packages/User/SublimeLinter/Monokai Extended (SL).tmTheme”,
“contrasted_light_tabs”: true,
“contrasted_quick_panel”: true,
“contrasted_sidebar”: true,
“font_options”: “subpixel_antialias”,
“font_size”: 14,
“highlight_line”: false,
“highlight_modified_tabs”: true,
“icon_file_type_enable”: true,
“ignored_packages”:
[
“Vintage”
],
“large_scroll_bars”: false,
“line_padding_bottom”: 1.5,
“line_padding_top”: 1,
“tabs_medium”: true,
“theme”: “Cyanide.sublime-theme”,
“word_wrap”: true
}

0 Likes

#4

After opening a file (and without highlighting), run view.settings().get('syntax') in the console and paste the output.

Something you could try is disabling all packages but “SCSS”, and then gradually enabling some (e.g. using binary search) in order to find an offender, if disabling solved it.

0 Likes

#5

@FichteFoll here is what I got …

view.settings().get(‘syntax’)
‘Packages/Theme - Cyanide/Cyanide/file_types/SCSS.tmLanguage’

Will follow your suggestion to disable packages and re-enable one by one to identify the offender, and report back findings.

Much appreciate your assistance here :slightly_smiling:

0 Likes

#6

Oh my, another one of those. This is a similar issue to https://github.com/equinusocio/material-theme/issues/682 (which is why I asked that question).

I’ll file an issue against the Cyanide theme repo.

Update: There already was an issue, so I just added a comment with a reference to this thread:

0 Likes

#7

This should be fixed, I deleted the files. I released a patch so it should update on package control soon. Let me know if you still have this issue after the update. Thanks!

(edit: I’m lefoy, I just forgot the password of my main account…)

1 Like

#8

Package Control automatically updated my “Theme - Cyanide” files this morning.

After restarting Sublime Text 3, color scheme formatting for both SASS and SCSS syntax files NOW WORKS immediately upon opening a file.
I didn’t need to disable any packages.

Thank you @FichteFoll and @qc_methical

This issue is now resolved. :smile:

0 Likes

#9

Hey guys, I just wanted to add that the theme Coffee also caused this problem for me.

I ran the command view.settings().get('syntax') (as seen above) and the output was:
'Packages/Theme - Coffee/icons/Langs/SCSS.tmLanguage'

So I uninstalled the package, set the default extension for SCSS and everything worked fine. I wasn’t using the theme (never did end up liking it, just forgot to remove it). I think it may have caused issues with a Less extension problem I had a while back.

So thanks @FichteFoll :smiley:

0 Likes

#10

Hey guys, I seem to experience “plain text” issue with my LESS files (year after you solve this issue).
I got output : “Packages/Text/Plain text.tmLanguage” which explains why is not showing colors /highlights in LESS file. What should I change to make it happen? I am not using any Color Scheme but those who are default listed in Sublime3 (Cobalt for an example or any other is the same result , less has plain text appearance).

0 Likes