VSCode:增加linter警告的不透明度

时间:2018-10-22 21:17:45

标签: visual-studio-code vscode-settings vscode-extensions theming material-theme

我最近以我的编辑器切换到Visual Studio Code。我安装了我最喜欢的主题"Material Theme Palenight High Contrast"。我爱上了它。只是有一个问题,当我在笔记本电脑上进行编码时,这确实阻碍了我的工作。

起毛错误的波浪线超级暗,因为它们不透明。

enter image description here

正如您在此处看到的那样,几乎看不到item下的错误。有没有办法改变掉毛错误的不透明度?

编辑:我尝试设置workbench.colorCustomizations,但是这导致我的主题消失了。

编辑2:我尝试像这样设置主题特定设置:

"workbench.colorCustomizations": {
  "[Material Theme Ocean High Contrast]": {
    "editorError.foreground": "#ff0000"
  }
},

但是没有用。波浪状的颜色保持不变。

2 个答案:

答案 0 :(得分:0)

the theme page you linked上的说明说使用import tensorflow as tf ds1 = tf.data.Dataset.from_tensor_slices([5,5,5,5,5]) ds2 = tf.data.Dataset.from_tensor_slices([4,4]) ds1 = ds1.batch(2) ds2 = ds2.batch(1) iter1 = ds1.make_one_shot_iterator() iter2 = ds2.make_one_shot_iterator() # this variable will store a backup of `batch1`, in case it is dropped batch1_backup = tf.Variable(0, trainable=False, validate_shape=False) def get_batch12(): batch1 = iter1.get_next(name='batch1') # form the combined batch `batch12` only after backing-up `batch1` with tf.control_dependencies([tf.assign(batch1_backup, batch1, validate_shape=False)]): batch2 = iter2.get_next(name='batch2') batch12 = tf.concat((batch1, batch2), 0) return batch12 def get_batch1(): batch1 = iter1.get_next() return batch1 def get_batch2(): batch2 = iter2.get_next() return batch2 # this is a "control" placeholder. Its value determines whether to use `batch12`, `batch1_backup`, `batch1`, or `batch2` which_batch = tf.Variable(0,trainable=False) batch = tf.cond( tf.equal(which_batch,0), # if `which_batch`==0, use `batch12` get_batch12, lambda:tf.cond(tf.equal(which_batch,1), # elif `which_batch`==1, use `batch1_backup` lambda:batch1_backup, lambda:tf.cond(tf.equal(which_batch,2), # elif `which_batch`==2, use `batch1` get_batch1, get_batch2))) # else, use `batch2` sess = tf.Session() sess.run(tf.global_variables_initializer()) which = 0 # this value will be fed into the control placeholder while True: try: print(sess.run(batch,feed_dict={which_batch:which})) # if just used `batch1_backup`, proceed with `batch1` if which==1: which = 2 except tf.errors.OutOfRangeError as e: # use the error to detect which dataset was consumed, and update `which` accordingly if which == 0: if 'batch2' in e.op.name: which = 1 else: which = 3 else: break ,而不是editor.colorCustomizations。你尝试过吗?

我提供的链接上方还有一些关于设置强调色的话题。他们没有定义“强调颜色”的含义,因此我不确定该颜色是否是您要更改的东西,但是您可以尝试。

答案 1 :(得分:0)

我能够找到一个解决方法。转到安装扩展程序的位置:

/Users/user-name/.vscode/extensions/extension-name/themes/theme-name.json

在该文件中找到editorError.foregroundeditorWarning.foreground的值。在这里,您可以覆盖它们的值,它将起作用。

我只是问自己,这是否应该是VSCode存储库的问题?由于在用户设置中设置设置,应将其覆盖。人们不必更改此.json文件。特别是因为如果您重新安装主题,它将再次变回原来的状态。

虚拟编辑‍♂️:

该死,我不小心写了 Palenight Oceaning 指令。颜色自定义工作...我的糟糕。无需执行我上面描述的这种骇人听闻的技巧。