整明白了。按照lsp-bridge文档,做了两件事,现在看代码非常丝滑,比source insight还要爽
1,实现一函数lsp-bridge-set-project-path,来设置lsp-bridge-get-project-path-by-filepath为当前目录
(defun lsp-bridge-set-project-path ()
(interactive)
(setq lsp-bridge-get-project-path-by-filepath
(lambda (filepath)
(save-match-data
(and (string-match default-directory filepath)
(match-string 0 filepath))))))
2,很多代码只是用来看的,本地无法编译,就写了个脚本造一个 compilation_commands.json,内容就是
{
"arguments": [
"/usr/bin/gcc",
"-c",
"-Wall"
],
"directory": "/Users/lula/work/src/src/C/ffmpeg-1.0.10",
"file": "/Users/lula/work/src/src/C/ffmpeg-1.0.10/ffplay.c"
}