ฉันต้องการให้ตัวแปรแสดงด้วยสี
นี่คือลักษณะที่ปรากฏ:
นี่คือวิธีที่ฉันต้องการให้เป็น:
เมื่อดูที่นี่ ฉันไม่พบการตั้งค่าใดๆ ที่อนุญาตให้ฉันเปลี่ยนแปลงได้
ฉันต้องการให้ตัวแปรแสดงด้วยสี
นี่คือลักษณะที่ปรากฏ:
นี่คือวิธีที่ฉันต้องการให้เป็น:
เมื่อดูที่นี่ ฉันไม่พบการตั้งค่าใดๆ ที่อนุญาตให้ฉันเปลี่ยนแปลงได้
ลองใช้การตั้งค่านี้ใน settings.json ของคุณ:
"editor.tokenColorCustomizations": {
"variables": "#f00"
},
มีการปรับแต่งสีโทเค็น ง่ายๆ บางอย่างที่ใช้งานได้: ตัวแปร ความคิดเห็น คำหลัก ฟังก์ชัน ตัวเลข สตริง และประเภท สิ่งเหล่านี้อนุญาตให้ตั้งค่า สี เท่านั้น
หากคุณใช้ "textMateRules" คุณสามารถตั้งค่าคุณสมบัติเพิ่มเติมได้ ตัวอย่างเช่น:
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "comment",
"settings": {
"fontStyle": "italic",
"foreground": "#C69650"
}
}
]
},
self
เปลี่ยนเป็นสีแดง แต่ search_obj
ไม่ใช่หรือเป็น ส่วน get_key
ซึ่งควรจะมีการใช้ฟังก์ชัน - ฟังก์ชันใช้กับคำจำกัดความเท่านั้น
- person Modelmat; 09.12.2017
สิ่งนี้ใช้ได้สำหรับฉัน มันทำให้ดูเหมือนการจัดรูปแบบ Javascript เริ่มต้นเท่าที่ฉันเห็น
In settings.json
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "meta.function-call.generic.python",
"settings": {
"foreground": "#DCDCAA"
}
},
{
"scope": "source.python",
"settings": {
"foreground": "#9CDCFE"
}
},
{
"scope": "punctuation.definition.string.begin",
"settings": {
"foreground": "#ce9178"
}
},
{
"scope": "punctuation.definition.string.end",
"settings": {
"foreground": "#ce9178"
}
},
{
"scope": "punctuation",
"settings": {
"foreground": "#dfdfdf"
}
}
]
}
คุณควรจะสามารถเพิ่มสีใน tokenColors
เพื่อปรับแต่งสีได้ (ตัวอย่างพื้นฐาน):
SomeTheme.json
{
"name": "Some Theme",
"type": "dark",
"colors": {
...
},
"tokenColors": [
{
"name": "Variables",
"scope": "variable",
"settings": {
"foreground": "#e06c75"
}
},
]
}
ฉันไม่มี VSCode
แม้ว่าจากการดูที่ another ธีม JSON มีลักษณะคล้ายกัน