question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hey, I was just curious whether or not you guys could add the Imba icon, a compile-to-JS language.

See: https://github.com/somebee/imba https://atom.io/packages/language-imba

I’m currently doing it right now through LESS in the stylesheet, feels really hacky. The language-imba package declares:

Scope: source.imba
File Types: imba

But yet despite this, the grammar being properly autodetected, and using a custom language definition in Atom’s config coffeescript, I couldn’t get the CSS selector to trigger. I don’t think I should even need to declare it a custom file type because of the Scope and File Type from the language package, but I tried anways

  core:
    customFileTypes:
      "source.imba": [
        "imba"
      ]

Still just get:

<span class="name icon default-icon" title="test.imba" data-name="test.imba" data->test.imba</span>

So using this:

.icon[data-name$="imba"]:before{
  content: url('http://imba.io/images/logo.svg');
}

Unfortunately the SVG doesn’t scale well at small dimensions, but what can you do?

Imba Atom Icon

Thank you guys!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
GavinRay97commented, Oct 27, 2017

Ahhh yeah, I feel like a moron, I was browsing the commit changes just now and saw the File Icons package config.cson and that you manually defined everything there, and had added an entry for the Imba file type.

Came back to strike out my comment and amend that I’m an idiot but you beat me to it. You’re on top of things!

It’s becoming increasingly tempting to move the icon-config logic to a separate repository…

I saw that discussion while trying to figure out how to implement the Icon without using LESS. I would advocate for it, just due to extensibility purposes honestly.

1reaction
Alhadiscommented, Oct 27, 2017

Nope, we manually declare the scope in the config file itself. See the documentation at the top of the file:

Name of any TextMate grammars which trigger the icon when overriding a file’s grammar. This may be a string or regex; if provided the former, it’s used to construct a case-insensitive pattern that’s checked against the end of the string (e.g., “js” will be treated as if /.js$/i were written). Not every grammar will/should change an icon, especially for very generic formats like JSON or YAML.

However, the config also supports a shorthand. E.g., this line:

ANTLR:
	icon: "antlr"
	match: [
		[".g", "medium-red", "antlr"]
	]

… expands into this at compile-time:

ANTLR:
	icon: "antlr"
	match: [
		[".g", "medium-red", alias: "antlr", interpreter: "antlr", scope: "antlr"]
	]

In most cases, all three properties are identical, so the shorthand is sufficient for most cases.

It’s becoming increasingly tempting to move the icon-config logic to a separate repository…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Branding Assets for Imba
Place /icons folder in your project, then add add the following code to the head of your index.html, to add icon support for...
Read more >
Importing Assets
import icons from './feather/*.svg' # contains all matching assets: icons.check ...
Read more >
Imba icon - File Icons
Support for vector shapes (such as lines, curves, etc.) Supports bitmap objects; Text support; Support for manipulation and combinations of objects, including ...
Read more >
IMBA: Mountain Biking
We create, enhance and protect great places to ride mountain bikes. We want everyone across the U.S. to have access to great trails—from...
Read more >
Dig In
Why Mountain Biking? Our Focus · Blog · News · Staff and Board · Log In; Donate ». Join Local · Support National...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found