Sublime Forum

Error loading scope:source.coffee

#1

The following error message shows up in the console during startup:

Error loading scope:source.coffee: Unable to find syntax file for scope source.coffee in MultiMarkdown.sublime-syntax

This is related to the MarkdownEditing package I have installed.

Context to the message is provided here.

For the error to disappear I need to install the syntax for coffee. I already have 4 installations of Gulpfile Coffee syntax but cannot find a package for Coffee.

Also, Gulpfile Coffee syntax is installed but cannot be found:

Error loading scope:source.coffee: Unable to find syntax file for scope source.coffee in Packages/Materialize/Langs/Gulpfile Coffee.tmLanguage

Error loading scope:source.coffee: Unable to find syntax file for scope source.coffee in Packages/Theme - Alpenglow/Prefs/Langs/Gulpfile Coffee.tmLanguage

Which package should I install? Or, should I use the tmLanguage and convert it into sublime-syntax?

I am using ST v3.2.2 b3211

0 Likes

#2

I created a gulpfile coffee syntax:

%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Gulpfile Coffee
file_extensions:
  - gulpfile.coffee
scope: source.coffee, source.coffee.gulpfile
contexts:
  main:
    - include: scope:source.coffee

but am receiving another error:

Error loading scope:source.coffee: Unable to find syntax file for scope source.coffee in Packages/User/SyntaxDefinitions/MultiMarkdown.sublime-syntax
0 Likes

#3

MarkdownEditing syntax uses plain old and outdated - include: ... with_prototype: ... instead of embedding external sources. The - include statement expects the included syntax/contexts to exist, while embed would “fail” gracefully.

The https://packagecontrol.io/packages/CoffeeScript provides a syntax for source.coffee.

The example in your second post doesn’t solve anything.

  1. The main scope: may not contain multiple scopes.
  2. It just duplicates the error MarkdownEditing syntax suffers from. It includes a non-existing syntax.

Solutions:

  1. If you want syntax highlighting, just install CoffeeScript package.
  2. If you just want to work around error messages, you may need to create dummy syntaxes which include plain text.

Dummy Coffee Syntax

%YAML 1.2
---
name: Coffee
file_extensions:
  - coffee
scope: source.coffee
contexts:
  main:
    - include: scope:text.plain

Gulpfile Syntax

%YAML 1.2
---
name: Gulpfile Coffee
file_extensions:
  - gulpfile.coffee
scope: source.coffee.gulpfile
contexts:
  main:
    - include: scope:source.coffee

Note: A File Icon already defines an alias syntax for source.coffee.gulpfile (by default).

2 Likes

#4

I opted for creating a dummy syntax. This has solved my problem, thank you very much!

0 Likes