如何在 enh-ruby-模式下修复 "projectile-find-implementation-or-test: No matching test file found for project type ‘haskell-stack’"?

How to fix "projectile-find-implementation-or-test: No matching test file found for project type ‘haskell-stack’" in enh-ruby-mode?

我目前在处理一个典型的 Rails 项目时遇到抛射物的奇怪行为。长期使用弹丸但这是我第一次看到它:

projectile-find-implementation-or-test: No matching test file found for project type ‘haskell-stack’

(打印主要模式) enh-ruby-模式

当前文件(app/models/user.rb 或 spec/models/user_spec.rb)

head -1 app/models/user.rb
# == Schema Information

head -1 spec/models/user_spec.rb
# require 'rails_helper'

奇怪的是,我很长时间没有打开一个 Haskell 文件。

--

添加信息:

projectile-project-type is a variable defined in ‘projectile.el’. Its value is nil

原来是项目根目录中的 stack.yaml 文件造成的混淆。

(projectile-register-project-type 'haskell-stack '("stack.yaml")
                                  :project-file "stack.yaml"
                                  :compile "stack build"
                                  :test "stack build --test"
                                  :test-suffix "Spec")

Source