Coqide 8.5: No syntax highlighting on Linux

后端 未结 2 1789
日久生厌
日久生厌 2021-01-07 00:13

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 improveme

相关标签:
2条回答
  • 2021-01-07 00:57

    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
    0 讨论(0)
  • 2021-01-07 00:58

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

    0 讨论(0)
提交回复
热议问题