如何设置Atom的'styles.less'文件以突出显示Python中的函数和方法调用? [英] How to setup Atom's 'styles.less' file to highlight function and method call in Python?

查看:235
本文介绍了如何设置Atom的'styles.less'文件以突出显示Python中的函数和方法调用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Sublime Text中突出显示它

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

我尝试了建议的但是,Atom的弃用说:

However, Atom's deprecation says:

从Atom v1.13.0开始,atom-text-editor元素的内容 不再封装在影子DOM边界内.这表示 您应该停止使用:host::shadow伪选择器,并添加前缀 使用syntax--的所有语法选择器.为防止破损 现有样式表,Atom会自动升级以下内容 选择器:

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
  • 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';
  }
}

有人可以帮我突出显示Atom Monokai语法颜色主题中的函数和方法调用吗?

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

推荐答案

您需要从颜色规则中删除''.那些不去那里.我进行了测试,并且有效:

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;
  }
}

这篇关于如何设置Atom的'styles.less'文件以突出显示Python中的函数和方法调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆