【问题标题】:Coqide 8.5: No syntax highlighting on LinuxCoqide 8.5:Linux 上没有语法高亮显示
【发布时间】:2016-06-18 21:33:23
【问题描述】:

我安装了带有 nix 的 Coqide 8.5。不幸的是,所有面板中的文本都是空白的;没有任何类型的语法突出显示(否则,8.5 似乎比我安装的 8.4 有了很大改进)。我还得到以下信息:

(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

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>

鉴于第一个警告,我想应该有别的东西而不是 "classic" 但是什么

【问题讨论】:

    标签: linux syntax-highlighting nix coqide


    【解决方案1】:

    我安装了libgtksourceview3.0-common,但 CoqIDE 依赖于libgtksourceview2.0-common。安装后者修复它

    【讨论】:

    • 您能具体说明您是如何安装这些软件包的吗?使用nix 或其他包管理器?你用的是哪个命令?
    • 3.0 随我的发行版(Linux Light,Ubuntu 的衍生产品)一起安装。我不记得 2.0,但 ~/.nix-profile/share 只显示 ~coq~nix,所以 2.0 是用突触安装的
    【解决方案2】:

    我刚刚在通过nix(在coq-8.6 包中)安装coqide 时遇到了同样的问题。

    这是一个脚本,它可以将符号链接安装到您的 homedir 中的某些文件,以解决一些警告消息:

    ## 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
    

    这修复了以下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'
    

    我可能会在某个时候尝试修复 coq 派生,以避免需要此解决方法。我怀疑需要执行以下一项或两项操作:

    • 修复 coq 如何设置 GTK SourceView 搜索路径(因为它包含语言定义)
    • 修复 gnome2.gtksourceview 如何导出其搜索路径以供其他程序使用

    【讨论】:

    • 非常好!顺便说一句,这向我暗示了另一个(临时)解决方案,它只是:nix-env -iA nixos.gnome2.gtksourceview,因为这会将这个包的 share/ 文件夹带到 CoqIDE 可以找到的某个地方。
    猜你喜欢
    • 2014-05-07
    • 2021-01-24
    • 1970-01-01
    • 2017-08-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-26
    相关资源
    最近更新 更多