尝试设置 Flycheck-clang-include-path 而无需包含项目的完整路径,包括使用弹丸的目录,但我收到错误......所以这有效:
((nil . (
(company-clang-arguments . (
"/home/user/Downloads/project/headers"
"/home/user/Downloads/project/source/mon"
))
(flycheck-clang-include-path . (
"/home/user/Downloads/project/headers"
"/home/user/Downloads/project/source/mon"
))
)))
但这并不:
((nil . (
(company-clang-arguments . (
(concat "-I" (projectile-project-root) "headers")
(concat "-I" (projectile-project-root) "source/mon")
))
(flycheck-clang-include-path . (
(concat (projectile-project-root) "headers")
(concat (projectile-project-root) "source/mon")
))
)))
报告的错误:
flycheck-substitute-argument: Value ((concat (projectile-project-root) "headers")) of flycheck-clang-include-path for option "-I" is not a list of strings
一种可能性是使用eval
评估您中引用的表格dir-locals
。这可能被认为是不安全的,因为任何东西都可以以这种形式进行评估。
((nil
(eval . (let ((root (projectile-project-root)))
(setq-local company-clang-arguments
(list (concat "-I" root "headers")
(concat "-I" root "source/mon")))
(setq-local flycheck-clang-include-path
(list (concat root "headers")
(concat root "source/mon")))))))
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)