问题
I would like to have it highlighted like here in Sublime Text:
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 withsyntax--
. 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?
回答1:
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;
}
}
回答2:
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;
}
}
}
来源:https://stackoverflow.com/questions/44721230/how-to-setup-atoms-styles-less-file-to-highlight-function-and-method-call-in