Coqide 8.5: No syntax highlighting on Linux

蓝咒 提交于 2019-12-30 07:30:09

问题


I installed Coqide 8.5 w/ nix. Unfortunately, the text is blakc in all panels; there's no syntax highlighting of any kind (otherwise, 8.5 seems a big improvement over 8.4, which I've installed as well). I also get the following:

(coqide:17272): GtkSourceView-WARNING **: Unknown parent scheme 'classic' in scheme 'coq_style'

(coqide:17272): GtkSourceView-WARNING **: Failed to load '/nix/store/2sxcqfc4q3ls4g2q13n1zwfhnydvgq-coq-8.5pl1/share/coq/coq.lang': could not find the RelaxNG schema file

The output of cat ~/.nix-profile/share/coq/coq_style.xml:

<?xml version="1.0" encoding="UTF-8"?>
<style-scheme id="coq_style" _name="Coq highlighting based on Ssr manual"
          parent-scheme="classic" version="1.0">
<author>The Coq Dev Team</author>
<_description>Coq/Ssreflect color scheme for the vernacular language</_description>

<style name="coq:comment" foreground="#brown"/>
<style name="coq:coqdoc" foreground="#brown" italic="true"/>
<style name="coq:vernac-keyword" bold="true" foreground="#dark violet"/>
<style name="coq:gallina-keyword" bold="true" foreground="#orange red"/>
<style name="coq:identifier" foreground="#navy"/>
<style name="coq:constr-keyword" foreground="#dark green"/>
<style name="coq:constr-sort" foreground="#008080"/>

<style name="coq-ssreflect:comment" foreground="#b22222"/>
<style name="coq-ssreflect:coqdoc" foreground="#b22222" italic="true"/>
<style name="coq-ssreflect:vernac-keyword" bold="true" foreground="#a021f0"/>
<style name="coq-ssreflect:gallina-keyword" bold="true" foreground="#a021f0"/>
<style name="coq-ssreflect:identifier" bold="true" foreground="#0000ff"/>
<style name="coq-ssreflect:constr-keyword" foreground="#228b22"/>
<style name="coq-ssreflect:constr-sort" foreground="#228b22"/>
<style name="coq-ssreflect:tactic" foreground="#101092"/>
<style name="coq-ssreflect:endtactic" foreground="#ff3f3f"/>
<style name="coq-ssreflect:iterator" foreground="#be6ad4"/>
<style name="coq-ssreflect:string" foreground="#8b2252"/>
</style-scheme>

Given the first warning, I guess there should be something else instead of "classic" but what


回答1:


I have libgtksourceview3.0-common installed but CoqIDE depends on libgtksourceview2.0-common. Installing the latter fixed it




回答2:


I just ran into this same issue with coqide installed via nix (in the coq-8.6 package).

Here's a script that installs symlinks to some files in your homedir to work around several warning messages:

## Find the nix-installed version of the GTK SourceView 2.0 library
sourceview="$(nix-env -q coq --no-name --out-path |
    xargs nix-store -q --references |
    grep -- -gtksourceview-)"

## Link files into the correct hierarchical folders in your home dir:
share=share/gtksourceview-2.0
for file in language-specs/language2.rng \
    language-specs/def.lang \
    styles/classic.xml
do
    target="$HOME/.local/$share/$file"
    mkdir -vp "$(dirname "$target")"
    ln -vfns "$sourceview/$share/$file" "$target"
done

This fixes the following GtkSourceView-WARNINGs:

## fixed by language-specs/language2.rng
Failed to load '.../share/coq/coq.lang': could not find the RelaxNG schema file

## fixed by language-specs/def.lang
in file .../share/coq/coq.lang: style 'def:comment' not defined
Failed to load '.../share/coq/coq.lang': unable to resolve language 'def'

## fixed by styles/classic.xml
Unknown parent scheme 'classic' in scheme 'coq_style'

I'll likely try to fix the coq derivation at some point to avoid needing this workaround. I suspect either or both of the following would need to be done:

  • Fix how coq sets up the GTK SourceView search paths (since it includes the language definition)
  • Fix how gnome2.gtksourceview exports its search path(s) for other programs to use


来源:https://stackoverflow.com/questions/37901837/coqide-8-5-no-syntax-highlighting-on-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!