Coqide 8.5: No syntax highlighting on Linux

廉价感情. 提交于 2019-12-01 00:33:07

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

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