Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup Atom's 'styles.less' file to highlight function and method call in Python?

I would like to have it highlighted like here in Sublime Text:

enter image description here

I tried like suggested here:

atom-text-editor, atom-text-editor::shadow {
  .meta.function-call.python {
    color: '#abcde';
  }
}

However, Atom's deprecation says:

Starting from Atom v1.13.0, the contents of atom-text-editor elements are no longer encapsulated within a shadow DOM boundary. This means you should stop using :host and ::shadow pseudo-selectors, and prepend all your syntax selectors with syntax--. To prevent breakage with existing style sheets, Atom will automatically upgrade the following selectors:

  • atom-text-editor .meta.function-call.generic.python,
  • atom-text-editor::shadow .meta.function-call.generic.python => atom-text-editor .meta.function-call.generic.python,
  • atom-text-editor.editor .syntax--meta.syntax--function-call.syntax--generic.syntax--python

Automatic translation of selectors will be removed in a few release cycles to minimize startup time. Please, make sure to upgrade the above selectors as soon as possible.

Should it be like this? (I tried but it doesn't work)

atom-text-editor {
  .meta.function-call.python {
    color: '#66D9EF';
  }
}

atom-text-editor.editor {
  .syntax--meta.syntax--function-call.syntax--python {
    color: '#66D9EF';
  }
}

Could someone help me to highlight function and method calls in Atom's Monokai syntax color theme?

like image 415
Hrvoje T Avatar asked Jun 23 '17 12:06

Hrvoje T


1 Answers

You need to remove the '' from the color rule. Those don't go there. I tested and this works:

atom-text-editor.editor {
  .syntax--meta.syntax--function-call.syntax--python {
    color: #66D9EF;
  }
}
like image 170
Holland Wilson Avatar answered Sep 21 '22 19:09

Holland Wilson