textDocument/hover 混合 textDocument/signatureHelp

有兩個輔助閱讀程式碼的LSP功能

textDocument/hover

  • lsp-mode自帶lsp--on-hover,用eldoc-documentation-function渲染
  • 若開啓lsp-ui-doc,eldoc-documentation-function會被修改爲lsp-ui-doc--eldoc,可以同時顯示在echo area和child frame,見下圖
  • eglot, eldoc

textDocument/signatureHelp

這個少有人知道是因爲lsp-mode中它並非默認lsp-hover-text-function。可以用(setq lsp-hover-text-function #'lsp--text-document-signature-help)感受在各大lang server裏什麼效果。

輔助補全,提示有哪些overloads可用,以及active parameter,見下圖

在evil的normal-state時,可以始終使用textDocument/hover。而在insert-state且point被非匹配的(包裹,則應該用textDocument/signatureHelp。這個lsp-mode PR能高亮eldoc中的active parameter。

如何實現這個邏輯呢?

(defun +my/lsp-ui-doc--eldoc (&rest _)
  (when (and (lsp--capability "documentHighlightProvider")
             lsp-highlight-symbol-at-point)
    (lsp-symbol-highlight))
  (if (evil-insert-state-p)
      (lsp--text-document-signature-help)
      lsp-ui-doc--string-eldoc
      ))

(advice-add #'lsp-ui-doc--eldoc :override #'+my/lsp-ui-doc--eldoc)

目前lsp-mode的signatureHelp實現的缺陷是檢測(symbol-at-point),但對於:foo(<point> foo(a, <point>等位置(symbol-at-point)爲nil,而用戶也期望在這些位置獲得signatureHelp。

另外也要注意不要讓eldoc頻繁出現消失,閃爍會造成不好的使用者經驗。

https://github.com/emacs-lsp/lsp-mode/blob/signature-help/lsp-methods.el#L1715

把這個改得好一點(考慮下其他語言的language server),我可以merge到lsp-ui (不太懂elisp但是恰好有權力~~)

註,今天把textDocument/signatureHelp重寫爲clangd式樣了,但沒有用他們的index輔助啓發(我沒有強需求加signal)

ccls的textDocument/hover用於liblmdb/mdb.c(10000+行)有<2ms延遲。粗糙測試,cache能把0.8ms 1.1ms降低到0.4~0.6ms。 clangd有10~20ms,但實時(無需保存)。因爲每次請求都會構造clang CompilerInvocation並parse,但這個開銷低於我的預期

這些區別是無關緊要的,因爲他們足夠快了。主要時間花在Emacs端UI展示上。

另外忘記提現在預設completion.detailedLabel: true,irony式樣的補全(label爲具體的foo(int a) -> int而非僅僅foo)

另外有個completion/duplicateOptional,開啓的話(預設),int foo(int a, int b = 3)會顯示爲兩個補全項:

  • foo(int a) -> int
  • foo(int a, int b = 3) -> int
2 个赞

好强大 可惜我不会

foo(par<point>am1, param2)旁移動

觸發鏈:

  • eldoc-documentation-function
  • lsp--on-hover or advised lsp-ui-doc--eldoc
  • lsp--text-document-signature-help
  • lsp--make-text-document-signature-help-callback
  • eldoc-message 相同內容也會在echo area闪烁。感覺不舒服

lsp 的体验还需改进,有时候 hover 呼啦占据一大片,光标所在上下文被遮住,反而造成干扰,不知道是不是因为终端的关系。

想起以前用过的盗版 Source Insight,它固定一个小窗口显示定义/文档信息,必要时双击可以把小窗口替换到主窗口,读代码跳转非常方便:

Emacs 如果不用鼠标,恐怕很难复制这种体验。小窗口如果不用鼠标滚屏,显示不了多少信息,快捷键跳过去翻页又略显麻烦,除非 scroll-other-window。另外 Emacs 窗口没有主次之分,很容易被 kill 掉。

我目前的做法就是(setq lsp-ui-doc-position 'at-point) 加一个toggle-lsp-ui-mode的函数绑定到s-j or C-j,这样就跟vscode/intellij差不多了

(setq lsp-ui-doc-position 'at-point)會遮擋右下方文字,也不太方便……你們有精力看看怎麼判斷lsp-ui-doc是否會遮擋point,改進下?

emm,我就是用s-j toggle lsp ui childframe啊。然后我启动默认的就是hide的,这样就不会有遮挡问题了啊。

(defun toggle-lsp-ui-doc ()
  (interactive)
  (if lsp-ui-doc-mode
      (progn
        (lsp-ui-doc-mode -1)
        (lsp-ui-doc--hide-frame))
    (lsp-ui-doc-mode 1))
  (setq-local eldoc-documentation-function 'ignore))

(defun my-lsp-mode-hook ()
  ;; disable lsp-highlight-symbol
  ;; (setq lsp-highlight-symbol-at-point nil)

  ;; toggle off lsp-ui-doc by default
  (toggle-lsp-ui-doc)

  ;; overwrite s-j key for toggle-lsp-ui-doc
  (global-set-key (kbd "s-j") #'toggle-lsp-ui-doc))
(add-hook 'lsp-mode-hook #'my-lsp-mode-hook)
1 个赞

我覺得一個臨時隱藏childframe的功能就足夠了。

但現在(lsp-ui-doc--hide-frame)不夠,還會繼續popup,原因可能是:

; lsp-ui-doc.el
      (add-hook 'post-command-hook 'lsp-ui-doc--make-request nil t)

lsp-ui-doc--make-request實現機制有關。你看下這個怎麼改進?

在ubuntu 16.04上编译失败了,说不支持c++17

CC=gcc-8 CXX=g++-8 cmake . -DCMAKE_CXX_FLAGS="-std=c++17"

man g++-8是有这个选项的

当然,默认是gcc-5,这个不支持。

还有用AUR的ccls的话,项目根目录放一个.ccls-root(我设置了eglot识别这个文件),传递fileInfo的时候总说找不到这个文件(应该是clang里的CompilationDatabase类没有,不知道ccls是不是用的这个)。

裝gcc 7或8

Create new page · MaskRay/ccls Wiki · GitHub

  • On Linux, building requires libstdc++ shipped with GCC > 7.0 for C++17 header files, even if you use clang++.

$ccls/fileInfo

(defun ccls-file-info ()
  (lsp--cur-workspace-check)
  (lsp--send-request
   (lsp--make-request "$ccls/fileInfo"
                      `(:textDocument ,(lsp--text-document-identifier)))))

要看eglot怎麼構造custom request

.ccls-root是我用來標識project root的方式,當我不想用.projectile時。compiler options通過.cclscompile_commands.json傳遞。

libstdc++-8-dev这个是装了的,编译器设置的g++-8的话(如上),库会链接正确的吧,不过cmake还是说不支持。

eglot的话,下面的方法是没问题的,不过他们8月份把一个地方改了,我回滚到前一个commit就没问题了,我看ccls应该没改这里。

判斷libstdc++-8-dev是否被用:

g++ -v -E -xc++ /dev/null
clang++ -v -E -xc++ /dev/null

觀察#include <...> search starts here:

-DCMAKE_CXX_COMPILER=clang++可能比CXX=clang++好。

临时隐藏可能不够。vscode之类的鼠标用户是可以通过hover来显示,emacs下大家用鼠标比较少,缺少了鼠标的事件,只能通过按键来toggle吧,把lsp-ui-doc-mode关闭/开启这样子。这样也不会再触发lsp-ui-doc—make-request了吧

cmake . -DCMAKE_CXX_COMPILER=g++-8还是不行,头文件(g++-8 -E -v -xc++ - < /dev/null):

 /usr/include/c++/8                                                                                                     
 /usr/include/x86_64-linux-gnu/c++/8                                                                                    
 /usr/include/c++/8/backward                                                                                            
 /usr/lib/gcc/x86_64-linux-gnu/8/include                                                                                
 /usr/local/include                                                                                                     
 /usr/lib/gcc/x86_64-linux-gnu/8/include-fixed                                                                          
 /usr/include/x86_64-linux-gnu                                                                                          
 /usr/include

閱讀Release/CMakeFiles/CMakeOutput.log,假設構建目錄是Release (即 cmake -H. -BRelease中的Release)

你說“不行”兩字,資訊量很低。

主要是它报的错直接是编译器不支持C++17

CMakeError.log:

Determining if the pthread_create exist failed with the following output:
Change Dir: /home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_185c7/fast"
/usr/bin/make -f CMakeFiles/cmTC_185c7.dir/build.make CMakeFiles/cmTC_185c7.dir/build
make[1]: Entering directory '/home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_185c7.dir/CheckSymbolExists.cxx.o
/usr/bin/g++-8      -o CMakeFiles/cmTC_185c7.dir/CheckSymbolExists.cxx.o -c /home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx
Linking CXX executable cmTC_185c7
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_185c7.dir/link.txt --verbose=1
/usr/bin/g++-8        CMakeFiles/cmTC_185c7.dir/CheckSymbolExists.cxx.o  -o cmTC_185c7 -rdynamic
CMakeFiles/cmTC_185c7.dir/CheckSymbolExists.cxx.o: In function `main':
CheckSymbolExists.cxx:(.text+0x16): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_185c7.dir/build.make:97: recipe for target 'cmTC_185c7' failed
make[1]: *** [cmTC_185c7] Error 1
make[1]: Leaving directory '/home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_185c7/fast' failed
make: *** [cmTC_185c7/fast] Error 2

File /home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx:
/* */
#include <pthread.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef pthread_create
  return ((int*)(&pthread_create))[argc];
#else
  (void)argc;
  return 0;
#endif
}

CMakeOutput.log:

The system is: Linux - 4.4.0-135-generic - x86_64
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: /usr/bin/g++-8 
Build flags: 
Id flags: 

The output was:
0


Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out"

The CXX compiler identification is GNU, found in "/home/glgl-schemer/.emacs.d/ccls/CMakeFiles/3.5.1/CompilerIdCXX/a.out"

Determining if the CXX compiler works passed with the following output:
Change Dir: /home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_b3cf5/fast"
/usr/bin/make -f CMakeFiles/cmTC_b3cf5.dir/build.make CMakeFiles/cmTC_b3cf5.dir/build
make[1]: Entering directory '/home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_b3cf5.dir/testCXXCompiler.cxx.o
/usr/bin/g++-8      -o CMakeFiles/cmTC_b3cf5.dir/testCXXCompiler.cxx.o -c /home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_b3cf5
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b3cf5.dir/link.txt --verbose=1
/usr/bin/g++-8        CMakeFiles/cmTC_b3cf5.dir/testCXXCompiler.cxx.o  -o cmTC_b3cf5 -rdynamic 
make[1]: Leaving directory '/home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp'


Detecting CXX compiler ABI info compiled with the following output:
Change Dir: /home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_0956c/fast"
/usr/bin/make -f CMakeFiles/cmTC_0956c.dir/build.make CMakeFiles/cmTC_0956c.dir/build
make[1]: Entering directory '/home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_0956c.dir/CMakeCXXCompilerABI.cpp.o
/usr/bin/g++-8      -o CMakeFiles/cmTC_0956c.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.5/Modules/CMakeCXXCompilerABI.cpp
Linking CXX executable cmTC_0956c
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0956c.dir/link.txt --verbose=1
/usr/bin/g++-8       -v CMakeFiles/cmTC_0956c.dir/CMakeCXXCompilerABI.cpp.o  -o cmTC_0956c -rdynamic  
Using built-in specs.
COLLECT_GCC=/usr/bin/g++-8
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 8.1.0-5ubuntu1~16.04' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 8.1.0 (Ubuntu 8.1.0-5ubuntu1~16.04) 
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/8/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/8/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_0956c' '-rdynamic' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/8/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/8/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper -plugin-opt=-fresolution=/tmp/ccaO1Quq.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_0956c /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/8/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/8 -L/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/8/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/8/../../.. CMakeFiles/cmTC_0956c.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/8/crtend.o /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crtn.o
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_0956c' '-rdynamic' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
make[1]: Leaving directory '/home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp'


Parsed CXX implicit link information from above output:
  link line regex: [^( *|.*[/\])(ld|([^/\]+-)?ld|collect2)[^/\]*( |$)]
  ignore line: [Change Dir: /home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp]
  ignore line: []
  ignore line: [Run Build Command:"/usr/bin/make" "cmTC_0956c/fast"]
  ignore line: [/usr/bin/make -f CMakeFiles/cmTC_0956c.dir/build.make CMakeFiles/cmTC_0956c.dir/build]
  ignore line: [make[1]: Entering directory '/home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp']
  ignore line: [Building CXX object CMakeFiles/cmTC_0956c.dir/CMakeCXXCompilerABI.cpp.o]
  ignore line: [/usr/bin/g++-8      -o CMakeFiles/cmTC_0956c.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.5/Modules/CMakeCXXCompilerABI.cpp]
  ignore line: [Linking CXX executable cmTC_0956c]
  ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0956c.dir/link.txt --verbose=1]
  ignore line: [/usr/bin/g++-8       -v CMakeFiles/cmTC_0956c.dir/CMakeCXXCompilerABI.cpp.o  -o cmTC_0956c -rdynamic  ]
  ignore line: [Using built-in specs.]
  ignore line: [COLLECT_GCC=/usr/bin/g++-8]
  ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper]
  ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none]
  ignore line: [OFFLOAD_TARGET_DEFAULT=1]
  ignore line: [Target: x86_64-linux-gnu]
  ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 8.1.0-5ubuntu1~16.04' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu]
  ignore line: [Thread model: posix]
  ignore line: [gcc version 8.1.0 (Ubuntu 8.1.0-5ubuntu1~16.04) ]
  ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/]
  ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/8/:/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/8/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/8/../../../:/lib/:/usr/lib/]
  ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_0956c' '-rdynamic' '-shared-libgcc' '-mtune=generic' '-march=x86-64']
  link line: [ /usr/lib/gcc/x86_64-linux-gnu/8/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/8/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper -plugin-opt=-fresolution=/tmp/ccaO1Quq.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_0956c /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/8/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/8 -L/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/8/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/8/../../.. CMakeFiles/cmTC_0956c.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/8/crtend.o /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crtn.o]
    arg [/usr/lib/gcc/x86_64-linux-gnu/8/collect2] ==> ignore
    arg [-plugin] ==> ignore
    arg [/usr/lib/gcc/x86_64-linux-gnu/8/liblto_plugin.so] ==> ignore
    arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper] ==> ignore
    arg [-plugin-opt=-fresolution=/tmp/ccaO1Quq.res] ==> ignore
    arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
    arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
    arg [-plugin-opt=-pass-through=-lc] ==> ignore
    arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
    arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
    arg [--sysroot=/] ==> ignore
    arg [--build-id] ==> ignore
    arg [--eh-frame-hdr] ==> ignore
    arg [-m] ==> ignore
    arg [elf_x86_64] ==> ignore
    arg [--hash-style=gnu] ==> ignore
    arg [--as-needed] ==> ignore
    arg [-export-dynamic] ==> ignore
    arg [-dynamic-linker] ==> ignore
    arg [/lib64/ld-linux-x86-64.so.2] ==> ignore
    arg [-zrelro] ==> ignore
    arg [-o] ==> ignore
    arg [cmTC_0956c] ==> ignore
    arg [/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crt1.o] ==> ignore
    arg [/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crti.o] ==> ignore
    arg [/usr/lib/gcc/x86_64-linux-gnu/8/crtbegin.o] ==> ignore
    arg [-L/usr/lib/gcc/x86_64-linux-gnu/8] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/8]
    arg [-L/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu]
    arg [-L/usr/lib/gcc/x86_64-linux-gnu/8/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/8/../../../../lib]
    arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu]
    arg [-L/lib/../lib] ==> dir [/lib/../lib]
    arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu]
    arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib]
    arg [-L/usr/lib/gcc/x86_64-linux-gnu/8/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/8/../../..]
    arg [CMakeFiles/cmTC_0956c.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore
    arg [-lstdc++] ==> lib [stdc++]
    arg [-lm] ==> lib [m]
    arg [-lgcc_s] ==> lib [gcc_s]
    arg [-lgcc] ==> lib [gcc]
    arg [-lc] ==> lib [c]
    arg [-lgcc_s] ==> lib [gcc_s]
    arg [-lgcc] ==> lib [gcc]
    arg [/usr/lib/gcc/x86_64-linux-gnu/8/crtend.o] ==> ignore
    arg [/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crtn.o] ==> ignore
  remove lib [gcc_s]
  remove lib [gcc]
  remove lib [gcc_s]
  remove lib [gcc]
  collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/8] ==> [/usr/lib/gcc/x86_64-linux-gnu/8]
  collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
  collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/8/../../../../lib] ==> [/usr/lib]
  collapse library dir [/lib/x86_64-linux-gnu] ==> [/lib/x86_64-linux-gnu]
  collapse library dir [/lib/../lib] ==> [/lib]
  collapse library dir [/usr/lib/x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu]
  collapse library dir [/usr/lib/../lib] ==> [/usr/lib]
  collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/8/../../..] ==> [/usr/lib]
  implicit libs: [stdc++;m;c]
  implicit dirs: [/usr/lib/gcc/x86_64-linux-gnu/8;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib]
  implicit fwks: []




Detecting CXX [-std=c++14] compiler features compiled with the following output:
Change Dir: /home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_09b15/fast"
/usr/bin/make -f CMakeFiles/cmTC_09b15.dir/build.make CMakeFiles/cmTC_09b15.dir/build
make[1]: Entering directory '/home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_09b15.dir/feature_tests.cxx.o
/usr/bin/g++-8     -std=c++14 -o CMakeFiles/cmTC_09b15.dir/feature_tests.cxx.o -c /home/glgl-schemer/.emacs.d/ccls/CMakeFiles/feature_tests.cxx
Linking CXX executable cmTC_09b15
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_09b15.dir/link.txt --verbose=1
/usr/bin/g++-8        CMakeFiles/cmTC_09b15.dir/feature_tests.cxx.o  -o cmTC_09b15 -rdynamic 
make[1]: Leaving directory '/home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp'


    Feature record: CXX_FEATURE:1cxx_aggregate_default_initializers
    Feature record: CXX_FEATURE:1cxx_alias_templates
    Feature record: CXX_FEATURE:1cxx_alignas
    Feature record: CXX_FEATURE:1cxx_alignof
    Feature record: CXX_FEATURE:1cxx_attributes
    Feature record: CXX_FEATURE:1cxx_attribute_deprecated
    Feature record: CXX_FEATURE:1cxx_auto_type
    Feature record: CXX_FEATURE:1cxx_binary_literals
    Feature record: CXX_FEATURE:1cxx_constexpr
    Feature record: CXX_FEATURE:1cxx_contextual_conversions
    Feature record: CXX_FEATURE:1cxx_decltype
    Feature record: CXX_FEATURE:1cxx_decltype_auto
    Feature record: CXX_FEATURE:1cxx_decltype_incomplete_return_types
    Feature record: CXX_FEATURE:1cxx_default_function_template_args
    Feature record: CXX_FEATURE:1cxx_defaulted_functions
    Feature record: CXX_FEATURE:1cxx_defaulted_move_initializers
    Feature record: CXX_FEATURE:1cxx_delegating_constructors
    Feature record: CXX_FEATURE:1cxx_deleted_functions
    Feature record: CXX_FEATURE:1cxx_digit_separators
    Feature record: CXX_FEATURE:1cxx_enum_forward_declarations
    Feature record: CXX_FEATURE:1cxx_explicit_conversions
    Feature record: CXX_FEATURE:1cxx_extended_friend_declarations
    Feature record: CXX_FEATURE:1cxx_extern_templates
    Feature record: CXX_FEATURE:1cxx_final
    Feature record: CXX_FEATURE:1cxx_func_identifier
    Feature record: CXX_FEATURE:1cxx_generalized_initializers
    Feature record: CXX_FEATURE:1cxx_generic_lambdas
    Feature record: CXX_FEATURE:1cxx_inheriting_constructors
    Feature record: CXX_FEATURE:1cxx_inline_namespaces
    Feature record: CXX_FEATURE:1cxx_lambdas
    Feature record: CXX_FEATURE:1cxx_lambda_init_captures
    Feature record: CXX_FEATURE:1cxx_local_type_template_args
    Feature record: CXX_FEATURE:1cxx_long_long_type
    Feature record: CXX_FEATURE:1cxx_noexcept
    Feature record: CXX_FEATURE:1cxx_nonstatic_member_init
    Feature record: CXX_FEATURE:1cxx_nullptr
    Feature record: CXX_FEATURE:1cxx_override
    Feature record: CXX_FEATURE:1cxx_range_for
    Feature record: CXX_FEATURE:1cxx_raw_string_literals
    Feature record: CXX_FEATURE:1cxx_reference_qualified_functions
    Feature record: CXX_FEATURE:1cxx_relaxed_constexpr
    Feature record: CXX_FEATURE:1cxx_return_type_deduction
    Feature record: CXX_FEATURE:1cxx_right_angle_brackets
    Feature record: CXX_FEATURE:1cxx_rvalue_references
    Feature record: CXX_FEATURE:1cxx_sizeof_member
    Feature record: CXX_FEATURE:1cxx_static_assert
    Feature record: CXX_FEATURE:1cxx_strong_enums
    Feature record: CXX_FEATURE:1cxx_template_template_parameters
    Feature record: CXX_FEATURE:1cxx_thread_local
    Feature record: CXX_FEATURE:1cxx_trailing_return_types
    Feature record: CXX_FEATURE:1cxx_unicode_literals
    Feature record: CXX_FEATURE:1cxx_uniform_initialization
    Feature record: CXX_FEATURE:1cxx_unrestricted_unions
    Feature record: CXX_FEATURE:1cxx_user_literals
    Feature record: CXX_FEATURE:1cxx_variable_templates
    Feature record: CXX_FEATURE:1cxx_variadic_macros
    Feature record: CXX_FEATURE:1cxx_variadic_templates


Detecting CXX [-std=c++11] compiler features compiled with the following output:
Change Dir: /home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_f53f4/fast"
/usr/bin/make -f CMakeFiles/cmTC_f53f4.dir/build.make CMakeFiles/cmTC_f53f4.dir/build
make[1]: Entering directory '/home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_f53f4.dir/feature_tests.cxx.o
/usr/bin/g++-8     -std=c++11 -o CMakeFiles/cmTC_f53f4.dir/feature_tests.cxx.o -c /home/glgl-schemer/.emacs.d/ccls/CMakeFiles/feature_tests.cxx
Linking CXX executable cmTC_f53f4
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f53f4.dir/link.txt --verbose=1
/usr/bin/g++-8        CMakeFiles/cmTC_f53f4.dir/feature_tests.cxx.o  -o cmTC_f53f4 -rdynamic 
make[1]: Leaving directory '/home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp'


    Feature record: CXX_FEATURE:0cxx_aggregate_default_initializers
    Feature record: CXX_FEATURE:1cxx_alias_templates
    Feature record: CXX_FEATURE:1cxx_alignas
    Feature record: CXX_FEATURE:1cxx_alignof
    Feature record: CXX_FEATURE:1cxx_attributes
    Feature record: CXX_FEATURE:0cxx_attribute_deprecated
    Feature record: CXX_FEATURE:1cxx_auto_type
    Feature record: CXX_FEATURE:0cxx_binary_literals
    Feature record: CXX_FEATURE:1cxx_constexpr
    Feature record: CXX_FEATURE:0cxx_contextual_conversions
    Feature record: CXX_FEATURE:1cxx_decltype
    Feature record: CXX_FEATURE:0cxx_decltype_auto
    Feature record: CXX_FEATURE:1cxx_decltype_incomplete_return_types
    Feature record: CXX_FEATURE:1cxx_default_function_template_args
    Feature record: CXX_FEATURE:1cxx_defaulted_functions
    Feature record: CXX_FEATURE:1cxx_defaulted_move_initializers
    Feature record: CXX_FEATURE:1cxx_delegating_constructors
    Feature record: CXX_FEATURE:1cxx_deleted_functions
    Feature record: CXX_FEATURE:0cxx_digit_separators
    Feature record: CXX_FEATURE:1cxx_enum_forward_declarations
    Feature record: CXX_FEATURE:1cxx_explicit_conversions
    Feature record: CXX_FEATURE:1cxx_extended_friend_declarations
    Feature record: CXX_FEATURE:1cxx_extern_templates
    Feature record: CXX_FEATURE:1cxx_final
    Feature record: CXX_FEATURE:1cxx_func_identifier
    Feature record: CXX_FEATURE:1cxx_generalized_initializers
    Feature record: CXX_FEATURE:0cxx_generic_lambdas
    Feature record: CXX_FEATURE:1cxx_inheriting_constructors
    Feature record: CXX_FEATURE:1cxx_inline_namespaces
    Feature record: CXX_FEATURE:1cxx_lambdas
    Feature record: CXX_FEATURE:0cxx_lambda_init_captures
    Feature record: CXX_FEATURE:1cxx_local_type_template_args
    Feature record: CXX_FEATURE:1cxx_long_long_type
    Feature record: CXX_FEATURE:1cxx_noexcept
    Feature record: CXX_FEATURE:1cxx_nonstatic_member_init
    Feature record: CXX_FEATURE:1cxx_nullptr
    Feature record: CXX_FEATURE:1cxx_override
    Feature record: CXX_FEATURE:1cxx_range_for
    Feature record: CXX_FEATURE:1cxx_raw_string_literals
    Feature record: CXX_FEATURE:1cxx_reference_qualified_functions
    Feature record: CXX_FEATURE:0cxx_relaxed_constexpr
    Feature record: CXX_FEATURE:0cxx_return_type_deduction
    Feature record: CXX_FEATURE:1cxx_right_angle_brackets
    Feature record: CXX_FEATURE:1cxx_rvalue_references
    Feature record: CXX_FEATURE:1cxx_sizeof_member
    Feature record: CXX_FEATURE:1cxx_static_assert
    Feature record: CXX_FEATURE:1cxx_strong_enums
    Feature record: CXX_FEATURE:1cxx_template_template_parameters
    Feature record: CXX_FEATURE:1cxx_thread_local
    Feature record: CXX_FEATURE:1cxx_trailing_return_types
    Feature record: CXX_FEATURE:1cxx_unicode_literals
    Feature record: CXX_FEATURE:1cxx_uniform_initialization
    Feature record: CXX_FEATURE:1cxx_unrestricted_unions
    Feature record: CXX_FEATURE:1cxx_user_literals
    Feature record: CXX_FEATURE:0cxx_variable_templates
    Feature record: CXX_FEATURE:1cxx_variadic_macros
    Feature record: CXX_FEATURE:1cxx_variadic_templates


Detecting CXX [-std=c++98] compiler features compiled with the following output:
Change Dir: /home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_e1715/fast"
/usr/bin/make -f CMakeFiles/cmTC_e1715.dir/build.make CMakeFiles/cmTC_e1715.dir/build
make[1]: Entering directory '/home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_e1715.dir/feature_tests.cxx.o
/usr/bin/g++-8     -std=c++98 -o CMakeFiles/cmTC_e1715.dir/feature_tests.cxx.o -c /home/glgl-schemer/.emacs.d/ccls/CMakeFiles/feature_tests.cxx
Linking CXX executable cmTC_e1715
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e1715.dir/link.txt --verbose=1
/usr/bin/g++-8        CMakeFiles/cmTC_e1715.dir/feature_tests.cxx.o  -o cmTC_e1715 -rdynamic 
make[1]: Leaving directory '/home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp'


    Feature record: CXX_FEATURE:0cxx_aggregate_default_initializers
    Feature record: CXX_FEATURE:0cxx_alias_templates
    Feature record: CXX_FEATURE:0cxx_alignas
    Feature record: CXX_FEATURE:0cxx_alignof
    Feature record: CXX_FEATURE:0cxx_attributes
    Feature record: CXX_FEATURE:0cxx_attribute_deprecated
    Feature record: CXX_FEATURE:0cxx_auto_type
    Feature record: CXX_FEATURE:0cxx_binary_literals
    Feature record: CXX_FEATURE:0cxx_constexpr
    Feature record: CXX_FEATURE:0cxx_contextual_conversions
    Feature record: CXX_FEATURE:0cxx_decltype
    Feature record: CXX_FEATURE:0cxx_decltype_auto
    Feature record: CXX_FEATURE:0cxx_decltype_incomplete_return_types
    Feature record: CXX_FEATURE:0cxx_default_function_template_args
    Feature record: CXX_FEATURE:0cxx_defaulted_functions
    Feature record: CXX_FEATURE:0cxx_defaulted_move_initializers
    Feature record: CXX_FEATURE:0cxx_delegating_constructors
    Feature record: CXX_FEATURE:0cxx_deleted_functions
    Feature record: CXX_FEATURE:0cxx_digit_separators
    Feature record: CXX_FEATURE:0cxx_enum_forward_declarations
    Feature record: CXX_FEATURE:0cxx_explicit_conversions
    Feature record: CXX_FEATURE:0cxx_extended_friend_declarations
    Feature record: CXX_FEATURE:0cxx_extern_templates
    Feature record: CXX_FEATURE:0cxx_final
    Feature record: CXX_FEATURE:0cxx_func_identifier
    Feature record: CXX_FEATURE:0cxx_generalized_initializers
    Feature record: CXX_FEATURE:0cxx_generic_lambdas
    Feature record: CXX_FEATURE:0cxx_inheriting_constructors
    Feature record: CXX_FEATURE:0cxx_inline_namespaces
    Feature record: CXX_FEATURE:0cxx_lambdas
    Feature record: CXX_FEATURE:0cxx_lambda_init_captures
    Feature record: CXX_FEATURE:0cxx_local_type_template_args
    Feature record: CXX_FEATURE:0cxx_long_long_type
    Feature record: CXX_FEATURE:0cxx_noexcept
    Feature record: CXX_FEATURE:0cxx_nonstatic_member_init
    Feature record: CXX_FEATURE:0cxx_nullptr
    Feature record: CXX_FEATURE:0cxx_override
    Feature record: CXX_FEATURE:0cxx_range_for
    Feature record: CXX_FEATURE:0cxx_raw_string_literals
    Feature record: CXX_FEATURE:0cxx_reference_qualified_functions
    Feature record: CXX_FEATURE:0cxx_relaxed_constexpr
    Feature record: CXX_FEATURE:0cxx_return_type_deduction
    Feature record: CXX_FEATURE:0cxx_right_angle_brackets
    Feature record: CXX_FEATURE:0cxx_rvalue_references
    Feature record: CXX_FEATURE:0cxx_sizeof_member
    Feature record: CXX_FEATURE:0cxx_static_assert
    Feature record: CXX_FEATURE:0cxx_strong_enums
    Feature record: CXX_FEATURE:1cxx_template_template_parameters
    Feature record: CXX_FEATURE:0cxx_thread_local
    Feature record: CXX_FEATURE:0cxx_trailing_return_types
    Feature record: CXX_FEATURE:0cxx_unicode_literals
    Feature record: CXX_FEATURE:0cxx_uniform_initialization
    Feature record: CXX_FEATURE:0cxx_unrestricted_unions
    Feature record: CXX_FEATURE:0cxx_user_literals
    Feature record: CXX_FEATURE:0cxx_variable_templates
    Feature record: CXX_FEATURE:0cxx_variadic_macros
    Feature record: CXX_FEATURE:0cxx_variadic_templates
Determining if the include file pthread.h exists passed with the following output:
Change Dir: /home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_78f5e/fast"
/usr/bin/make -f CMakeFiles/cmTC_78f5e.dir/build.make CMakeFiles/cmTC_78f5e.dir/build
make[1]: Entering directory '/home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_78f5e.dir/CheckIncludeFile.cxx.o
/usr/bin/g++-8      -o CMakeFiles/cmTC_78f5e.dir/CheckIncludeFile.cxx.o -c /home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp/CheckIncludeFile.cxx
Linking CXX executable cmTC_78f5e
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_78f5e.dir/link.txt --verbose=1
/usr/bin/g++-8        CMakeFiles/cmTC_78f5e.dir/CheckIncludeFile.cxx.o  -o cmTC_78f5e -rdynamic 
make[1]: Leaving directory '/home/glgl-schemer/.emacs.d/ccls/CMakeFiles/CMakeTmp'

https://cmake.org/cmake/help/v3.8/prop_tgt/CXX_STANDARD.html

cmake 3.8起支援CXX_STANDARD C++17