How can I customize the "styles.less" Atom file to highlight function and method call in Python?

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

enter image description here

I tried as suggested here :

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

      

However, the Atom disclaimer says:

As of Atom v1.13.0, the contents of elements are atom-text-editor

no longer encapsulated within the shadow DOM border. This means you should stop using the pseudo-selectors :host

, and ::shadow

to add all of the syntax of the selector to syntax--

. To prevent breaking existing stylesheets, Atom will automatically update 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 several releases to minimize startup time. Please be sure to update the above selectors as soon as possible.

Does it have to 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';
  }
}

      

Can anyone help me to highlight function and method calls in the Atom Monokai syntax color theme?

+3


source to share


2 answers


You need to remove ''

the colors from the rule. They don't go there. I tested and this works:



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

      

+4


source


This solution highlighted all function calls for me:



atom-text-editor.editor {
  .syntax--source.syntax--python {
    .syntax--function-call.syntax--generic.syntax--python  {
      color: #ffc1c1;
    }
  }
}

      

0


source







All Articles