mirror of
https://github.com/MaskRay/ccls.git
synced 2025-07-14 19:50:12 +00:00
Compare commits
363 Commits
master
...
0.20190314
Author | SHA1 | Date | |
---|---|---|---|
|
1976fec595 | ||
|
304f4d7f9e | ||
|
67fa377077 | ||
|
b8f9d2ca2c | ||
|
95360fe36a | ||
|
f8ad4c01fd | ||
|
86e4a6afb9 | ||
|
f8061e76cc | ||
|
5a0271ef68 | ||
|
6996e60c28 | ||
|
a81bb8d125 | ||
|
fe88679da1 | ||
|
a1cfff978f | ||
|
423c7c54cd | ||
|
f5dca57819 | ||
|
a89e82b517 | ||
|
b110decc1a | ||
|
4f66741f9c | ||
|
952b5d79fd | ||
|
3102c54742 | ||
|
0d92b72248 | ||
|
ea774dadf5 | ||
|
3f6ece0a44 | ||
|
6185d69d9d | ||
|
8724985388 | ||
|
233ed4f741 | ||
|
e4ba51aea3 | ||
|
f1efcb80c7 | ||
|
d4de474be1 | ||
|
9bc762961a | ||
|
b2fcec4b97 | ||
|
0dbf6c89f1 | ||
|
26fb0a9dd3 | ||
|
d6329ea328 | ||
|
87d7c40903 | ||
|
7b3aca2952 | ||
|
9a529bd691 | ||
|
e8cacf1efa | ||
|
cbd36aeedb | ||
|
828c21c8d7 | ||
|
f2df43055f | ||
|
573bfc27a1 | ||
|
8ca0978804 | ||
|
18e4be616c | ||
|
e0a6db8d9b | ||
|
fc38442967 | ||
|
37a9ad3f81 | ||
|
df7221affc | ||
|
6945a56fb8 | ||
|
259b9fefb3 | ||
|
d43b994557 | ||
|
04e80544b9 | ||
|
872d7c5de9 | ||
|
ab48663ca0 | ||
|
e5b4a404df | ||
|
a37782dc0c | ||
|
72ee893d26 | ||
|
5a5165faa8 | ||
|
5a723b489a | ||
|
e6510f7428 | ||
|
0606b95754 | ||
|
9ffbf3c52e | ||
|
eacbc1e1e7 | ||
|
7a363d2259 | ||
|
3bcb5f23a4 | ||
|
58e996366d | ||
|
f6fca76088 | ||
|
afa654f0d1 | ||
|
8c73bbc3c7 | ||
|
b31a1c6b3e | ||
|
06dff21720 | ||
|
6767b9bf24 | ||
|
77bec58a62 | ||
|
63a510ac21 | ||
|
a24fe5a386 | ||
|
5736dd094d | ||
|
eeeb03c068 | ||
|
94d2b5821e | ||
|
58c701d98a | ||
|
e0e00cb48a | ||
|
11ba6b64ff | ||
|
ac09b085ff | ||
|
18e5d5c498 | ||
|
42b6b7b3f0 | ||
|
334557e9fe | ||
|
90a94cbb4f | ||
|
26d76b75c7 | ||
|
5599ddd343 | ||
|
df20969788 | ||
|
ea1271a84e | ||
|
6e19a5964e | ||
|
1d67a40ce8 | ||
|
c0c7cfed8d | ||
|
16c2e0643b | ||
|
32a658ad24 | ||
|
283d887271 | ||
|
ce1c7ec76a | ||
|
119a05597d | ||
|
87ea7d244d | ||
|
cb7ed9415d | ||
|
fc1db06538 | ||
|
79352b451c | ||
|
4743124370 | ||
|
61b361320b | ||
|
f5816e3be3 | ||
|
51081c3cd2 | ||
|
c5ae521d36 | ||
|
ac2d921ab9 | ||
|
5a1ed4c943 | ||
|
de9c77e1cc | ||
|
10c1c28dd1 | ||
|
8c2170172d | ||
|
6ec032c2a0 | ||
|
38feb8d277 | ||
|
c7ee3d85f3 | ||
|
fc8a60c630 | ||
|
29f05d96fb | ||
|
8d49b44154 | ||
|
da07cb2da4 | ||
|
f2227cbaa2 | ||
|
84984c6c27 | ||
|
79373ba486 | ||
|
da704521b5 | ||
|
d4871207ed | ||
|
a127ca9b02 | ||
|
05109b6fa4 | ||
|
d6ad864f11 | ||
|
41fcc0272c | ||
|
0eb9428a32 | ||
|
eb644bb78e | ||
|
ce68028caf | ||
|
8f40c0c244 | ||
|
854225bd30 | ||
|
32f7d148ca | ||
|
71e9835b8c | ||
|
e320ce42ab | ||
|
22daed7001 | ||
|
7eb58bb5e1 | ||
|
6ea399559d | ||
|
28d33324b1 | ||
|
1a519163da | ||
|
4d76108d6b | ||
|
41756297ef | ||
|
f9bd84a975 | ||
|
f515b4b466 | ||
|
08645d64c1 | ||
|
525b6da1ac | ||
|
763106c3d4 | ||
|
14b73f0d6f | ||
|
a18977b9fc | ||
|
34c1ebcefd | ||
|
56c6ec43df | ||
|
70deeca8ad | ||
|
a174105abe | ||
|
1969731781 | ||
|
6bca153ee3 | ||
|
e2f29d7b1b | ||
|
c7a6c5cd12 | ||
|
a607dcec24 | ||
|
a45686ae1b | ||
|
c9e6b31dd0 | ||
|
a7c1633b51 | ||
|
c202dd3775 | ||
|
92ee7f3e0f | ||
|
da982a6506 | ||
|
58191fd335 | ||
|
82d31a2012 | ||
|
e20a8e7a1b | ||
|
8b3ebf234b | ||
|
b77fba6ea8 | ||
|
56da577df9 | ||
|
0a51424c5c | ||
|
e92378df9c | ||
|
aebf2dfaed | ||
|
a33f4df404 | ||
|
145630ba1a | ||
|
11e92d52a8 | ||
|
407c7cc29d | ||
|
5cc3006a3a | ||
|
1ae97c64ed | ||
|
74790e2421 | ||
|
87c5491536 | ||
|
f808dd8f8a | ||
|
bd3e06796e | ||
|
caddc18860 | ||
|
48c92c05a1 | ||
|
ec2b893ee4 | ||
|
f3490a3e6c | ||
|
66b027910a | ||
|
431eef2167 | ||
|
2f5fcadc39 | ||
|
06aa252335 | ||
|
8cbb317dc2 | ||
|
344ade0420 | ||
|
b9e1c2ee07 | ||
|
3931951406 | ||
|
b5c2a48bb0 | ||
|
924fedbb02 | ||
|
b4aa0705a1 | ||
|
0bb311ac56 | ||
|
c71047189f | ||
|
b95b47540d | ||
|
122eda1c53 | ||
|
03aa024fe6 | ||
|
ff102c9b7e | ||
|
8b4a8d2d48 | ||
|
e67ea3af87 | ||
|
27d641bf64 | ||
|
19fa911908 | ||
|
46d397f4b3 | ||
|
0732d37817 | ||
|
af54645e5e | ||
|
73ac788f9e | ||
|
344f00fbb2 | ||
|
8912b00381 | ||
|
814f054e6e | ||
|
dd05ad9f65 | ||
|
eea1b92825 | ||
|
df72a9eb72 | ||
|
5dcccea285 | ||
|
4612aa062b | ||
|
d604fc38dc | ||
|
0780e80f8a | ||
|
39d4bbfe67 | ||
|
3737d4c60f | ||
|
0c50ee79f2 | ||
|
c04d0620c0 | ||
|
7c1ff07dc9 | ||
|
7d1d4b410b | ||
|
0a304096df | ||
|
c6553c79ab | ||
|
ed1b221fab | ||
|
eb8acf9cdb | ||
|
cc65ea94ed | ||
|
df02c29a7d | ||
|
2196e17222 | ||
|
7dd0241a4c | ||
|
775c72b0e6 | ||
|
f81454b9ec | ||
|
6a8837d612 | ||
|
0df5a2cd66 | ||
|
8a9640a56b | ||
|
207e79ea98 | ||
|
559a68a261 | ||
|
c5dc759831 | ||
|
6a1902aeb6 | ||
|
e5d8153d4b | ||
|
c8a81aeae3 | ||
|
134126629a | ||
|
0decb01a0f | ||
|
7b1ff448b9 | ||
|
66580104ba | ||
|
a36e548e03 | ||
|
39a17a9fd7 | ||
|
ec00f854a0 | ||
|
b35d3c8fa8 | ||
|
23c9c3a061 | ||
|
c9f0b65062 | ||
|
8fabe3d1ae | ||
|
07f0cdbf38 | ||
|
32bde07df6 | ||
|
4e2f64893c | ||
|
ba45e7ca63 | ||
|
19d0aad2ca | ||
|
576959e460 | ||
|
f145c4422f | ||
|
d3a36a4ae6 | ||
|
87dcb8ffb2 | ||
|
224ba97f27 | ||
|
99e7c56956 | ||
|
bac704f17b | ||
|
72433643bf | ||
|
b55819a8a1 | ||
|
04a848e065 | ||
|
a4a07120a1 | ||
|
984c6367d1 | ||
|
86efddf032 | ||
|
ccb5cba720 | ||
|
d337d9bff7 | ||
|
fac5c56682 | ||
|
01f1064576 | ||
|
d821ac34d8 | ||
|
b4cca890c6 | ||
|
fa9df5bcef | ||
|
4d519dcbcb | ||
|
2c4d387222 | ||
|
f8752cdca0 | ||
|
d45c057dd4 | ||
|
a7c89fbe21 | ||
|
fa4b8c78c1 | ||
|
236e7c1393 | ||
|
97b1592475 | ||
|
2a06fb55dd | ||
|
75638b5387 | ||
|
8d19e0a4f1 | ||
|
6e68e9edbd | ||
|
992b3cce16 | ||
|
98a4ef5288 | ||
|
348240b44f | ||
|
9f9420519e | ||
|
1dc55843e7 | ||
|
d9bcaecf25 | ||
|
c0b4d69268 | ||
|
78250bde34 | ||
|
d8fbc752d0 | ||
|
46fc3b8323 | ||
|
d83be5adcc | ||
|
9aca6119ed | ||
|
233e377137 | ||
|
6c8fee4141 | ||
|
f8a816d110 | ||
|
89dd4b066b | ||
|
da649891ae | ||
|
512cd8cbd3 | ||
|
2f0b9ccfdc | ||
|
7e80959ce1 | ||
|
5ef55f993f | ||
|
975c5646a4 | ||
|
5f8418cd9b | ||
|
410fb69e25 | ||
|
59769df8b5 | ||
|
401d542ba7 | ||
|
9c729e1937 | ||
|
33bd27b913 | ||
|
4270b4fdef | ||
|
a566167db6 | ||
|
ddc318eef3 | ||
|
d87afce1fc | ||
|
e235dbedfe | ||
|
7ff4a9aac9 | ||
|
cad6dcda0c | ||
|
5f085729bd | ||
|
bdabb7596c | ||
|
7e6965afe3 | ||
|
1afb6c3988 | ||
|
958422e77f | ||
|
f17196e3da | ||
|
f137ec6a6d | ||
|
07b3208cb4 | ||
|
c6ea1f1946 | ||
|
7c1155392a | ||
|
c7e5299bee | ||
|
3f5e34ef20 | ||
|
6d42b40319 | ||
|
0dbe8a9171 | ||
|
b272fc427c | ||
|
b5bd29b702 | ||
|
0365e447f0 | ||
|
a3f66468ab | ||
|
fb795d02f9 | ||
|
0b087421a7 | ||
|
b9c3af0be9 | ||
|
4d23e9fa10 | ||
|
1e019f4984 | ||
|
639f587e01 | ||
|
42b47ae77b | ||
|
9ad268af29 | ||
|
55bfe58fea | ||
|
1882bd0256 | ||
|
38f7195280 | ||
|
1d6c718bae | ||
|
4e8d21e306 | ||
|
552658f967 |
@ -1,49 +1,22 @@
|
||||
version: "{build}"
|
||||
image: Visual Studio 2017
|
||||
platform: x64
|
||||
|
||||
clone_folder: C:\projects\cquery
|
||||
os: Visual Studio 2017
|
||||
|
||||
platform:
|
||||
- x64
|
||||
|
||||
build:
|
||||
parallel: true # enable MSBuild parallel builds
|
||||
verbosity: minimal
|
||||
|
||||
install:
|
||||
- git submodule update --init
|
||||
|
||||
environment:
|
||||
CLICOLOR_FORCE: 1
|
||||
matrix:
|
||||
- MSYSTEM: MINGW64
|
||||
- MSYSTEM: MSVC
|
||||
|
||||
matrix:
|
||||
fast_finish: true # set this flag to immediately finish build once one of the jobs fails.
|
||||
allow_failures:
|
||||
- platform: x64
|
||||
|
||||
- if not exist llvm.tar.xz appveyor DownloadFile "https://ziglang.org/deps/llvm+clang-7.0.0-win64-msvc-release.tar.xz" -FileName llvm.tar.xz
|
||||
- 7z e -txz llvm.tar.xz
|
||||
- 7z x llvm.tar
|
||||
- git submodule update --init --recursive
|
||||
build_script:
|
||||
- ps: |
|
||||
If ($Env:MSYSTEM -Eq "MSVC") {
|
||||
$dir = "cquery-${env:appveyor_build_version}-win64"
|
||||
cd C:\projects\cquery
|
||||
python waf configure --msvc_version="msvc 15.0"
|
||||
python waf build
|
||||
mkdir "${dir}\build\release\bin" -ea 0
|
||||
mkdir "${dir}\build\release\lib\LLVM-6.0.0-win64\lib\clang\6.0.0\"
|
||||
copy "build\release\bin\*" "${dir}\build\release\bin"
|
||||
copy -recurse "build\LLVM-6.0.0-win64\lib\clang\6.0.0\include" "${dir}\build\release\lib\LLVM-6.0.0-win64\lib\clang\6.0.0\"
|
||||
7z a -tzip "C:\projects\cquery\${dir}.zip" "${dir}"
|
||||
} Else {
|
||||
C:\msys64\usr\bin\bash -lc @'
|
||||
pacman -S --needed --noconfirm mingw-w64-x86_64-clang python
|
||||
cd /c/projects/cquery
|
||||
CXXFLAGS=-Wall /usr/bin/python waf configure build --llvm-config llvm-config 2>&1
|
||||
'@
|
||||
}
|
||||
- set PATH=%PATH%;C:\msys64\%MSYSTEM%\bin
|
||||
- build\release\bin\cquery --ci --log-all-to-stderr --test-unit
|
||||
- IF "%MSYSTEM%"=="MSVC" build\release\bin\cquery --ci --log-all-to-stderr --test-index
|
||||
- cmake -G"Visual Studio 15 2017 Win64" -H. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=C:\projects\ccls\llvm+clang-7.0.0-win64-msvc-release
|
||||
- cmake --build build --target ccls --config Release
|
||||
|
||||
artifacts:
|
||||
- path: 'cquery-*.zip'
|
||||
|
||||
cache:
|
||||
- C:\projects\cquery\build\LLVM-6.0.0-win64.exe
|
||||
- C:\projects\cquery\build\LLVM-6.0.0-win64\
|
||||
- path: build\Release
|
||||
|
@ -1 +1 @@
|
||||
BasedOnStyle: Chromium
|
||||
BasedOnStyle: LLVM
|
||||
|
@ -1,6 +0,0 @@
|
||||
-std=c++11
|
||||
-Ithird_party/rapidjson/include
|
||||
-IC:/Program Files/LLVM/include
|
||||
-std=c++11
|
||||
-fms-compatibility
|
||||
-fdelayed-template-parsing
|
7
.gitattributes
vendored
7
.gitattributes
vendored
@ -1,7 +0,0 @@
|
||||
# By default, use platform specific endings.
|
||||
*.h text eol=auto
|
||||
*.cpp text eol=auto
|
||||
*.cc text eol=auto
|
||||
|
||||
# Tests must always be crlf
|
||||
index_tests/** text eol=crlf
|
36
.github/ISSUE_TEMPLATE
vendored
Normal file
36
.github/ISSUE_TEMPLATE
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
Here are some things you should try before filing a bug report:
|
||||
|
||||
+ For client issues related to [emacs-ccls](https://github.com/MaskRay/emacs-ccls) or [vscode-ccls](https://github.com/MaskRay/vscode-ccls), report in their own repository.
|
||||
+ For build problems, check https://github.com/MaskRay/ccls/wiki/Build
|
||||
+ Check https://github.com/MaskRay/ccls/wiki/Debugging
|
||||
+ Check [the FAQ](https://github.com/MaskRay/ccls/wiki/FAQ) to see if your issue is mentioned.
|
||||
|
||||
If none of those help, remove this section and fill out the four sections in the template below.
|
||||
|
||||
---
|
||||
|
||||
### Observed behavior
|
||||
|
||||
Describe what happened. Any aids you can include (that you think could be relevant) are a tremendous help.
|
||||
|
||||
* `compile_commands.json` or `.ccls` ([wiki/Project-Setup](https://github.com/MaskRay/ccls/wiki/Project-Setup))
|
||||
* Reduce to A minimal set of `.c` `.cc` `.h` `.hh` files that can still demonstrate the issue.
|
||||
* Consider a screencast gif.
|
||||
|
||||
### Expected behavior
|
||||
|
||||
Describe what you expected to happen.
|
||||
|
||||
### Steps to reproduce
|
||||
|
||||
1. Select these example steps,
|
||||
2. Delete them,
|
||||
3. And replace them with precise steps to reproduce your issue.
|
||||
|
||||
### System information
|
||||
|
||||
* ccls version (`git describe --tags --long`):
|
||||
* clang version:
|
||||
* OS:
|
||||
* Editor:
|
||||
* Language client (and version):
|
30
.gitignore
vendored
30
.gitignore
vendored
@ -1,26 +1,6 @@
|
||||
.cquery_cached_index
|
||||
.DS_Store
|
||||
.lock-waf*
|
||||
.vs
|
||||
.vscode/
|
||||
.vscode/.ropeproject
|
||||
.waf*
|
||||
*.cquery
|
||||
*.sln
|
||||
*.swp
|
||||
*.vcxproj
|
||||
*.vcxproj.filters
|
||||
*.vcxproj.user
|
||||
**/*.pyc
|
||||
.*
|
||||
build
|
||||
cquery_diagnostics.log
|
||||
cquery_log.txt
|
||||
Debug
|
||||
e2e_cache
|
||||
foo
|
||||
libcxx
|
||||
vscode-extension.vsix
|
||||
waf-*
|
||||
waf2*
|
||||
waf3*
|
||||
x64
|
||||
debug
|
||||
release
|
||||
/compile_commands.json
|
||||
!.github/
|
||||
|
14
.gitmodules
vendored
14
.gitmodules
vendored
@ -1,15 +1,3 @@
|
||||
[submodule "third_party/rapidjson"]
|
||||
path = third_party/rapidjson
|
||||
url = https://github.com/miloyip/rapidjson
|
||||
[submodule "third_party/doctest"]
|
||||
path = third_party/doctest
|
||||
url = https://github.com/onqtam/doctest
|
||||
[submodule "third_party/sparsepp"]
|
||||
path = third_party/sparsepp
|
||||
url = https://github.com/greg7mdp/sparsepp
|
||||
[submodule "third_party/loguru"]
|
||||
path = third_party/loguru
|
||||
url = https://github.com/emilk/loguru
|
||||
[submodule "third_party/msgpack-c"]
|
||||
path = third_party/msgpack-c
|
||||
url = https://github.com/msgpack/msgpack-c
|
||||
url = https://github.com/Tencent/rapidjson
|
||||
|
166
.travis.yml
166
.travis.yml
@ -1,166 +0,0 @@
|
||||
dist: trusty
|
||||
sudo: false
|
||||
language: c++
|
||||
|
||||
env:
|
||||
global:
|
||||
- COMPILER=g++
|
||||
|
||||
# Default --recursive (rapidjson/thirdparty/gtest) is unnecessary
|
||||
git:
|
||||
submodules: false
|
||||
depth: 1
|
||||
|
||||
before_install:
|
||||
- git submodule update --init
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources: &apt_sources
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.5
|
||||
- llvm-toolchain-trusty-5.0
|
||||
|
||||
compiler: clang
|
||||
os: linux
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- build/clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-14.04/
|
||||
- build/clang+llvm-6.0.0-x86_64-apple-darwin/
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
- env: COMPILER=g++-5
|
||||
compiler: gcc
|
||||
addons: &gcc5
|
||||
apt:
|
||||
packages: ["g++-5"]
|
||||
sources: *apt_sources
|
||||
|
||||
- env: COMPILER=g++-7
|
||||
compiler: gcc
|
||||
addons: &gcc7
|
||||
apt:
|
||||
packages: ["g++-7"]
|
||||
sources: *apt_sources
|
||||
|
||||
- env: COMPILER=clang++-3.5
|
||||
addons: &clang35
|
||||
apt:
|
||||
packages: ["clang-3.5", "g++-7"]
|
||||
sources: *apt_sources
|
||||
|
||||
- env: COMPILER=clang++-5.0
|
||||
addons: &clang50
|
||||
apt:
|
||||
packages: ["clang-5.0", "g++-7"]
|
||||
sources: *apt_sources
|
||||
|
||||
- env: COMPILER=clang++
|
||||
osx_image: xcode9.1
|
||||
os: osx
|
||||
|
||||
- env: COMPILER=g++-7
|
||||
compiler: gcc
|
||||
osx_image: xcode9.1
|
||||
os: osx
|
||||
|
||||
|
||||
allow_failures:
|
||||
|
||||
# macOS takes too long.
|
||||
|
||||
#- env: COMPILER=clang++
|
||||
# osx_image: xcode9.1
|
||||
# os: osx
|
||||
|
||||
#- env: COMPILER=g++-7
|
||||
# compiler: gcc
|
||||
# osx_image: xcode9.1
|
||||
# os: osx
|
||||
|
||||
# gcc builds that should be fixed at some point
|
||||
|
||||
#- env: COMPILER=g++-5
|
||||
# compiler: gcc
|
||||
|
||||
#- env: COMPILER=g++-6
|
||||
# compiler: gcc
|
||||
|
||||
#- env: COMPILER=g++-7
|
||||
# compiler: gcc
|
||||
|
||||
#- env: COMPILER=g++-5
|
||||
# compiler: gcc
|
||||
# osx_image: xcode9.1
|
||||
# os: osx
|
||||
|
||||
#- env: COMPILER=g++-6
|
||||
# compiler: gcc
|
||||
# osx_image: xcode9.1
|
||||
# os: osx
|
||||
|
||||
#- env: COMPILER=g++-7
|
||||
# compiler: gcc
|
||||
# osx_image: xcode9.1
|
||||
# os: osx
|
||||
|
||||
install:
|
||||
- |
|
||||
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
|
||||
if [[ "${COMPILER}" == "g++-5" ]]; then
|
||||
brew install gcc@5
|
||||
brew link --overwrite gcc@5
|
||||
fi
|
||||
if [[ "${COMPILER}" == "g++-6" ]]; then
|
||||
brew install gcc@6
|
||||
brew link --overwrite gcc@6
|
||||
fi
|
||||
if [[ "${COMPILER}" == "g++-7" ]]; then
|
||||
brew install gcc@7
|
||||
brew link --overwrite gcc@7
|
||||
fi
|
||||
fi
|
||||
|
||||
- |
|
||||
if [[ "${COMPILER}" == g++* ]]; then
|
||||
export J="-j1"
|
||||
fi
|
||||
|
||||
- export CXX="${COMPILER}"
|
||||
|
||||
before_script:
|
||||
- ${CXX} --version
|
||||
|
||||
script:
|
||||
- travis_retry ./waf configure
|
||||
- ./waf build ${J}
|
||||
- ./build/release/bin/cquery --ci --log-all-to-stderr --test-unit
|
||||
- ./build/release/bin/cquery --ci --log-all-to-stderr --test-index
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
irc:
|
||||
channels:
|
||||
- "ircs://chat.freenode.net:6697/#cquery"
|
||||
template:
|
||||
- "[ %{repository_slug}#%{commit}] %{result} on %{branch} by %{author} (%{build_url} )"
|
||||
|
||||
before_deploy:
|
||||
#- zip -r build/cquery-$TRAVIS_TAG-$TRAVIS_OS_NAME.zip build/release/bin/ build/release/lib/clang+llvm-*/lib/libclang.* build/release/lib/clang+llvm-*/lib/clang/5.0.1/include/
|
||||
- ci/before_deploy.sh
|
||||
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key:
|
||||
secure: Ahv4Wp1wveWILqp6HB8UmsXwwfZ103fuJV/u6W4oJFRpnbIXRCGFKaDR1Ql0hsHduKFd/76nNQGSVvNNuTXlWaK2n0bTu1EZ4VYmXk7Q7gn4ROP9XFrIZu0c9XKJ/bzehCLj3t6KT0R5MK5gQe+cBmx4S5uGsGG5/nM+GZpE1N4craRCh64UNXMvIx20sW4VQcgj1Ccrc/6Skb3HET7PKbY+IB/LXnaF3nM6V71LxKW2wlakBmzzaNatQ46QOcOCduY4edE8FqBs7yZ0eFktNZusmjiaZT12t0r1hVe0O8e0ER3u9/c3t+hbPUplMR2FAPBZXojgLVhSfFtBaj45T74oCIi0eUaDeS+Oxl6IzgyVho9RurOtaru3hLOVoaD9wR6lGhj6Nz/2Na3lOIorxHfAZ4OgUmluoFLCynO4ylMD03fMBGBshChnmYbrxLw0xLZP2005WUAj8JN64QOmFmLt3gV7TfVldSFHuwoZyESfkXPRM1Xn8RtgFi/89p4jtPtyBFLSaeDggCwfWEMfADCfJ/j8lXtAPdyEINoaKrxkH8qCPoMLNPXE7JhkP8L0Smdq4cFUEXg3wKWM2hXmWmh2Y25BAyh4qu9CrDPd5qqFcXMtyix4ZjmThLFs/oKYbbMUo4FQ5xT5dpt/VZOi4NpcAj0G/M3jWhu85tMdtTc=
|
||||
#file: build/cquery-$TRAVIS_TAG-$TRAVIS_OS_NAME.zip
|
||||
file: build/cquery-$TRAVIS_TAG-x86_64-apple-darwin.tar.xz
|
||||
file: build/cquery-$TRAVIS_TAG-x86_64-unknown-linux-gnu.tar.xz
|
||||
skip_cleanup: true
|
||||
on:
|
||||
repo: cquery-project/cquery
|
||||
tags: true
|
||||
|
@ -1,15 +0,0 @@
|
||||
def FlagsForFile( filename, **kwargs ):
|
||||
return {
|
||||
'flags': [
|
||||
'-xc++',
|
||||
'-std=c++11',
|
||||
'-DLOGURU_WITH_STREAMS=1',
|
||||
'-Isrc/',
|
||||
'-Ithird_party/',
|
||||
'-Ithird_party/doctest',
|
||||
'-Ithird_party/rapidjson/include',
|
||||
'-Ithird_party/sparsepp',
|
||||
'-Ithird_party/loguru',
|
||||
'-Ibuild/clang+llvm-4.0.0-x86_64-linux-gnu-ubuntu-14.04/include'
|
||||
]
|
||||
}
|
228
CMakeLists.txt
Normal file
228
CMakeLists.txt
Normal file
@ -0,0 +1,228 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
project(ccls LANGUAGES CXX)
|
||||
|
||||
option(USE_SYSTEM_RAPIDJSON "Use system RapidJSON instead of the git submodule if exists" ON)
|
||||
|
||||
# Sources for the executable are specified at end of CMakeLists.txt
|
||||
add_executable(ccls "")
|
||||
|
||||
### Default build type
|
||||
|
||||
set(DEFAULT_CMAKE_BUILD_TYPE Release)
|
||||
|
||||
# CMAKE_BUILD_TYPE is not available if a multi-configuration generator is used
|
||||
# (eg Visual Studio generators)
|
||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
message(STATUS "Setting build type to '${DEFAULT_CMAKE_BUILD_TYPE}' as none \
|
||||
was specified.")
|
||||
set(CMAKE_BUILD_TYPE ${DEFAULT_CMAKE_BUILD_TYPE}
|
||||
CACHE STRING "Choose the type of build." FORCE)
|
||||
|
||||
# Set the possible values of build type for cmake-gui
|
||||
set_property(CACHE CMAKE_BUILD_TYPE
|
||||
PROPERTY STRINGS Debug Release MinSizeRel RelWithDebInfo)
|
||||
endif()
|
||||
|
||||
### Compile options
|
||||
|
||||
# Enable C++17 (Required)
|
||||
set_property(TARGET ccls PROPERTY CXX_STANDARD 17)
|
||||
set_property(TARGET ccls PROPERTY CXX_STANDARD_REQUIRED ON)
|
||||
set_property(TARGET ccls PROPERTY CXX_EXTENSIONS OFF)
|
||||
|
||||
# CMake sets MSVC for both MSVC and Clang(Windows)
|
||||
if(MSVC)
|
||||
# Common MSVC/Clang(Windows) options
|
||||
target_compile_options(ccls PRIVATE
|
||||
/nologo
|
||||
/EHsc
|
||||
/D_CRT_SECURE_NO_WARNINGS # don't try to use MSVC std replacements
|
||||
/W3 # roughly -Wall
|
||||
/wd4996 # ignore deprecated declaration
|
||||
/wd4267 # ignores warning C4267
|
||||
# (conversion from 'size_t' to 'type'),
|
||||
# roughly -Wno-sign-compare
|
||||
/wd4800
|
||||
/wd4068 # Disable unknown pragma warning
|
||||
/std:c++17
|
||||
$<$<CONFIG:Debug>:/FS>
|
||||
)
|
||||
# relink system libs
|
||||
target_link_libraries(ccls PRIVATE Mincore.lib)
|
||||
else()
|
||||
# Common GCC/Clang(Linux) options
|
||||
target_compile_options(ccls PRIVATE
|
||||
-Wall
|
||||
-Wno-sign-compare
|
||||
)
|
||||
|
||||
if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
|
||||
target_compile_options(ccls PRIVATE -Wno-return-type -Wno-unused-result)
|
||||
endif()
|
||||
|
||||
if(${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
|
||||
target_compile_options(ccls PRIVATE
|
||||
$<$<CONFIG:Debug>:-fno-limit-debug-info>)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
### Libraries
|
||||
|
||||
find_package(Clang REQUIRED)
|
||||
|
||||
target_link_libraries(ccls PRIVATE
|
||||
clangIndex
|
||||
clangFormat
|
||||
clangTooling
|
||||
clangToolingInclusions
|
||||
clangToolingCore
|
||||
clangFrontend
|
||||
clangParse
|
||||
clangSerialization
|
||||
clangSema
|
||||
clangAST
|
||||
clangLex
|
||||
clangDriver
|
||||
clangBasic
|
||||
)
|
||||
|
||||
if(LLVM_LINK_LLVM_DYLIB)
|
||||
target_link_libraries(ccls PRIVATE LLVM)
|
||||
else()
|
||||
# In llvm 7, clangDriver headers reference LLVMOption
|
||||
target_link_libraries(ccls PRIVATE LLVMOption LLVMSupport)
|
||||
endif()
|
||||
|
||||
if(NOT LLVM_ENABLE_RTTI)
|
||||
# releases.llvm.org libraries are compiled with -fno-rtti
|
||||
# The mismatch between lib{clang,LLVM}* and ccls can make libstdc++ std::make_shared return nullptr
|
||||
# _Sp_counted_ptr_inplace::_M_get_deleter
|
||||
if(MSVC)
|
||||
target_compile_options(ccls PRIVATE /GR-)
|
||||
else()
|
||||
target_compile_options(ccls PRIVATE -fno-rtti)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Enable threading support
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(ccls PRIVATE Threads::Threads)
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL FreeBSD)
|
||||
find_package(Backtrace REQUIRED)
|
||||
target_link_libraries(ccls PRIVATE ${Backtrace_LIBRARIES})
|
||||
# src/platform_posix.cc uses libthr
|
||||
target_link_libraries(ccls PRIVATE thr)
|
||||
endif()
|
||||
|
||||
### Definitions
|
||||
|
||||
# Find Clang resource directory with Clang executable.
|
||||
|
||||
find_program(CLANG_EXECUTABLE clang)
|
||||
if(NOT CLANG_EXECUTABLE)
|
||||
message(FATAL_ERROR "clang executable not found.")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${CLANG_EXECUTABLE} -print-resource-dir
|
||||
RESULT_VARIABLE CLANG_FIND_RESOURCE_DIR_RESULT
|
||||
OUTPUT_VARIABLE CLANG_RESOURCE_DIR
|
||||
ERROR_VARIABLE CLANG_FIND_RESOURCE_DIR_ERROR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
if(CLANG_FIND_RESOURCE_DIR_RESULT)
|
||||
message(FATAL_ERROR "Error retrieving Clang resource directory with Clang \
|
||||
executable. Output:\n ${CLANG_FIND_RESOURCE_DIR_ERROR}")
|
||||
endif()
|
||||
|
||||
set_property(SOURCE src/utils.cc APPEND PROPERTY COMPILE_DEFINITIONS
|
||||
CLANG_RESOURCE_DIRECTORY=R"\(${CLANG_RESOURCE_DIR}\)")
|
||||
|
||||
### Includes
|
||||
|
||||
target_include_directories(ccls PRIVATE src)
|
||||
target_include_directories(ccls SYSTEM PRIVATE
|
||||
third_party ${LLVM_INCLUDE_DIRS} ${CLANG_INCLUDE_DIRS})
|
||||
|
||||
if(USE_SYSTEM_RAPIDJSON)
|
||||
find_package(RapidJSON QUIET)
|
||||
endif()
|
||||
if(NOT RapidJSON_FOUND)
|
||||
set(RapidJSON_INCLUDE_DIRS third_party/rapidjson/include)
|
||||
endif()
|
||||
target_include_directories(ccls SYSTEM PRIVATE ${RapidJSON_INCLUDE_DIRS})
|
||||
|
||||
### Install
|
||||
|
||||
install(TARGETS ccls RUNTIME DESTINATION bin)
|
||||
|
||||
### Sources
|
||||
|
||||
target_sources(ccls PRIVATE third_party/siphash.cc)
|
||||
|
||||
target_sources(ccls PRIVATE
|
||||
src/clang_tu.cc
|
||||
src/config.cc
|
||||
src/filesystem.cc
|
||||
src/fuzzy_match.cc
|
||||
src/main.cc
|
||||
src/include_complete.cc
|
||||
src/indexer.cc
|
||||
src/log.cc
|
||||
src/lsp.cc
|
||||
src/message_handler.cc
|
||||
src/pipeline.cc
|
||||
src/platform_posix.cc
|
||||
src/platform_win.cc
|
||||
src/position.cc
|
||||
src/project.cc
|
||||
src/query.cc
|
||||
src/sema_manager.cc
|
||||
src/serializer.cc
|
||||
src/test.cc
|
||||
src/utils.cc
|
||||
src/working_files.cc
|
||||
)
|
||||
|
||||
target_sources(ccls PRIVATE
|
||||
src/messages/ccls_call.cc
|
||||
src/messages/ccls_info.cc
|
||||
src/messages/ccls_inheritance.cc
|
||||
src/messages/ccls_member.cc
|
||||
src/messages/ccls_navigate.cc
|
||||
src/messages/ccls_reload.cc
|
||||
src/messages/ccls_vars.cc
|
||||
src/messages/initialize.cc
|
||||
src/messages/textDocument_code.cc
|
||||
src/messages/textDocument_completion.cc
|
||||
src/messages/textDocument_definition.cc
|
||||
src/messages/textDocument_did.cc
|
||||
src/messages/textDocument_foldingRange.cc
|
||||
src/messages/textDocument_formatting.cc
|
||||
src/messages/textDocument_document.cc
|
||||
src/messages/textDocument_hover.cc
|
||||
src/messages/textDocument_references.cc
|
||||
src/messages/textDocument_rename.cc
|
||||
src/messages/textDocument_signatureHelp.cc
|
||||
src/messages/workspace.cc
|
||||
)
|
||||
|
||||
### Obtain CCLS version information from Git
|
||||
### This only happens when cmake is re-run!
|
||||
|
||||
if(NOT CCLS_VERSION)
|
||||
execute_process(COMMAND git describe --tag --long HEAD
|
||||
OUTPUT_VARIABLE CCLS_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
|
||||
|
||||
if(NOT CCLS_VERSION)
|
||||
set(CCLS_VERSION "<unknown>")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_property(SOURCE src/main.cc APPEND PROPERTY
|
||||
COMPILE_DEFINITIONS CCLS_VERSION=\"${CCLS_VERSION}\")
|
201
LICENSE
Normal file
201
LICENSE
Normal file
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
70
README.md
70
README.md
@ -1,42 +1,46 @@
|
||||
# cquery
|
||||
# ccls
|
||||
|
||||
[](https://gitter.im/cquery-project/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](https://telegram.me/cclsp)
|
||||
[](https://gitter.im/ccls-project/ccls)
|
||||
|
||||
cquery is a highly-scalable, low-latency language server for C/C++/Objective-C. It is tested
|
||||
and designed for large code bases like
|
||||
[Chromium](https://chromium.googlesource.com/chromium/src/). cquery provides
|
||||
accurate and fast semantic analysis without interrupting workflow.
|
||||
|
||||

|
||||
|
||||
cquery implements almost the entire language server protocol and provides
|
||||
some extra features to boot:
|
||||
ccls, which originates from [cquery](https://github.com/cquery-project/cquery), is a C/C++/Objective-C language server.
|
||||
|
||||
* code completion (with both signature help and snippets)
|
||||
* finding definition/references
|
||||
* type hierarchy (parent type, derived types, expandable tree view)
|
||||
* finding base/derived methods/classes, call tree
|
||||
* symbol rename
|
||||
* document and global symbol search
|
||||
* hover tooltips showing symbol type
|
||||
* diagnostics
|
||||
* code actions (clang FixIts)
|
||||
* darken/fade code disabled by preprocessor
|
||||
* #include auto-complete, undefined type include insertion, include quick-jump
|
||||
(goto definition, document links)
|
||||
* auto-implement functions without a definition
|
||||
* semantic highlighting, including support for [rainbow semantic highlighting](https://medium.com/@evnbr/coding-in-color-3a6db2743a1e)
|
||||
* [definition](src/messages/textDocument_definition.cc)/[references](src/messages/textDocument_references.cc), and other cross references
|
||||
* cross reference extensions: `$ccls/call` `$ccls/inheritance` `$ccls/member` `$ccls/vars` ...
|
||||
* formatting
|
||||
* hierarchies: [call (caller/callee) hierarchy](src/messages/ccls_call.cc), [inheritance (base/derived) hierarchy](src/messages/ccls_inheritance.cc), [member hierarchy](src/messages/ccls_member.cc)
|
||||
* [symbol rename](src/messages/textDocument_rename.cc)
|
||||
* [document symbols](src/messages/textDocument_documentSymbol.cc) and approximate search of [workspace symbol](src/messages/workspace_symbol.cc)
|
||||
* [hover information](src/messages/textDocument_hover.cc)
|
||||
* diagnostics and code actions (clang FixIts)
|
||||
* semantic highlighting and preprocessor skipped regions
|
||||
* semantic navigation: `$ccls/navigate`
|
||||
|
||||
# >>> [Getting started](https://github.com/jacobdufault/cquery/wiki/Getting-started) (CLICK HERE) <<<
|
||||
It has a global view of the code base and support a lot of cross reference features, see [wiki/FAQ](../../wiki/FAQ).
|
||||
It starts indexing the whole project (including subprojects if exist) parallelly when you open the first file, while the main thread can serve requests before the indexing is complete.
|
||||
Saving files will incrementally update the index.
|
||||
|
||||
# Limitations
|
||||
Compared with cquery, it makes use of C++17 features, has less third-party dependencies and slimmed-down code base.
|
||||
It leverages Clang C++ API as [clangd](https://clang.llvm.org/extra/clangd.html) does, which provides better support for code completion and diagnostics.
|
||||
Refactoring is a non-goal as it can be provided by clang-include-fixer and other Clang based tools.
|
||||
|
||||
cquery is able to respond to queries quickly because it caches a huge amount of
|
||||
information. When a request comes in, cquery just looks it up in the cache
|
||||
without running many computations. As a result, there's a large memory overhead.
|
||||
For example, a full index of Chrome will take about 10gb of memory. If you
|
||||
exclude v8, webkit, and third_party, it goes down to about 6.5gb.
|
||||
The comparison with cquery as noted on 2018-07-15:
|
||||
|
||||
# License
|
||||
| | cquery | ccls |
|
||||
|------------ |--------------------------------|------------------------------|
|
||||
| third_party | more | fewer |
|
||||
| C++ | C++14 | C++17 |
|
||||
| clang API | libclang (C) | clang/llvm C++ |
|
||||
| Filesystem | AbsolutePath + custom routines | llvm/Support |
|
||||
| index | libclang | clangIndex, some enhancement |
|
||||
| pipeline | index merge+id remapping | simpler and more robust |
|
||||
|
||||
MIT
|
||||
cquery has system include path detection (through running the compiler driver) while ccls uses clangDriver.
|
||||
|
||||
# >>> [Getting started](../../wiki/Home) (CLICK HERE) <<<
|
||||
|
||||
* [Build](../../wiki/Build)
|
||||
* [FAQ](../../wiki/FAQ)
|
||||
|
||||
ccls can index itself (~180MiB RSS when idle, noted on 2018-09-01), FreeBSD, glibc, Linux, LLVM (~1800MiB RSS), musl (~60MiB RSS), ... with decent memory footprint. See [wiki/compile_commands.json](../../wiki/compile_commands.json) for examples.
|
||||
|
@ -7,15 +7,15 @@ case $(uname -s) in
|
||||
Darwin)
|
||||
libclang=(lib/clang+llvm-*/lib/libclang.dylib)
|
||||
strip_option="-x"
|
||||
name=cquery-$version-x86_64-apple-darwin ;;
|
||||
name=ccls-$version-x86_64-apple-darwin ;;
|
||||
FreeBSD)
|
||||
libclang=(lib/clang+llvm-*/lib/libclang.so.?)
|
||||
strip_option="-s"
|
||||
name=cquery-$version-x86_64-unknown-freebsd10 ;;
|
||||
name=ccls-$version-x86_64-unknown-freebsd10 ;;
|
||||
Linux)
|
||||
libclang=(lib/clang+llvm-*/lib/libclang.so.?)
|
||||
strip_option="-s"
|
||||
name=cquery-$version-x86_64-unknown-linux-gnu ;;
|
||||
name=ccls-$version-x86_64-unknown-linux-gnu ;;
|
||||
*)
|
||||
echo Unsupported >&2
|
||||
exit 1 ;;
|
||||
@ -26,7 +26,7 @@ mkdir "$pkg/$name"
|
||||
rsync -rtLR bin "./${libclang[-1]}" ./lib/clang+llvm-*/lib/clang/*/include "$pkg/$name"
|
||||
|
||||
cd "$pkg"
|
||||
strip "$strip_option" "$name/bin/cquery" "$name/${libclang[-1]}"
|
||||
strip "$strip_option" "$name/bin/ccls" "$name/${libclang[-1]}"
|
||||
case $(uname -s) in
|
||||
Darwin)
|
||||
# https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/tar.1.html
|
||||
|
@ -1 +0,0 @@
|
||||
build/release/compile_commands.json
|
4
index_tests/_empty_test.cc
Normal file
4
index_tests/_empty_test.cc
Normal file
@ -0,0 +1,4 @@
|
||||
/*
|
||||
OUTPUT:
|
||||
{}
|
||||
*/
|
32
index_tests/class_forward_declaration.cc
Normal file
32
index_tests/class_forward_declaration.cc
Normal file
@ -0,0 +1,32 @@
|
||||
class Foo;
|
||||
class Foo;
|
||||
class Foo {};
|
||||
class Foo;
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [],
|
||||
"usr2type": [{
|
||||
"usr": 15041163540773201510,
|
||||
"detailed_name": "class Foo",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Foo",
|
||||
"spell": "3:7-3:10|3:1-3:13|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": ["1:7-1:10|1:1-1:10|1|-1", "2:7-2:10|2:1-2:10|1|-1", "4:7-4:10|4:1-4:10|1|-1"],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
92
index_tests/constructors/constructor.cc
Normal file
92
index_tests/constructors/constructor.cc
Normal file
@ -0,0 +1,92 @@
|
||||
class Foo {
|
||||
public:
|
||||
Foo() {}
|
||||
};
|
||||
|
||||
void foo() {
|
||||
Foo f;
|
||||
Foo* f2 = new Foo();
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 3385168158331140247,
|
||||
"detailed_name": "Foo::Foo()",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "Foo",
|
||||
"spell": "3:3-3:6|3:3-3:11|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 9,
|
||||
"parent_kind": 5,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": ["7:7-7:8|16676|-1", "8:17-8:20|16676|-1"]
|
||||
}, {
|
||||
"usr": 4259594751088586730,
|
||||
"detailed_name": "void foo()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo",
|
||||
"spell": "6:6-6:9|6:1-9:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [10983126130596230582, 17165811951126099095],
|
||||
"callees": ["7:7-7:8|3385168158331140247|3|16676", "7:7-7:8|3385168158331140247|3|16676", "8:17-8:20|3385168158331140247|3|16676", "8:17-8:20|3385168158331140247|3|16676"],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 15041163540773201510,
|
||||
"detailed_name": "class Foo {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Foo",
|
||||
"spell": "1:7-1:10|1:1-4:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [3385168158331140247],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [10983126130596230582, 17165811951126099095],
|
||||
"uses": ["3:3-3:6|4|-1", "7:3-7:6|4|-1", "8:3-8:6|4|-1", "8:17-8:20|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 10983126130596230582,
|
||||
"detailed_name": "Foo f",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "f",
|
||||
"spell": "7:7-7:8|7:3-7:8|2|-1",
|
||||
"type": 15041163540773201510,
|
||||
"kind": 13,
|
||||
"parent_kind": 12,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 17165811951126099095,
|
||||
"detailed_name": "Foo *f2",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "f2",
|
||||
"hover": "Foo *f2 = new Foo()",
|
||||
"spell": "8:8-8:10|8:3-8:22|2|-1",
|
||||
"type": 15041163540773201510,
|
||||
"kind": 13,
|
||||
"parent_kind": 12,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
99
index_tests/constructors/destructor.cc
Normal file
99
index_tests/constructors/destructor.cc
Normal file
@ -0,0 +1,99 @@
|
||||
class Foo {
|
||||
public:
|
||||
Foo() {}
|
||||
~Foo() {};
|
||||
};
|
||||
|
||||
void foo() {
|
||||
Foo f;
|
||||
}
|
||||
|
||||
// TODO: Support destructors (notice how the dtor has no usages listed).
|
||||
// - check if variable is a pointer. if so, do *not* insert dtor
|
||||
// - check if variable is normal type. if so, insert dtor
|
||||
// - scan for statements that look like dtors in function def handler
|
||||
// - figure out some way to support w/ unique_ptrs?
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 3385168158331140247,
|
||||
"detailed_name": "Foo::Foo()",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "Foo",
|
||||
"spell": "3:3-3:6|3:3-3:11|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 9,
|
||||
"parent_kind": 5,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": ["8:7-8:8|16676|-1"]
|
||||
}, {
|
||||
"usr": 4259594751088586730,
|
||||
"detailed_name": "void foo()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo",
|
||||
"spell": "7:6-7:9|7:1-9:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [1893354193220338759],
|
||||
"callees": ["8:7-8:8|3385168158331140247|3|16676", "8:7-8:8|3385168158331140247|3|16676"],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 7440261702884428359,
|
||||
"detailed_name": "Foo::~Foo() noexcept",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "~Foo",
|
||||
"spell": "4:3-4:7|4:3-4:12|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 5,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 15041163540773201510,
|
||||
"detailed_name": "class Foo {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Foo",
|
||||
"spell": "1:7-1:10|1:1-5:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [3385168158331140247, 7440261702884428359],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [1893354193220338759],
|
||||
"uses": ["3:3-3:6|4|-1", "4:4-4:7|4|-1", "8:3-8:6|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 1893354193220338759,
|
||||
"detailed_name": "Foo f",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "f",
|
||||
"spell": "8:7-8:8|8:3-8:8|2|-1",
|
||||
"type": 15041163540773201510,
|
||||
"kind": 13,
|
||||
"parent_kind": 12,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
91
index_tests/constructors/implicit_constructor.cc
Normal file
91
index_tests/constructors/implicit_constructor.cc
Normal file
@ -0,0 +1,91 @@
|
||||
struct Type {
|
||||
Type() {}
|
||||
};
|
||||
|
||||
void Make() {
|
||||
Type foo0;
|
||||
auto foo1 = Type();
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 3957104924306079513,
|
||||
"detailed_name": "void Make()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "Make",
|
||||
"spell": "5:6-5:10|5:1-8:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [449111627548814328, 17097499197730163115],
|
||||
"callees": ["6:8-6:12|10530961286677896857|3|16676", "6:8-6:12|10530961286677896857|3|16676", "7:15-7:19|10530961286677896857|3|16676", "7:15-7:19|10530961286677896857|3|16676"],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 10530961286677896857,
|
||||
"detailed_name": "Type::Type()",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "Type",
|
||||
"spell": "2:3-2:7|2:3-2:12|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 9,
|
||||
"parent_kind": 23,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": ["6:8-6:12|16676|-1", "7:15-7:19|16676|-1"]
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 13487927231218873822,
|
||||
"detailed_name": "struct Type {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Type",
|
||||
"spell": "1:8-1:12|1:1-3:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [10530961286677896857],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [449111627548814328, 17097499197730163115],
|
||||
"uses": ["2:3-2:7|4|-1", "6:3-6:7|4|-1", "7:15-7:19|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 449111627548814328,
|
||||
"detailed_name": "Type foo0",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo0",
|
||||
"spell": "6:8-6:12|6:3-6:12|2|-1",
|
||||
"type": 13487927231218873822,
|
||||
"kind": 13,
|
||||
"parent_kind": 12,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 17097499197730163115,
|
||||
"detailed_name": "Type foo1",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo1",
|
||||
"hover": "Type foo1 = Type()",
|
||||
"spell": "7:8-7:12|7:3-7:21|2|-1",
|
||||
"type": 13487927231218873822,
|
||||
"kind": 13,
|
||||
"parent_kind": 12,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
51
index_tests/constructors/invalid_reference.cc
Normal file
51
index_tests/constructors/invalid_reference.cc
Normal file
@ -0,0 +1,51 @@
|
||||
struct Foo {};
|
||||
|
||||
template<class T>
|
||||
Foo::Foo() {}
|
||||
|
||||
/*
|
||||
EXTRA_FLAGS:
|
||||
-fms-compatibility
|
||||
-fdelayed-template-parsing
|
||||
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 17319723337446061757,
|
||||
"detailed_name": "Foo::Foo::Foo()",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "Foo",
|
||||
"spell": "4:6-4:9|4:1-4:11|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 9,
|
||||
"parent_kind": 23,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 15041163540773201510,
|
||||
"detailed_name": "struct Foo {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Foo",
|
||||
"spell": "1:8-1:11|1:1-1:14|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [17319723337446061757],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["4:1-4:4|4|-1", "4:6-4:9|4|-1"]
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
351
index_tests/constructors/make_functions.cc
Normal file
351
index_tests/constructors/make_functions.cc
Normal file
@ -0,0 +1,351 @@
|
||||
#include "make_functions.h"
|
||||
|
||||
template <typename T, typename... Args>
|
||||
T* MakeUnique(Args&&... args) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <typename T, typename... Args>
|
||||
T* maKE_NoRefs(Args... args) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void caller22() {
|
||||
MakeUnique<Foobar>();
|
||||
MakeUnique<Foobar>(1);
|
||||
MakeUnique<Foobar>(1, new Bar(), nullptr);
|
||||
maKE_NoRefs<Foobar>(1, new Bar(), nullptr);
|
||||
}
|
||||
|
||||
// TODO: Eliminate the extra entries in the "types" array here. They come from
|
||||
// the template function definitions.
|
||||
|
||||
// Foobar is defined in a separate file to ensure that we can attribute
|
||||
// MakeUnique calls across translation units.
|
||||
|
||||
/*
|
||||
OUTPUT: make_functions.h
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 3765833212244435302,
|
||||
"detailed_name": "Foobar::Foobar(int &&, Bar *, bool *)",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "Foobar",
|
||||
"spell": "7:3-7:9|7:3-7:32|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 9,
|
||||
"parent_kind": 5,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 13028995015627606181,
|
||||
"detailed_name": "Foobar::Foobar(int)",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "Foobar",
|
||||
"spell": "6:3-6:9|6:3-6:17|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 9,
|
||||
"parent_kind": 5,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 13131778807733950299,
|
||||
"detailed_name": "Foobar::Foobar()",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "Foobar",
|
||||
"spell": "5:3-5:9|5:3-5:14|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 9,
|
||||
"parent_kind": 5,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 17321436359755983845,
|
||||
"detailed_name": "Foobar::Foobar(int, Bar *, bool *)",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "Foobar",
|
||||
"spell": "8:3-8:9|8:3-8:30|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 9,
|
||||
"parent_kind": 5,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 12993848456528750350,
|
||||
"detailed_name": "struct Bar {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Bar",
|
||||
"spell": "1:8-1:11|1:1-1:14|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["7:17-7:20|4|-1", "8:15-8:18|4|-1"]
|
||||
}, {
|
||||
"usr": 14935975554338052500,
|
||||
"detailed_name": "class Foobar {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Foobar",
|
||||
"spell": "3:7-3:13|3:1-9:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [13131778807733950299, 13028995015627606181, 3765833212244435302, 17321436359755983845],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["5:3-5:9|4|-1", "6:3-6:9|4|-1", "7:3-7:9|4|-1", "8:3-8:9|4|-1"]
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
OUTPUT: make_functions.cc
|
||||
{
|
||||
"includes": [{
|
||||
"line": 0,
|
||||
"resolved_path": "&make_functions.h"
|
||||
}],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 768523651983844320,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"vars": [2555873744476712860, 2555873744476712860, 2555873744476712860],
|
||||
"callees": [],
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 2532818908869373467,
|
||||
"detailed_name": "T *maKE_NoRefs(Args ...args)",
|
||||
"qual_name_offset": 3,
|
||||
"short_name": "maKE_NoRefs",
|
||||
"spell": "9:4-9:15|9:1-11:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [3908732770590594660],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": ["17:3-17:14|16420|-1"]
|
||||
}, {
|
||||
"usr": 2816883305867289955,
|
||||
"detailed_name": "void caller22()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "caller22",
|
||||
"spell": "13:6-13:14|13:1-18:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": ["14:3-14:13|15793662558620604611|3|16420", "15:3-15:13|15793662558620604611|3|16420", "16:3-16:13|15793662558620604611|3|16420", "17:3-17:14|2532818908869373467|3|16420"],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 11138976705878544996,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"vars": [16395392342608151399],
|
||||
"callees": [],
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 11363675606380070883,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"vars": [180270746871803062, 180270746871803062, 180270746871803062],
|
||||
"callees": [],
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 15793662558620604611,
|
||||
"detailed_name": "T *MakeUnique(Args &&...args)",
|
||||
"qual_name_offset": 3,
|
||||
"short_name": "MakeUnique",
|
||||
"spell": "4:4-4:14|4:1-6:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [8463700030555379526],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": ["14:3-14:13|16420|-1", "15:3-15:13|16420|-1", "16:3-16:13|16420|-1"]
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 53,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [180270746871803062],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 87,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [180270746871803062],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 12993848456528750350,
|
||||
"detailed_name": "struct Bar {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Bar",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["16:29-16:32|4|-1", "17:30-17:33|4|-1"]
|
||||
}, {
|
||||
"usr": 14935975554338052500,
|
||||
"detailed_name": "class Foobar {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Foobar",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["14:14-14:20|4|-1", "15:14-15:20|4|-1", "16:14-16:20|4|-1", "17:15-17:21|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 180270746871803062,
|
||||
"detailed_name": "int args",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "args",
|
||||
"spell": "9:24-9:28|9:16-9:28|1026|-1",
|
||||
"type": 87,
|
||||
"kind": 253,
|
||||
"parent_kind": 12,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 2555873744476712860,
|
||||
"detailed_name": "int &&args",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "args",
|
||||
"spell": "4:25-4:29|4:15-4:29|1026|-1",
|
||||
"type": 0,
|
||||
"kind": 253,
|
||||
"parent_kind": 12,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 3908732770590594660,
|
||||
"detailed_name": "Args ...args",
|
||||
"qual_name_offset": 8,
|
||||
"short_name": "args",
|
||||
"spell": "9:24-9:28|9:16-9:28|1026|-1",
|
||||
"type": 0,
|
||||
"kind": 253,
|
||||
"parent_kind": 12,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 8463700030555379526,
|
||||
"detailed_name": "Args &&...args",
|
||||
"qual_name_offset": 10,
|
||||
"short_name": "args",
|
||||
"spell": "4:25-4:29|4:15-4:29|1026|-1",
|
||||
"type": 0,
|
||||
"kind": 253,
|
||||
"parent_kind": 12,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 16395392342608151399,
|
||||
"detailed_name": "int &&args",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "args",
|
||||
"spell": "4:25-4:29|4:15-4:29|1026|-1",
|
||||
"type": 0,
|
||||
"kind": 253,
|
||||
"parent_kind": 12,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
10
index_tests/constructors/make_functions.h
Normal file
10
index_tests/constructors/make_functions.h
Normal file
@ -0,0 +1,10 @@
|
||||
struct Bar {};
|
||||
|
||||
class Foobar {
|
||||
public:
|
||||
Foobar() {}
|
||||
Foobar(int) {}
|
||||
Foobar(int&&, Bar*, bool*) {}
|
||||
Foobar(int, Bar*, bool*) {}
|
||||
};
|
||||
|
34
index_tests/declaration_vs_definition/class.cc
Normal file
34
index_tests/declaration_vs_definition/class.cc
Normal file
@ -0,0 +1,34 @@
|
||||
class Foo;
|
||||
class Foo;
|
||||
class Foo {};
|
||||
class Foo;
|
||||
|
||||
/*
|
||||
// NOTE: Separate decl/definition are not supported for classes. See source
|
||||
// for comments.
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [],
|
||||
"usr2type": [{
|
||||
"usr": 15041163540773201510,
|
||||
"detailed_name": "class Foo",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Foo",
|
||||
"spell": "3:7-3:10|3:1-3:13|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": ["1:7-1:10|1:1-1:10|1|-1", "2:7-2:10|2:1-2:10|1|-1", "4:7-4:10|4:1-4:10|1|-1"],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
62
index_tests/declaration_vs_definition/class_member.cc
Normal file
62
index_tests/declaration_vs_definition/class_member.cc
Normal file
@ -0,0 +1,62 @@
|
||||
class Foo {
|
||||
int foo;
|
||||
};
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [],
|
||||
"usr2type": [{
|
||||
"usr": 53,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [9736582033442720743],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 15041163540773201510,
|
||||
"detailed_name": "class Foo {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Foo",
|
||||
"spell": "1:7-1:10|1:1-3:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [{
|
||||
"L": 9736582033442720743,
|
||||
"R": 0
|
||||
}],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 9736582033442720743,
|
||||
"detailed_name": "int Foo::foo",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "foo",
|
||||
"spell": "2:7-2:10|2:3-2:10|1026|-1",
|
||||
"type": 53,
|
||||
"kind": 8,
|
||||
"parent_kind": 5,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
61
index_tests/declaration_vs_definition/class_member_static.cc
Normal file
61
index_tests/declaration_vs_definition/class_member_static.cc
Normal file
@ -0,0 +1,61 @@
|
||||
class Foo {
|
||||
static int foo;
|
||||
};
|
||||
|
||||
int Foo::foo;
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [],
|
||||
"usr2type": [{
|
||||
"usr": 53,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [8942920329766232482, 8942920329766232482],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 15041163540773201510,
|
||||
"detailed_name": "class Foo {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Foo",
|
||||
"spell": "1:7-1:10|1:1-3:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["5:5-5:8|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 8942920329766232482,
|
||||
"detailed_name": "static int Foo::foo",
|
||||
"qual_name_offset": 11,
|
||||
"short_name": "foo",
|
||||
"spell": "5:10-5:13|5:1-5:13|1026|-1",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 5,
|
||||
"storage": 2,
|
||||
"declarations": ["2:14-2:17|2:3-2:17|1025|-1"],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
31
index_tests/declaration_vs_definition/func.cc
Normal file
31
index_tests/declaration_vs_definition/func.cc
Normal file
@ -0,0 +1,31 @@
|
||||
void foo();
|
||||
void foo();
|
||||
void foo() {}
|
||||
void foo();
|
||||
|
||||
/*
|
||||
// Note: we always use the latest seen ("most local") definition/declaration.
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 4259594751088586730,
|
||||
"detailed_name": "void foo()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo",
|
||||
"spell": "3:6-3:9|3:1-3:14|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["1:6-1:9|1:1-1:11|1|-1", "2:6-2:9|2:1-2:11|1|-1", "4:6-4:9|4:1-4:11|1|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
@ -0,0 +1,71 @@
|
||||
int foo(int, int);
|
||||
int foo(int aa,
|
||||
int bb);
|
||||
int foo(int aaa, int bbb);
|
||||
int foo(int a, int b) { return 0; }
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 2747674671862363334,
|
||||
"detailed_name": "int foo(int, int)",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "foo",
|
||||
"spell": "5:5-5:8|5:1-5:36|2|-1",
|
||||
"bases": [],
|
||||
"vars": [14555488990109936920, 10963664335057337329],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["1:5-1:8|1:1-1:18|1|-1", "2:5-2:8|2:1-3:16|1|-1", "4:5-4:8|4:1-4:26|1|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 53,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [14555488990109936920, 10963664335057337329],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 10963664335057337329,
|
||||
"detailed_name": "int b",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "b",
|
||||
"spell": "5:20-5:21|5:16-5:21|1026|-1",
|
||||
"type": 53,
|
||||
"kind": 253,
|
||||
"parent_kind": 12,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 14555488990109936920,
|
||||
"detailed_name": "int a",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "a",
|
||||
"spell": "5:13-5:14|5:9-5:14|1026|-1",
|
||||
"type": 53,
|
||||
"kind": 253,
|
||||
"parent_kind": 12,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
78
index_tests/declaration_vs_definition/method.cc
Normal file
78
index_tests/declaration_vs_definition/method.cc
Normal file
@ -0,0 +1,78 @@
|
||||
class Foo {
|
||||
void declonly();
|
||||
virtual void purevirtual() = 0;
|
||||
void def();
|
||||
};
|
||||
|
||||
void Foo::def() {}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 4012226004228259562,
|
||||
"detailed_name": "void Foo::declonly()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "declonly",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["2:8-2:16|2:3-2:18|1025|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 10939323144126021546,
|
||||
"detailed_name": "virtual void Foo::purevirtual() = 0",
|
||||
"qual_name_offset": 13,
|
||||
"short_name": "purevirtual",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["3:16-3:27|3:3-3:33|1089|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 15416083548883122431,
|
||||
"detailed_name": "void Foo::def()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "def",
|
||||
"spell": "7:11-7:14|7:1-7:19|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 5,
|
||||
"storage": 0,
|
||||
"declarations": ["4:8-4:11|4:3-4:13|1025|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 15041163540773201510,
|
||||
"detailed_name": "class Foo {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Foo",
|
||||
"spell": "1:7-1:10|1:1-5:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [4012226004228259562, 10939323144126021546, 15416083548883122431],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["7:6-7:9|4|-1"]
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
81
index_tests/enums/enum_class_decl.cc
Normal file
81
index_tests/enums/enum_class_decl.cc
Normal file
@ -0,0 +1,81 @@
|
||||
typedef unsigned char uint8_t;
|
||||
enum class Foo : uint8_t {
|
||||
A,
|
||||
B = 20
|
||||
};
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [],
|
||||
"usr2type": [{
|
||||
"usr": 2010430204259339553,
|
||||
"detailed_name": "typedef unsigned char uint8_t",
|
||||
"qual_name_offset": 22,
|
||||
"short_name": "uint8_t",
|
||||
"spell": "1:23-1:30|1:1-1:30|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 252,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 16985894625255407295,
|
||||
"detailed_name": "enum class Foo : uint8_t {}",
|
||||
"qual_name_offset": 11,
|
||||
"short_name": "Foo",
|
||||
"spell": "2:12-2:15|2:1-5:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [{
|
||||
"L": 439339022761937396,
|
||||
"R": -1
|
||||
}, {
|
||||
"L": 15962370213938840720,
|
||||
"R": -1
|
||||
}],
|
||||
"alias_of": 0,
|
||||
"kind": 10,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 439339022761937396,
|
||||
"detailed_name": "Foo::A",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "A",
|
||||
"hover": "Foo::A = 0",
|
||||
"spell": "3:3-3:4|3:3-3:4|1026|-1",
|
||||
"type": 16985894625255407295,
|
||||
"kind": 22,
|
||||
"parent_kind": 10,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 15962370213938840720,
|
||||
"detailed_name": "Foo::B = 20",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "B",
|
||||
"spell": "4:3-4:4|4:3-4:9|1026|-1",
|
||||
"type": 16985894625255407295,
|
||||
"kind": 22,
|
||||
"parent_kind": 10,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
57
index_tests/enums/enum_decl.cc
Normal file
57
index_tests/enums/enum_decl.cc
Normal file
@ -0,0 +1,57 @@
|
||||
enum Foo {
|
||||
A,
|
||||
B = 20
|
||||
};
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [],
|
||||
"usr2type": [{
|
||||
"usr": 16985894625255407295,
|
||||
"detailed_name": "enum Foo {}",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "Foo",
|
||||
"spell": "1:6-1:9|1:1-4:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 10,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 439339022761937396,
|
||||
"detailed_name": "A",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "A",
|
||||
"hover": "A = 0",
|
||||
"spell": "2:3-2:4|2:3-2:4|1026|-1",
|
||||
"type": 16985894625255407295,
|
||||
"kind": 22,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 15962370213938840720,
|
||||
"detailed_name": "B = 20",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "B",
|
||||
"spell": "3:3-3:4|3:3-3:9|1026|-1",
|
||||
"type": 16985894625255407295,
|
||||
"kind": 22,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
129
index_tests/enums/enum_inherit.cc
Normal file
129
index_tests/enums/enum_inherit.cc
Normal file
@ -0,0 +1,129 @@
|
||||
enum Foo : int {
|
||||
A,
|
||||
B = 20
|
||||
};
|
||||
|
||||
typedef int int32_t;
|
||||
|
||||
enum class E : int32_t {
|
||||
E0,
|
||||
E20 = 20
|
||||
};
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [],
|
||||
"usr2type": [{
|
||||
"usr": 2986879766914123941,
|
||||
"detailed_name": "enum class E : int32_t {}",
|
||||
"qual_name_offset": 11,
|
||||
"short_name": "E",
|
||||
"spell": "8:12-8:13|8:1-11:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [{
|
||||
"L": 16614320383091394267,
|
||||
"R": -1
|
||||
}, {
|
||||
"L": 16847439761518576294,
|
||||
"R": -1
|
||||
}],
|
||||
"alias_of": 0,
|
||||
"kind": 10,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 14939241684006947339,
|
||||
"detailed_name": "typedef int int32_t",
|
||||
"qual_name_offset": 12,
|
||||
"short_name": "int32_t",
|
||||
"spell": "6:13-6:20|6:1-6:20|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 252,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 16985894625255407295,
|
||||
"detailed_name": "enum Foo : int {}",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "Foo",
|
||||
"spell": "1:6-1:9|1:1-4:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 10,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 439339022761937396,
|
||||
"detailed_name": "A",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "A",
|
||||
"hover": "A = 0",
|
||||
"spell": "2:3-2:4|2:3-2:4|1026|-1",
|
||||
"type": 16985894625255407295,
|
||||
"kind": 22,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 15962370213938840720,
|
||||
"detailed_name": "B = 20",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "B",
|
||||
"spell": "3:3-3:4|3:3-3:9|1026|-1",
|
||||
"type": 16985894625255407295,
|
||||
"kind": 22,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 16614320383091394267,
|
||||
"detailed_name": "E::E0",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "E0",
|
||||
"hover": "E::E0 = 0",
|
||||
"spell": "9:3-9:5|9:3-9:5|1026|-1",
|
||||
"type": 2986879766914123941,
|
||||
"kind": 22,
|
||||
"parent_kind": 10,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 16847439761518576294,
|
||||
"detailed_name": "E::E20 = 20",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "E20",
|
||||
"spell": "10:3-10:6|10:3-10:11|1026|-1",
|
||||
"type": 2986879766914123941,
|
||||
"kind": 22,
|
||||
"parent_kind": 10,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
78
index_tests/enums/enum_usage.cc
Normal file
78
index_tests/enums/enum_usage.cc
Normal file
@ -0,0 +1,78 @@
|
||||
enum class Foo {
|
||||
A,
|
||||
B = 20
|
||||
};
|
||||
|
||||
Foo x = Foo::A;
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [],
|
||||
"usr2type": [{
|
||||
"usr": 16985894625255407295,
|
||||
"detailed_name": "enum class Foo : int {}",
|
||||
"qual_name_offset": 11,
|
||||
"short_name": "Foo",
|
||||
"spell": "1:12-1:15|1:1-4:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [{
|
||||
"L": 439339022761937396,
|
||||
"R": -1
|
||||
}, {
|
||||
"L": 15962370213938840720,
|
||||
"R": -1
|
||||
}],
|
||||
"alias_of": 0,
|
||||
"kind": 10,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [10677751717622394455],
|
||||
"uses": ["6:1-6:4|4|-1", "6:9-6:12|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 439339022761937396,
|
||||
"detailed_name": "Foo::A",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "A",
|
||||
"hover": "Foo::A = 0",
|
||||
"spell": "2:3-2:4|2:3-2:4|1026|-1",
|
||||
"type": 16985894625255407295,
|
||||
"kind": 22,
|
||||
"parent_kind": 10,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": ["6:14-6:15|4|-1"]
|
||||
}, {
|
||||
"usr": 10677751717622394455,
|
||||
"detailed_name": "Foo x",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "x",
|
||||
"hover": "Foo x = Foo::A",
|
||||
"spell": "6:5-6:6|6:1-6:15|2|-1",
|
||||
"type": 16985894625255407295,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 15962370213938840720,
|
||||
"detailed_name": "Foo::B = 20",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "B",
|
||||
"spell": "3:3-3:4|3:3-3:9|1026|-1",
|
||||
"type": 16985894625255407295,
|
||||
"kind": 22,
|
||||
"parent_kind": 10,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
112
index_tests/foobar.cc
Normal file
112
index_tests/foobar.cc
Normal file
@ -0,0 +1,112 @@
|
||||
enum A {};
|
||||
enum B {};
|
||||
|
||||
template<typename T>
|
||||
struct Foo {
|
||||
struct Inner {};
|
||||
};
|
||||
|
||||
Foo<A>::Inner a;
|
||||
Foo<B> b;
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [],
|
||||
"usr2type": [{
|
||||
"usr": 6697181287623958829,
|
||||
"detailed_name": "enum A {}",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "A",
|
||||
"spell": "1:6-1:7|1:1-1:10|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 10,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["9:5-9:6|4|-1"]
|
||||
}, {
|
||||
"usr": 10528472276654770367,
|
||||
"detailed_name": "struct Foo {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Foo",
|
||||
"spell": "5:8-5:11|5:1-7:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [13938528237873543349],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [12028309045033782423],
|
||||
"uses": ["9:1-9:4|4|-1", "10:1-10:4|4|-1"]
|
||||
}, {
|
||||
"usr": 13892793056005362145,
|
||||
"detailed_name": "enum B {}",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "B",
|
||||
"spell": "2:6-2:7|2:1-2:10|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 10,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["10:5-10:6|4|-1"]
|
||||
}, {
|
||||
"usr": 13938528237873543349,
|
||||
"detailed_name": "struct Foo::Inner {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Inner",
|
||||
"spell": "6:10-6:15|6:3-6:18|1026|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 23,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [16721564935990383768],
|
||||
"uses": ["9:9-9:14|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 12028309045033782423,
|
||||
"detailed_name": "Foo<B> b",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "b",
|
||||
"spell": "10:8-10:9|10:1-10:9|2|-1",
|
||||
"type": 10528472276654770367,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 16721564935990383768,
|
||||
"detailed_name": "Foo<A>::Inner a",
|
||||
"qual_name_offset": 14,
|
||||
"short_name": "a",
|
||||
"spell": "9:15-9:16|9:1-9:16|2|-1",
|
||||
"type": 13938528237873543349,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
26
index_tests/function_declaration.cc
Normal file
26
index_tests/function_declaration.cc
Normal file
@ -0,0 +1,26 @@
|
||||
void foo(int a, int b);
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 2747674671862363334,
|
||||
"detailed_name": "void foo(int a, int b)",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["1:6-1:9|1:1-1:23|1|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
29
index_tests/function_declaration_definition.cc
Normal file
29
index_tests/function_declaration_definition.cc
Normal file
@ -0,0 +1,29 @@
|
||||
void foo();
|
||||
|
||||
void foo() {}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 4259594751088586730,
|
||||
"detailed_name": "void foo()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo",
|
||||
"spell": "3:6-3:9|3:1-3:14|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["1:6-1:9|1:1-1:11|1|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
27
index_tests/function_definition.cc
Normal file
27
index_tests/function_definition.cc
Normal file
@ -0,0 +1,27 @@
|
||||
void foo() {}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 4259594751088586730,
|
||||
"detailed_name": "void foo()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo",
|
||||
"spell": "1:6-1:9|1:1-1:14|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
47
index_tests/inheritance/class_inherit.cc
Normal file
47
index_tests/inheritance/class_inherit.cc
Normal file
@ -0,0 +1,47 @@
|
||||
class Parent {};
|
||||
class Derived : public Parent {};
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [],
|
||||
"usr2type": [{
|
||||
"usr": 3866412049634585509,
|
||||
"detailed_name": "class Parent {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Parent",
|
||||
"spell": "1:7-1:13|1:1-1:16|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [10963370434658308541],
|
||||
"instances": [],
|
||||
"uses": ["2:24-2:30|2052|-1"]
|
||||
}, {
|
||||
"usr": 10963370434658308541,
|
||||
"detailed_name": "class Derived : public Parent {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Derived",
|
||||
"spell": "2:7-2:14|2:1-2:33|2|-1",
|
||||
"bases": [3866412049634585509],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
109
index_tests/inheritance/class_inherit_templated_parent.cc
Normal file
109
index_tests/inheritance/class_inherit_templated_parent.cc
Normal file
@ -0,0 +1,109 @@
|
||||
template<unsigned int C>
|
||||
class Base1 {};
|
||||
|
||||
template<typename C>
|
||||
class Base2 {};
|
||||
|
||||
template<unsigned int T>
|
||||
class Derived1 : Base1<T> {};
|
||||
|
||||
template<typename T>
|
||||
class Derived2 : Base2<T> {};
|
||||
|
||||
class Derived : Base1<3>, Base2<Derived>, Derived1<4>, Derived2<Derived> {};
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [],
|
||||
"usr2type": [{
|
||||
"usr": 5863733211528032190,
|
||||
"detailed_name": "class Derived1 : Base1<T> {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Derived1",
|
||||
"spell": "8:7-8:15|8:1-8:29|2|-1",
|
||||
"bases": [11930058224338108382],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [10963370434658308541],
|
||||
"instances": [],
|
||||
"uses": ["13:43-13:51|2052|-1"]
|
||||
}, {
|
||||
"usr": 10651399730831737929,
|
||||
"detailed_name": "class Derived2 : Base2<T> {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Derived2",
|
||||
"spell": "11:7-11:15|11:1-11:29|2|-1",
|
||||
"bases": [11118288764693061434],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [10963370434658308541],
|
||||
"instances": [],
|
||||
"uses": ["13:56-13:64|2052|-1"]
|
||||
}, {
|
||||
"usr": 10963370434658308541,
|
||||
"detailed_name": "class Derived : Base1<3>, Base2<Derived>, Derived1<4>, Derived2<Derived> {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Derived",
|
||||
"spell": "13:7-13:14|13:1-13:76|2|-1",
|
||||
"bases": [11930058224338108382, 11118288764693061434, 5863733211528032190, 10651399730831737929],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["13:33-13:40|2052|-1", "13:65-13:72|2052|-1"]
|
||||
}, {
|
||||
"usr": 11118288764693061434,
|
||||
"detailed_name": "class Base2 {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Base2",
|
||||
"spell": "5:7-5:12|5:1-5:15|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [10651399730831737929, 10963370434658308541],
|
||||
"instances": [],
|
||||
"uses": ["11:18-11:23|2052|-1", "13:27-13:32|2052|-1"]
|
||||
}, {
|
||||
"usr": 11930058224338108382,
|
||||
"detailed_name": "class Base1 {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Base1",
|
||||
"spell": "2:7-2:12|2:1-2:15|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [5863733211528032190, 10963370434658308541],
|
||||
"instances": [],
|
||||
"uses": ["8:18-8:23|2052|-1", "13:17-13:22|2052|-1"]
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
83
index_tests/inheritance/class_multiple_inherit.cc
Normal file
83
index_tests/inheritance/class_multiple_inherit.cc
Normal file
@ -0,0 +1,83 @@
|
||||
class Root {};
|
||||
class MiddleA : public Root {};
|
||||
class MiddleB : public Root {};
|
||||
class Derived : public MiddleA, public MiddleB {};
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [],
|
||||
"usr2type": [{
|
||||
"usr": 3897841498936210886,
|
||||
"detailed_name": "class Root {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Root",
|
||||
"spell": "1:7-1:11|1:1-1:14|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [11863524815063131483, 14022569716337624303],
|
||||
"instances": [],
|
||||
"uses": ["2:24-2:28|2052|-1", "3:24-3:28|2052|-1"]
|
||||
}, {
|
||||
"usr": 10963370434658308541,
|
||||
"detailed_name": "class Derived : public MiddleA, public MiddleB {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Derived",
|
||||
"spell": "4:7-4:14|4:1-4:50|2|-1",
|
||||
"bases": [11863524815063131483, 14022569716337624303],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 11863524815063131483,
|
||||
"detailed_name": "class MiddleA : public Root {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "MiddleA",
|
||||
"spell": "2:7-2:14|2:1-2:31|2|-1",
|
||||
"bases": [3897841498936210886],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [10963370434658308541],
|
||||
"instances": [],
|
||||
"uses": ["4:24-4:31|2052|-1"]
|
||||
}, {
|
||||
"usr": 14022569716337624303,
|
||||
"detailed_name": "class MiddleB : public Root {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "MiddleB",
|
||||
"spell": "3:7-3:14|3:1-3:31|2|-1",
|
||||
"bases": [3897841498936210886],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [10963370434658308541],
|
||||
"instances": [],
|
||||
"uses": ["4:40-4:47|2052|-1"]
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
80
index_tests/inheritance/function_override.cc
Normal file
80
index_tests/inheritance/function_override.cc
Normal file
@ -0,0 +1,80 @@
|
||||
class Root {
|
||||
virtual void foo();
|
||||
};
|
||||
class Derived : public Root {
|
||||
void foo() override {}
|
||||
};
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 6666242542855173890,
|
||||
"detailed_name": "void Derived::foo()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo",
|
||||
"spell": "5:8-5:11|5:3-5:25|5186|-1",
|
||||
"bases": [9948027785633571339],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 5,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 9948027785633571339,
|
||||
"detailed_name": "virtual void Root::foo()",
|
||||
"qual_name_offset": 13,
|
||||
"short_name": "foo",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["2:16-2:19|2:3-2:21|1089|-1"],
|
||||
"derived": [6666242542855173890],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 3897841498936210886,
|
||||
"detailed_name": "class Root {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Root",
|
||||
"spell": "1:7-1:11|1:1-3:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [9948027785633571339],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [10963370434658308541],
|
||||
"instances": [],
|
||||
"uses": ["4:24-4:28|2052|-1"]
|
||||
}, {
|
||||
"usr": 10963370434658308541,
|
||||
"detailed_name": "class Derived : public Root {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Derived",
|
||||
"spell": "4:7-4:14|4:1-6:2|2|-1",
|
||||
"bases": [3897841498936210886],
|
||||
"funcs": [6666242542855173890],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
45
index_tests/inheritance/interface_pure_virtual.cc
Normal file
45
index_tests/inheritance/interface_pure_virtual.cc
Normal file
@ -0,0 +1,45 @@
|
||||
class IFoo {
|
||||
virtual void foo() = 0;
|
||||
};
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 3277829753446788562,
|
||||
"detailed_name": "virtual void IFoo::foo() = 0",
|
||||
"qual_name_offset": 13,
|
||||
"short_name": "foo",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["2:16-2:19|2:3-2:25|1089|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 9949214233977131946,
|
||||
"detailed_name": "class IFoo {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "IFoo",
|
||||
"spell": "1:7-1:11|1:1-3:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [3277829753446788562],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
116
index_tests/inheritance/multiple_base_functions.cc
Normal file
116
index_tests/inheritance/multiple_base_functions.cc
Normal file
@ -0,0 +1,116 @@
|
||||
struct Base0 {
|
||||
virtual ~Base0() { }
|
||||
};
|
||||
struct Base1 {
|
||||
virtual ~Base1() { }
|
||||
};
|
||||
struct Derived : Base0, Base1 {
|
||||
~Derived() override { }
|
||||
};
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 8401779086123965305,
|
||||
"detailed_name": "virtual Base1::~Base1() noexcept",
|
||||
"qual_name_offset": 8,
|
||||
"short_name": "~Base1",
|
||||
"spell": "5:11-5:17|5:3-5:23|1090|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 23,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 13164726294460837993,
|
||||
"detailed_name": "Derived::~Derived() noexcept",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "~Derived",
|
||||
"spell": "8:3-8:11|8:3-8:26|5186|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 23,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 16347272523198263017,
|
||||
"detailed_name": "virtual Base0::~Base0() noexcept",
|
||||
"qual_name_offset": 8,
|
||||
"short_name": "~Base0",
|
||||
"spell": "2:11-2:17|2:3-2:23|1090|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 23,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 10963370434658308541,
|
||||
"detailed_name": "struct Derived : Base0, Base1 {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Derived",
|
||||
"spell": "7:8-7:15|7:1-9:2|2|-1",
|
||||
"bases": [11628904180681204356, 15826803741381445676],
|
||||
"funcs": [13164726294460837993],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["8:4-8:11|4|-1"]
|
||||
}, {
|
||||
"usr": 11628904180681204356,
|
||||
"detailed_name": "struct Base0 {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Base0",
|
||||
"spell": "1:8-1:13|1:1-3:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [16347272523198263017],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [10963370434658308541],
|
||||
"instances": [],
|
||||
"uses": ["2:12-2:17|4|-1", "7:18-7:23|2052|-1"]
|
||||
}, {
|
||||
"usr": 15826803741381445676,
|
||||
"detailed_name": "struct Base1 {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Base1",
|
||||
"spell": "4:8-4:13|4:1-6:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [8401779086123965305],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [10963370434658308541],
|
||||
"instances": [],
|
||||
"uses": ["5:12-5:17|4|-1", "7:25-7:30|2052|-1"]
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
121
index_tests/lambdas/lambda.cc
Normal file
121
index_tests/lambdas/lambda.cc
Normal file
@ -0,0 +1,121 @@
|
||||
void foo() {
|
||||
int x;
|
||||
|
||||
auto dosomething = [&x](int y) {
|
||||
++x;
|
||||
++y;
|
||||
};
|
||||
|
||||
dosomething(1);
|
||||
dosomething(1);
|
||||
dosomething(1);
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 4259594751088586730,
|
||||
"detailed_name": "void foo()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo",
|
||||
"spell": "1:6-1:9|1:1-12:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [12666114896600231317, 2981279427664991319],
|
||||
"callees": ["9:14-9:15|17926497908620168464|3|16420", "10:14-10:15|17926497908620168464|3|16420", "11:14-11:15|17926497908620168464|3|16420"],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 17926497908620168464,
|
||||
"detailed_name": "inline void foo()::(anon class)::operator()(int y) const",
|
||||
"qual_name_offset": 12,
|
||||
"short_name": "operator()",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": ["9:14-9:15|16420|-1", "10:14-10:15|16420|-1", "11:14-11:15|16420|-1"]
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 53,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [12666114896600231317],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 14635009347499519042,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [2981279427664991319],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 2981279427664991319,
|
||||
"detailed_name": "(lambda) dosomething",
|
||||
"qual_name_offset": 9,
|
||||
"short_name": "dosomething",
|
||||
"hover": "(lambda) dosomething",
|
||||
"spell": "4:8-4:19|4:3-7:4|2|-1",
|
||||
"type": 14635009347499519042,
|
||||
"kind": 13,
|
||||
"parent_kind": 12,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": ["9:3-9:14|4|-1", "10:3-10:14|4|-1", "11:3-11:14|4|-1"]
|
||||
}, {
|
||||
"usr": 12666114896600231317,
|
||||
"detailed_name": "int x",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "x",
|
||||
"spell": "2:7-2:8|2:3-2:8|2|-1",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 12,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": ["4:24-4:25|4|-1", "5:7-5:8|28|-1"]
|
||||
}, {
|
||||
"usr": 12879188959314906706,
|
||||
"detailed_name": "int y",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "y",
|
||||
"spell": "4:31-4:32|4:27-4:32|2|-1",
|
||||
"type": 0,
|
||||
"kind": 253,
|
||||
"parent_kind": 6,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": ["6:7-6:8|28|-1"]
|
||||
}]
|
||||
}
|
||||
*/
|
95
index_tests/macros/complex.cc
Normal file
95
index_tests/macros/complex.cc
Normal file
@ -0,0 +1,95 @@
|
||||
#define FOO(aaa, bbb) \
|
||||
int a();\
|
||||
int a() { return aaa + bbb; }
|
||||
|
||||
|
||||
int make1() {
|
||||
return 3;
|
||||
}
|
||||
const int make2 = 5;
|
||||
|
||||
|
||||
FOO(make1(), make2);
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 9720930732776154610,
|
||||
"detailed_name": "int a()",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "a",
|
||||
"spell": "12:1-12:20|12:1-12:4|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": ["12:5-12:10|14400399977994209582|3|16420"],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["12:1-12:20|12:1-12:4|1|-1"],
|
||||
"derived": [],
|
||||
"uses": ["2:7-2:8|64|0", "3:7-3:8|64|0"]
|
||||
}, {
|
||||
"usr": 14400399977994209582,
|
||||
"detailed_name": "int make1()",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "make1",
|
||||
"spell": "6:5-6:10|6:1-8:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": ["12:5-12:10|16420|-1", "12:5-12:10|64|0"]
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 53,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [2878407290385495202],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 2878407290385495202,
|
||||
"detailed_name": "const int make2",
|
||||
"qual_name_offset": 10,
|
||||
"short_name": "make2",
|
||||
"hover": "const int make2 = 5",
|
||||
"spell": "9:11-9:16|9:1-9:20|2|-1",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": ["12:14-12:19|12|-1", "12:14-12:19|64|0"]
|
||||
}, {
|
||||
"usr": 14219599523415845943,
|
||||
"detailed_name": "FOO",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "FOO",
|
||||
"hover": "#define FOO(aaa, bbb) \\\n int a();\\\n int a() { return aaa + bbb; }",
|
||||
"spell": "1:9-1:12|1:9-3:32|2|-1",
|
||||
"type": 0,
|
||||
"kind": 255,
|
||||
"parent_kind": 1,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": ["12:1-12:4|64|-1"]
|
||||
}]
|
||||
}
|
||||
*/
|
106
index_tests/macros/foo.cc
Normal file
106
index_tests/macros/foo.cc
Normal file
@ -0,0 +1,106 @@
|
||||
#define A 5
|
||||
#define DISALLOW(type) type(type&&) = delete;
|
||||
|
||||
struct Foo {
|
||||
DISALLOW(Foo);
|
||||
};
|
||||
|
||||
int x = A;
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 13788753348312146871,
|
||||
"detailed_name": "Foo::Foo(Foo &&) = delete",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "Foo",
|
||||
"spell": "5:12-5:15|5:3-5:11|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 9,
|
||||
"parent_kind": 23,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": ["5:12-5:15|64|0"]
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 53,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [10677751717622394455],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 15041163540773201510,
|
||||
"detailed_name": "struct Foo {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Foo",
|
||||
"spell": "4:8-4:11|4:1-6:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [13788753348312146871],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["5:12-5:15|4|-1", "5:12-5:15|64|0"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 1569772797058982873,
|
||||
"detailed_name": "A",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "A",
|
||||
"hover": "#define A 5",
|
||||
"spell": "1:9-1:10|1:9-1:12|2|-1",
|
||||
"type": 0,
|
||||
"kind": 255,
|
||||
"parent_kind": 1,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": ["8:9-8:10|64|-1"]
|
||||
}, {
|
||||
"usr": 4904139678698066671,
|
||||
"detailed_name": "DISALLOW",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "DISALLOW",
|
||||
"hover": "#define DISALLOW(type) type(type&&) = delete;",
|
||||
"spell": "2:9-2:17|2:9-2:46|2|-1",
|
||||
"type": 0,
|
||||
"kind": 255,
|
||||
"parent_kind": 1,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": ["5:3-5:11|64|-1"]
|
||||
}, {
|
||||
"usr": 10677751717622394455,
|
||||
"detailed_name": "int x",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "x",
|
||||
"hover": "int x = A",
|
||||
"spell": "8:5-8:6|8:1-8:10|2|-1",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
49
index_tests/method_declaration.cc
Normal file
49
index_tests/method_declaration.cc
Normal file
@ -0,0 +1,49 @@
|
||||
class Foo {
|
||||
void foo();
|
||||
};
|
||||
|
||||
/*
|
||||
// NOTE: Lack of declaring_type in functions and funcs in Foo is okay, because
|
||||
// those are processed when we find the definition for Foo::foo. Pure
|
||||
// virtuals are treated specially and get added to the type immediately.
|
||||
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 17922201480358737771,
|
||||
"detailed_name": "void Foo::foo()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["2:8-2:11|2:3-2:13|1025|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 15041163540773201510,
|
||||
"detailed_name": "class Foo {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Foo",
|
||||
"spell": "1:7-1:10|1:1-3:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [17922201480358737771],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
48
index_tests/method_definition.cc
Normal file
48
index_tests/method_definition.cc
Normal file
@ -0,0 +1,48 @@
|
||||
class Foo {
|
||||
void foo() const;
|
||||
};
|
||||
|
||||
void Foo::foo() const {}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 6446764306530590711,
|
||||
"detailed_name": "void Foo::foo() const",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo",
|
||||
"spell": "5:11-5:14|5:1-5:25|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 5,
|
||||
"storage": 0,
|
||||
"declarations": ["2:8-2:11|2:3-2:19|1025|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 15041163540773201510,
|
||||
"detailed_name": "class Foo {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Foo",
|
||||
"spell": "1:7-1:10|1:1-3:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [6446764306530590711],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["5:6-5:9|4|-1"]
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
46
index_tests/method_inline_declaration.cc
Normal file
46
index_tests/method_inline_declaration.cc
Normal file
@ -0,0 +1,46 @@
|
||||
class Foo {
|
||||
void foo() {}
|
||||
};
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 17922201480358737771,
|
||||
"detailed_name": "void Foo::foo()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo",
|
||||
"spell": "2:8-2:11|2:3-2:16|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 5,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 15041163540773201510,
|
||||
"detailed_name": "class Foo {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Foo",
|
||||
"spell": "1:7-1:10|1:1-3:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [17922201480358737771],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
87
index_tests/multi_file/funky_enum.cc
Normal file
87
index_tests/multi_file/funky_enum.cc
Normal file
@ -0,0 +1,87 @@
|
||||
enum Foo {
|
||||
#include "funky_enum.h"
|
||||
};
|
||||
|
||||
/*
|
||||
// TODO: In the future try to have better support for types defined across
|
||||
// multiple files.
|
||||
|
||||
OUTPUT: funky_enum.h
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [],
|
||||
"usr2type": [],
|
||||
"usr2var": [{
|
||||
"usr": 439339022761937396,
|
||||
"detailed_name": "A",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "A",
|
||||
"hover": "A = 0",
|
||||
"comments": "This file cannot be built directory. It is included in an enum definition of\nanother file.",
|
||||
"spell": "4:1-4:2|4:1-4:2|1026|-1",
|
||||
"type": 16985894625255407295,
|
||||
"kind": 22,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 8524995777615948802,
|
||||
"detailed_name": "C",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "C",
|
||||
"hover": "C = 2",
|
||||
"comments": "This file cannot be built directory. It is included in an enum definition of\nanother file.",
|
||||
"spell": "6:1-6:2|6:1-6:2|1026|-1",
|
||||
"type": 16985894625255407295,
|
||||
"kind": 22,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 15962370213938840720,
|
||||
"detailed_name": "B",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "B",
|
||||
"hover": "B = 1",
|
||||
"comments": "This file cannot be built directory. It is included in an enum definition of\nanother file.",
|
||||
"spell": "5:1-5:2|5:1-5:2|1026|-1",
|
||||
"type": 16985894625255407295,
|
||||
"kind": 22,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
OUTPUT: funky_enum.cc
|
||||
{
|
||||
"includes": [{
|
||||
"line": 1,
|
||||
"resolved_path": "&funky_enum.h"
|
||||
}],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [],
|
||||
"usr2type": [{
|
||||
"usr": 16985894625255407295,
|
||||
"detailed_name": "enum Foo {}",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "Foo",
|
||||
"spell": "1:6-1:9|1:1-3:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 10,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
6
index_tests/multi_file/funky_enum.h
Normal file
6
index_tests/multi_file/funky_enum.h
Normal file
@ -0,0 +1,6 @@
|
||||
// This file cannot be built directory. It is included in an enum definition of
|
||||
// another file.
|
||||
|
||||
A,
|
||||
B,
|
||||
C
|
18
index_tests/multi_file/header.h
Normal file
18
index_tests/multi_file/header.h
Normal file
@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
struct Base {};
|
||||
|
||||
struct SameFileDerived : Base {};
|
||||
|
||||
using Foo0 = SameFileDerived;
|
||||
|
||||
template <typename T>
|
||||
void Foo1() {}
|
||||
|
||||
template <typename T>
|
||||
struct Foo2 {};
|
||||
|
||||
enum Foo3 { A, B, C };
|
||||
|
||||
int Foo4;
|
||||
static int Foo5;
|
235
index_tests/multi_file/impl.cc
Normal file
235
index_tests/multi_file/impl.cc
Normal file
@ -0,0 +1,235 @@
|
||||
#include "header.h"
|
||||
|
||||
void Impl() {
|
||||
Foo1<int>();
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT: header.h
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 11650481237659640387,
|
||||
"detailed_name": "void Foo1()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "Foo1",
|
||||
"spell": "10:6-10:10|10:1-10:15|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 53,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [2638219001294786365, 8395885290297540138],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 529393482671181129,
|
||||
"detailed_name": "struct Foo2 {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Foo2",
|
||||
"spell": "13:8-13:12|13:1-13:15|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 619345544228965342,
|
||||
"detailed_name": "using Foo0 = SameFileDerived",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Foo0",
|
||||
"spell": "7:7-7:11|7:1-7:29|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 16750616846959666305,
|
||||
"kind": 252,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 4481210672785600703,
|
||||
"detailed_name": "enum Foo3 {}",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "Foo3",
|
||||
"spell": "15:6-15:10|15:1-15:22|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 10,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 8420119006782424779,
|
||||
"detailed_name": "struct Base {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Base",
|
||||
"spell": "3:8-3:12|3:1-3:15|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [16750616846959666305],
|
||||
"instances": [],
|
||||
"uses": ["5:26-5:30|2052|-1"]
|
||||
}, {
|
||||
"usr": 16750616846959666305,
|
||||
"detailed_name": "struct SameFileDerived : Base {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "SameFileDerived",
|
||||
"spell": "5:8-5:23|5:1-5:33|2|-1",
|
||||
"bases": [8420119006782424779],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["7:14-7:29|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 2638219001294786365,
|
||||
"detailed_name": "int Foo4",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "Foo4",
|
||||
"spell": "17:5-17:9|17:1-17:9|2|-1",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 6141718166919284735,
|
||||
"detailed_name": "A",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "A",
|
||||
"hover": "A = 0",
|
||||
"spell": "15:13-15:14|15:13-15:14|1026|-1",
|
||||
"type": 4481210672785600703,
|
||||
"kind": 22,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 7285646116511901840,
|
||||
"detailed_name": "C",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "C",
|
||||
"hover": "C = 2",
|
||||
"spell": "15:19-15:20|15:19-15:20|1026|-1",
|
||||
"type": 4481210672785600703,
|
||||
"kind": 22,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 8395885290297540138,
|
||||
"detailed_name": "static int Foo5",
|
||||
"qual_name_offset": 11,
|
||||
"short_name": "Foo5",
|
||||
"spell": "18:12-18:16|18:1-18:16|2|-1",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 2,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 17716334512218775320,
|
||||
"detailed_name": "B",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "B",
|
||||
"hover": "B = 1",
|
||||
"spell": "15:16-15:17|15:16-15:17|1026|-1",
|
||||
"type": 4481210672785600703,
|
||||
"kind": 22,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
OUTPUT: impl.cc
|
||||
{
|
||||
"includes": [{
|
||||
"line": 0,
|
||||
"resolved_path": "&header.h"
|
||||
}],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 5817708529036841195,
|
||||
"detailed_name": "void Impl()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "Impl",
|
||||
"spell": "3:6-3:10|3:1-5:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": ["4:3-4:7|11650481237659640387|3|16420"],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 11650481237659640387,
|
||||
"detailed_name": "void Foo1()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "Foo1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": ["4:3-4:7|16420|-1"]
|
||||
}],
|
||||
"usr2type": [],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
3
index_tests/multi_file/simple_header.h
Normal file
3
index_tests/multi_file/simple_header.h
Normal file
@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
void header();
|
70
index_tests/multi_file/simple_impl.cc
Normal file
70
index_tests/multi_file/simple_impl.cc
Normal file
@ -0,0 +1,70 @@
|
||||
#include "simple_header.h"
|
||||
|
||||
void impl() {
|
||||
header();
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT: simple_header.h
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 16236105532929924676,
|
||||
"detailed_name": "void header()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "header",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["3:6-3:12|3:1-3:14|1|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [],
|
||||
"usr2var": []
|
||||
}
|
||||
OUTPUT: simple_impl.cc
|
||||
{
|
||||
"includes": [{
|
||||
"line": 0,
|
||||
"resolved_path": "&simple_header.h"
|
||||
}],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 3373269392705484958,
|
||||
"detailed_name": "void impl()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "impl",
|
||||
"spell": "3:6-3:10|3:1-5:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": ["4:3-4:9|16236105532929924676|3|16420"],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 16236105532929924676,
|
||||
"detailed_name": "void header()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "header",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": ["4:3-4:9|16420|-1"]
|
||||
}],
|
||||
"usr2type": [],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
87
index_tests/multi_file/static.cc
Normal file
87
index_tests/multi_file/static.cc
Normal file
@ -0,0 +1,87 @@
|
||||
#include "static.h"
|
||||
|
||||
void Buffer::CreateSharedBuffer() {}
|
||||
|
||||
/*
|
||||
OUTPUT: static.h
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 14576076421851654759,
|
||||
"detailed_name": "static void Buffer::CreateSharedBuffer()",
|
||||
"qual_name_offset": 12,
|
||||
"short_name": "CreateSharedBuffer",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 254,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["4:15-4:33|4:3-4:35|1025|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 9411323049603567600,
|
||||
"detailed_name": "struct Buffer {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Buffer",
|
||||
"spell": "3:8-3:14|3:1-5:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [14576076421851654759],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
OUTPUT: static.cc
|
||||
{
|
||||
"includes": [{
|
||||
"line": 0,
|
||||
"resolved_path": "&static.h"
|
||||
}],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 14576076421851654759,
|
||||
"detailed_name": "static void Buffer::CreateSharedBuffer()",
|
||||
"qual_name_offset": 12,
|
||||
"short_name": "CreateSharedBuffer",
|
||||
"spell": "3:14-3:32|3:1-3:37|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 254,
|
||||
"parent_kind": 23,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 9411323049603567600,
|
||||
"detailed_name": "struct Buffer {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Buffer",
|
||||
"bases": [],
|
||||
"funcs": [14576076421851654759],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["3:6-3:12|4|-1"]
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
5
index_tests/multi_file/static.h
Normal file
5
index_tests/multi_file/static.h
Normal file
@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
struct Buffer {
|
||||
static void CreateSharedBuffer();
|
||||
};
|
28
index_tests/namespaces/anonymous_function.cc
Normal file
28
index_tests/namespaces/anonymous_function.cc
Normal file
@ -0,0 +1,28 @@
|
||||
namespace {
|
||||
void foo();
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 5010253035933134245,
|
||||
"detailed_name": "void (anon ns)::foo()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["2:6-2:9|2:1-2:11|1|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
44
index_tests/namespaces/function_declaration.cc
Normal file
44
index_tests/namespaces/function_declaration.cc
Normal file
@ -0,0 +1,44 @@
|
||||
namespace hello {
|
||||
void foo(int a, int b);
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 18343102288837190527,
|
||||
"detailed_name": "void hello::foo(int a, int b)",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["2:6-2:9|2:1-2:23|1025|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 2029211996748007610,
|
||||
"detailed_name": "namespace hello {}",
|
||||
"qual_name_offset": 10,
|
||||
"short_name": "hello",
|
||||
"bases": [],
|
||||
"funcs": [18343102288837190527],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 3,
|
||||
"parent_kind": 0,
|
||||
"declarations": ["1:11-1:16|1:1-3:2|1|-1"],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
45
index_tests/namespaces/function_definition.cc
Normal file
45
index_tests/namespaces/function_definition.cc
Normal file
@ -0,0 +1,45 @@
|
||||
namespace hello {
|
||||
void foo() {}
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 243328841292951622,
|
||||
"detailed_name": "void hello::foo()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo",
|
||||
"spell": "2:6-2:9|2:1-2:14|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 3,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 2029211996748007610,
|
||||
"detailed_name": "namespace hello {}",
|
||||
"qual_name_offset": 10,
|
||||
"short_name": "hello",
|
||||
"bases": [],
|
||||
"funcs": [243328841292951622],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 3,
|
||||
"parent_kind": 0,
|
||||
"declarations": ["1:11-1:16|1:1-3:2|1|-1"],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
63
index_tests/namespaces/method_declaration.cc
Normal file
63
index_tests/namespaces/method_declaration.cc
Normal file
@ -0,0 +1,63 @@
|
||||
namespace hello {
|
||||
class Foo {
|
||||
void foo();
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 10487325150128053272,
|
||||
"detailed_name": "void hello::Foo::foo()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["3:8-3:11|3:3-3:13|1025|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 2029211996748007610,
|
||||
"detailed_name": "namespace hello {}",
|
||||
"qual_name_offset": 10,
|
||||
"short_name": "hello",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [4508214972876735896],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 3,
|
||||
"parent_kind": 0,
|
||||
"declarations": ["1:11-1:16|1:1-5:2|1|-1"],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 4508214972876735896,
|
||||
"detailed_name": "class hello::Foo {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Foo",
|
||||
"spell": "2:7-2:10|2:1-4:2|1026|-1",
|
||||
"bases": [],
|
||||
"funcs": [10487325150128053272],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 3,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
66
index_tests/namespaces/method_definition.cc
Normal file
66
index_tests/namespaces/method_definition.cc
Normal file
@ -0,0 +1,66 @@
|
||||
namespace hello {
|
||||
class Foo {
|
||||
void foo();
|
||||
};
|
||||
|
||||
void Foo::foo() {}
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 10487325150128053272,
|
||||
"detailed_name": "void hello::Foo::foo()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo",
|
||||
"spell": "6:11-6:14|6:1-6:19|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 5,
|
||||
"storage": 0,
|
||||
"declarations": ["3:8-3:11|3:3-3:13|1025|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 2029211996748007610,
|
||||
"detailed_name": "namespace hello {}",
|
||||
"qual_name_offset": 10,
|
||||
"short_name": "hello",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [4508214972876735896],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 3,
|
||||
"parent_kind": 0,
|
||||
"declarations": ["1:11-1:16|1:1-7:2|1|-1"],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 4508214972876735896,
|
||||
"detailed_name": "class hello::Foo {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Foo",
|
||||
"spell": "2:7-2:10|2:1-4:2|1026|-1",
|
||||
"bases": [],
|
||||
"funcs": [10487325150128053272],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 3,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["6:6-6:9|4|-1"]
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
64
index_tests/namespaces/method_inline_declaration.cc
Normal file
64
index_tests/namespaces/method_inline_declaration.cc
Normal file
@ -0,0 +1,64 @@
|
||||
namespace hello {
|
||||
class Foo {
|
||||
void foo() {}
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 10487325150128053272,
|
||||
"detailed_name": "void hello::Foo::foo()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo",
|
||||
"spell": "3:8-3:11|3:3-3:16|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 5,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 2029211996748007610,
|
||||
"detailed_name": "namespace hello {}",
|
||||
"qual_name_offset": 10,
|
||||
"short_name": "hello",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [4508214972876735896],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 3,
|
||||
"parent_kind": 0,
|
||||
"declarations": ["1:11-1:16|1:1-5:2|1|-1"],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 4508214972876735896,
|
||||
"detailed_name": "class hello::Foo {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Foo",
|
||||
"spell": "2:7-2:10|2:1-4:2|1026|-1",
|
||||
"bases": [],
|
||||
"funcs": [10487325150128053272],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 3,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
162
index_tests/namespaces/namespace_alias.cc
Normal file
162
index_tests/namespaces/namespace_alias.cc
Normal file
@ -0,0 +1,162 @@
|
||||
namespace foo {
|
||||
namespace bar {
|
||||
namespace baz {
|
||||
int qux = 42;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace fbz = foo::bar::baz;
|
||||
|
||||
void func() {
|
||||
int a = foo::bar::baz::qux;
|
||||
int b = fbz::qux;
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 10818727483146447186,
|
||||
"detailed_name": "void func()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "func",
|
||||
"spell": "11:6-11:10|11:1-14:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [6030927277961448585, 7657277353101371136],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 53,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [15042442838933090518, 6030927277961448585, 7657277353101371136],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 926793467007732869,
|
||||
"detailed_name": "namespace foo {}",
|
||||
"qual_name_offset": 10,
|
||||
"short_name": "foo",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [17805385787823406700],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 3,
|
||||
"parent_kind": 0,
|
||||
"declarations": ["1:11-1:14|1:1-7:2|1|-1"],
|
||||
"derived": [17805385787823406700],
|
||||
"instances": [],
|
||||
"uses": ["9:17-9:20|4|-1", "12:11-12:14|4|-1"]
|
||||
}, {
|
||||
"usr": 11879713791858506216,
|
||||
"detailed_name": "namespace fbz = foo::bar::baz",
|
||||
"qual_name_offset": 10,
|
||||
"short_name": "fbz",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 14450849931009540802,
|
||||
"kind": 252,
|
||||
"parent_kind": 0,
|
||||
"declarations": ["9:11-9:14|9:1-9:30|1|-1"],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["13:11-13:14|4|-1"]
|
||||
}, {
|
||||
"usr": 14450849931009540802,
|
||||
"detailed_name": "namespace foo::bar::baz {}",
|
||||
"qual_name_offset": 10,
|
||||
"short_name": "baz",
|
||||
"bases": [17805385787823406700],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [{
|
||||
"L": 15042442838933090518,
|
||||
"R": -1
|
||||
}],
|
||||
"alias_of": 0,
|
||||
"kind": 3,
|
||||
"parent_kind": 0,
|
||||
"declarations": ["3:20-3:23|3:10-5:11|1025|-1"],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["9:27-9:30|4|-1", "12:21-12:24|4|-1"]
|
||||
}, {
|
||||
"usr": 17805385787823406700,
|
||||
"detailed_name": "namespace foo::bar {}",
|
||||
"qual_name_offset": 10,
|
||||
"short_name": "bar",
|
||||
"bases": [926793467007732869],
|
||||
"funcs": [],
|
||||
"types": [14450849931009540802],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 3,
|
||||
"parent_kind": 0,
|
||||
"declarations": ["2:15-2:18|2:5-6:6|1025|-1"],
|
||||
"derived": [14450849931009540802],
|
||||
"instances": [],
|
||||
"uses": ["9:22-9:25|4|-1", "12:16-12:19|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 6030927277961448585,
|
||||
"detailed_name": "int a",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "a",
|
||||
"hover": "int a = foo::bar::baz::qux",
|
||||
"spell": "12:7-12:8|12:3-12:29|2|-1",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 12,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 7657277353101371136,
|
||||
"detailed_name": "int b",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "b",
|
||||
"hover": "int b = fbz::qux",
|
||||
"spell": "13:7-13:8|13:3-13:19|2|-1",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 12,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 15042442838933090518,
|
||||
"detailed_name": "int foo::bar::baz::qux",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "qux",
|
||||
"hover": "int foo::bar::baz::qux = 42",
|
||||
"spell": "4:18-4:21|4:14-4:26|1026|-1",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 3,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": ["12:26-12:29|12|-1", "13:16-13:19|12|-1"]
|
||||
}]
|
||||
}
|
||||
*/
|
113
index_tests/namespaces/namespace_reference.cc
Normal file
113
index_tests/namespaces/namespace_reference.cc
Normal file
@ -0,0 +1,113 @@
|
||||
namespace ns {
|
||||
int Foo;
|
||||
void Accept(int a) {}
|
||||
}
|
||||
|
||||
void Runner() {
|
||||
ns::Accept(ns::Foo);
|
||||
using namespace ns;
|
||||
Accept(Foo);
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 631910859630953711,
|
||||
"detailed_name": "void Runner()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "Runner",
|
||||
"spell": "6:6-6:12|6:1-10:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": ["7:7-7:13|17328473273923617489|3|16420", "9:3-9:9|17328473273923617489|3|16420"],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 17328473273923617489,
|
||||
"detailed_name": "void ns::Accept(int a)",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "Accept",
|
||||
"spell": "3:8-3:14|3:3-3:24|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [3649375698083002347],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 3,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": ["7:7-7:13|16420|-1", "9:3-9:9|16420|-1"]
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 53,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [12898699035586282159, 3649375698083002347],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 11072669167287398027,
|
||||
"detailed_name": "namespace ns {}",
|
||||
"qual_name_offset": 10,
|
||||
"short_name": "ns",
|
||||
"bases": [],
|
||||
"funcs": [17328473273923617489],
|
||||
"types": [],
|
||||
"vars": [{
|
||||
"L": 12898699035586282159,
|
||||
"R": -1
|
||||
}],
|
||||
"alias_of": 0,
|
||||
"kind": 3,
|
||||
"parent_kind": 0,
|
||||
"declarations": ["1:11-1:13|1:1-4:2|1|-1"],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["7:3-7:5|4|-1", "7:14-7:16|4|-1", "8:19-8:21|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 3649375698083002347,
|
||||
"detailed_name": "int a",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "a",
|
||||
"spell": "3:19-3:20|3:15-3:20|1026|-1",
|
||||
"type": 53,
|
||||
"kind": 253,
|
||||
"parent_kind": 12,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 12898699035586282159,
|
||||
"detailed_name": "int ns::Foo",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "Foo",
|
||||
"spell": "2:7-2:10|2:3-2:10|1026|-1",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 3,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": ["7:18-7:21|12|-1", "9:10-9:13|12|-1"]
|
||||
}]
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
184
index_tests/objective-c/class.m
Normal file
184
index_tests/objective-c/class.m
Normal file
@ -0,0 +1,184 @@
|
||||
@interface AClass
|
||||
+ (void)test;
|
||||
- (void)anInstanceMethod;
|
||||
@property (nonatomic) int aProp;
|
||||
@end
|
||||
|
||||
@implementation AClass
|
||||
+ (void)test {}
|
||||
- (void)anInstanceMethod {}
|
||||
@end
|
||||
|
||||
int main(void)
|
||||
{
|
||||
AClass *instance = [AClass init];
|
||||
[instance anInstanceMethod];
|
||||
instance.aProp = 12;
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_by_preprocessor": [],
|
||||
"types": [{
|
||||
"id": 0,
|
||||
"usr": 11832280568361305387,
|
||||
"detailed_name": "AClass",
|
||||
"short_name": "AClass",
|
||||
"kind": 7,
|
||||
"spell": "7:17-7:23|-1|1|2",
|
||||
"extent": "7:1-10:2|-1|1|0",
|
||||
"parents": [],
|
||||
"derived": [],
|
||||
"types": [],
|
||||
"funcs": [],
|
||||
"vars": [],
|
||||
"instances": [2],
|
||||
"uses": ["14:3-14:9|-1|1|4", "14:23-14:29|-1|1|4"]
|
||||
}, {
|
||||
"id": 1,
|
||||
"usr": 17,
|
||||
"detailed_name": "",
|
||||
"short_name": "",
|
||||
"kind": 0,
|
||||
"parents": [],
|
||||
"derived": [],
|
||||
"types": [],
|
||||
"funcs": [],
|
||||
"vars": [],
|
||||
"instances": [0, 1],
|
||||
"uses": []
|
||||
}],
|
||||
"funcs": [{
|
||||
"id": 0,
|
||||
"usr": 12775970426728664910,
|
||||
"detailed_name": "AClass::test",
|
||||
"short_name": "test",
|
||||
"kind": 17,
|
||||
"storage": 0,
|
||||
"declarations": [{
|
||||
"spelling": "2:11-2:15",
|
||||
"extent": "2:3-2:16",
|
||||
"content": "+ (void)test;",
|
||||
"param_spellings": []
|
||||
}],
|
||||
"spell": "8:9-8:13|-1|1|2",
|
||||
"extent": "8:1-8:16|-1|1|0",
|
||||
"base": [],
|
||||
"derived": [],
|
||||
"locals": [],
|
||||
"uses": [],
|
||||
"callees": []
|
||||
}, {
|
||||
"id": 1,
|
||||
"usr": 4096877434426330804,
|
||||
"detailed_name": "AClass::anInstanceMethod",
|
||||
"short_name": "anInstanceMethod",
|
||||
"kind": 16,
|
||||
"storage": 0,
|
||||
"declarations": [{
|
||||
"spelling": "3:11-3:27",
|
||||
"extent": "3:3-3:28",
|
||||
"content": "- (void)anInstanceMethod;",
|
||||
"param_spellings": []
|
||||
}],
|
||||
"spell": "9:9-9:25|-1|1|2",
|
||||
"extent": "9:1-9:28|-1|1|0",
|
||||
"base": [],
|
||||
"derived": [],
|
||||
"locals": [],
|
||||
"uses": ["15:13-15:29|4|3|64"],
|
||||
"callees": []
|
||||
}, {
|
||||
"id": 2,
|
||||
"usr": 12774569141855220778,
|
||||
"detailed_name": "AClass::aProp",
|
||||
"short_name": "aProp",
|
||||
"kind": 16,
|
||||
"storage": 0,
|
||||
"declarations": [{
|
||||
"spelling": "0:0-0:0",
|
||||
"extent": "4:29-4:34",
|
||||
"content": "aProp",
|
||||
"param_spellings": []
|
||||
}],
|
||||
"extent": "4:29-4:34|-1|1|0",
|
||||
"base": [],
|
||||
"derived": [],
|
||||
"locals": [],
|
||||
"uses": [],
|
||||
"callees": []
|
||||
}, {
|
||||
"id": 3,
|
||||
"usr": 17992064398538597892,
|
||||
"detailed_name": "AClass::setAProp:",
|
||||
"short_name": "setAProp:",
|
||||
"kind": 16,
|
||||
"storage": 0,
|
||||
"declarations": [{
|
||||
"spelling": "0:0-0:0",
|
||||
"extent": "4:29-4:34",
|
||||
"content": "aProp",
|
||||
"param_spellings": ["4:29-4:34"]
|
||||
}],
|
||||
"extent": "4:29-4:34|-1|1|0",
|
||||
"base": [],
|
||||
"derived": [],
|
||||
"locals": [],
|
||||
"uses": ["0:0-0:0|4|3|64"],
|
||||
"callees": []
|
||||
}, {
|
||||
"id": 4,
|
||||
"usr": 7033269674615638282,
|
||||
"detailed_name": "int main()",
|
||||
"short_name": "main",
|
||||
"kind": 12,
|
||||
"storage": 1,
|
||||
"declarations": [],
|
||||
"spell": "12:5-12:9|-1|1|2",
|
||||
"extent": "12:1-17:2|-1|1|0",
|
||||
"base": [],
|
||||
"derived": [],
|
||||
"locals": [],
|
||||
"uses": [],
|
||||
"callees": ["15:13-15:29|1|3|64", "0:0-0:0|3|3|64"]
|
||||
}],
|
||||
"vars": [{
|
||||
"id": 0,
|
||||
"usr": 14842397373703114213,
|
||||
"detailed_name": "int AClass::aProp",
|
||||
"short_name": "aProp",
|
||||
"declarations": ["4:29-4:34|-1|1|1"],
|
||||
"type": 1,
|
||||
"uses": ["16:12-16:17|4|3|4"],
|
||||
"kind": 19,
|
||||
"storage": 0
|
||||
}, {
|
||||
"id": 1,
|
||||
"usr": 17112602610366149042,
|
||||
"detailed_name": "int AClass::_aProp",
|
||||
"short_name": "_aProp",
|
||||
"declarations": [],
|
||||
"spell": "4:29-4:34|-1|1|2",
|
||||
"extent": "4:29-4:34|-1|1|0",
|
||||
"type": 1,
|
||||
"uses": [],
|
||||
"kind": 14,
|
||||
"storage": 0
|
||||
}, {
|
||||
"id": 2,
|
||||
"usr": 6849095699869081177,
|
||||
"detailed_name": "AClass *instance",
|
||||
"short_name": "instance",
|
||||
"hover": "AClass *instance = [AClass init]",
|
||||
"declarations": [],
|
||||
"spell": "14:11-14:19|4|3|2",
|
||||
"extent": "14:3-14:35|4|3|2",
|
||||
"type": 0,
|
||||
"uses": ["15:4-15:12|4|3|4", "16:3-16:11|4|3|4"],
|
||||
"kind": 13,
|
||||
"storage": 1
|
||||
}]
|
||||
}
|
||||
*/
|
92
index_tests/operators/operator.cc
Normal file
92
index_tests/operators/operator.cc
Normal file
@ -0,0 +1,92 @@
|
||||
class Foo {
|
||||
void operator()(int) { }
|
||||
void operator()(bool);
|
||||
int operator()(int a, int b);
|
||||
};
|
||||
|
||||
Foo &operator += (const Foo&, const int&);
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 3545323327609582678,
|
||||
"detailed_name": "void Foo::operator()(bool)",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "operator()",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["3:8-3:16|3:3-3:24|1025|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 3986818119971932909,
|
||||
"detailed_name": "int Foo::operator()(int a, int b)",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "operator()",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["4:7-4:15|4:3-4:31|1025|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 7874436189163837815,
|
||||
"detailed_name": "void Foo::operator()(int)",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "operator()",
|
||||
"spell": "2:8-2:18|2:3-2:27|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 5,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 8288368475529136092,
|
||||
"detailed_name": "Foo &operator+=(const Foo &, const int &)",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "operator+=",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["7:6-7:14|7:1-7:42|1|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 15041163540773201510,
|
||||
"detailed_name": "class Foo {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Foo",
|
||||
"spell": "1:7-1:10|1:1-5:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [7874436189163837815, 3545323327609582678, 3986818119971932909],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["7:1-7:4|4|-1", "7:25-7:28|4|-1"]
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
168
index_tests/outline/static_function_in_type.cc
Normal file
168
index_tests/outline/static_function_in_type.cc
Normal file
@ -0,0 +1,168 @@
|
||||
#include "static_function_in_type.h"
|
||||
|
||||
namespace ns {
|
||||
// static
|
||||
void Foo::Register(Manager* m) {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT: static_function_in_type.h
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 17019747379608639279,
|
||||
"detailed_name": "static void ns::Foo::Register(ns::Manager *)",
|
||||
"qual_name_offset": 12,
|
||||
"short_name": "Register",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 254,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["6:15-6:23|6:3-6:33|1025|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 1972401196751872203,
|
||||
"detailed_name": "class ns::Manager",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Manager",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": ["3:7-3:14|3:1-3:14|1025|-1"],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["6:24-6:31|4|-1"]
|
||||
}, {
|
||||
"usr": 11072669167287398027,
|
||||
"detailed_name": "namespace ns {}",
|
||||
"qual_name_offset": 10,
|
||||
"short_name": "ns",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [1972401196751872203, 17262466801709381811],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 3,
|
||||
"parent_kind": 0,
|
||||
"declarations": ["1:11-1:13|1:1-9:2|1|-1"],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 17262466801709381811,
|
||||
"detailed_name": "struct ns::Foo {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Foo",
|
||||
"spell": "5:8-5:11|5:1-7:2|1026|-1",
|
||||
"bases": [],
|
||||
"funcs": [17019747379608639279],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 3,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
OUTPUT: static_function_in_type.cc
|
||||
{
|
||||
"includes": [{
|
||||
"line": 0,
|
||||
"resolved_path": "&static_function_in_type.h"
|
||||
}],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 17019747379608639279,
|
||||
"detailed_name": "static void ns::Foo::Register(ns::Manager *)",
|
||||
"qual_name_offset": 12,
|
||||
"short_name": "Register",
|
||||
"spell": "5:11-5:19|5:1-6:2|1026|-1",
|
||||
"comments": "static",
|
||||
"bases": [],
|
||||
"vars": [13569879755236306838],
|
||||
"callees": [],
|
||||
"kind": 254,
|
||||
"parent_kind": 23,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 1972401196751872203,
|
||||
"detailed_name": "class ns::Manager",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Manager",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [13569879755236306838],
|
||||
"uses": ["5:20-5:27|4|-1"]
|
||||
}, {
|
||||
"usr": 11072669167287398027,
|
||||
"detailed_name": "namespace ns {}",
|
||||
"qual_name_offset": 10,
|
||||
"short_name": "ns",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 3,
|
||||
"parent_kind": 0,
|
||||
"declarations": ["3:11-3:13|3:1-7:2|1|-1"],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 17262466801709381811,
|
||||
"detailed_name": "struct ns::Foo {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Foo",
|
||||
"bases": [],
|
||||
"funcs": [17019747379608639279],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["5:6-5:9|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 13569879755236306838,
|
||||
"detailed_name": "ns::Manager *m",
|
||||
"qual_name_offset": 13,
|
||||
"short_name": "m",
|
||||
"spell": "5:29-5:30|5:20-5:30|1026|-1",
|
||||
"type": 1972401196751872203,
|
||||
"kind": 253,
|
||||
"parent_kind": 254,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
9
index_tests/outline/static_function_in_type.h
Normal file
9
index_tests/outline/static_function_in_type.h
Normal file
@ -0,0 +1,9 @@
|
||||
namespace ns {
|
||||
|
||||
class Manager;
|
||||
|
||||
struct Foo {
|
||||
static void Register(Manager*);
|
||||
};
|
||||
|
||||
} // namespace ns
|
28
index_tests/preprocessor/include_guard.cc
Normal file
28
index_tests/preprocessor/include_guard.cc
Normal file
@ -0,0 +1,28 @@
|
||||
#ifndef FOO
|
||||
#define FOO
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [],
|
||||
"usr2type": [],
|
||||
"usr2var": [{
|
||||
"usr": 14219599523415845943,
|
||||
"detailed_name": "FOO",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "FOO",
|
||||
"hover": "#define FOO",
|
||||
"spell": "2:9-2:12|2:9-2:12|2|-1",
|
||||
"type": 0,
|
||||
"kind": 255,
|
||||
"parent_kind": 1,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
25
index_tests/preprocessor/skipped.cc
Normal file
25
index_tests/preprocessor/skipped.cc
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
#ifdef FOOBAR
|
||||
void hello();
|
||||
#endif
|
||||
|
||||
#if false
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(OS_FOO)
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": ["2:1-5:1", "6:1-11:1", "12:1-15:1"],
|
||||
"usr2func": [],
|
||||
"usr2type": [],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
68
index_tests/templates/func_specialized_template_param.cc
Normal file
68
index_tests/templates/func_specialized_template_param.cc
Normal file
@ -0,0 +1,68 @@
|
||||
template<class T>
|
||||
class Template {};
|
||||
|
||||
struct Foo {
|
||||
void Bar(Template<double>&);
|
||||
};
|
||||
|
||||
void Foo::Bar(Template<double>&) {}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 8412238651648388423,
|
||||
"detailed_name": "void Foo::Bar(Template<double> &)",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "Bar",
|
||||
"spell": "8:11-8:14|8:1-8:36|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 23,
|
||||
"storage": 0,
|
||||
"declarations": ["5:8-5:11|5:3-5:30|1025|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 15041163540773201510,
|
||||
"detailed_name": "struct Foo {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Foo",
|
||||
"spell": "4:8-4:11|4:1-6:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [8412238651648388423],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["8:6-8:9|4|-1"]
|
||||
}, {
|
||||
"usr": 17107291254533526269,
|
||||
"detailed_name": "class Template {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Template",
|
||||
"spell": "2:7-2:15|2:1-2:18|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["5:12-5:20|4|-1", "8:15-8:23|4|-1"]
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
137
index_tests/templates/implicit_variable_instantiation.cc
Normal file
137
index_tests/templates/implicit_variable_instantiation.cc
Normal file
@ -0,0 +1,137 @@
|
||||
namespace ns {
|
||||
enum VarType {};
|
||||
|
||||
template<typename _>
|
||||
struct Holder {
|
||||
static constexpr VarType static_var = (VarType)0x0;
|
||||
};
|
||||
|
||||
template<typename _>
|
||||
const typename VarType Holder<_>::static_var;
|
||||
|
||||
|
||||
int Foo = Holder<int>::static_var;
|
||||
int Foo2 = Holder<int>::static_var;
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [],
|
||||
"usr2type": [{
|
||||
"usr": 53,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [12898699035586282159, 9008550860229740818],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 1532099849728741556,
|
||||
"detailed_name": "enum ns::VarType {}",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "VarType",
|
||||
"spell": "2:8-2:15|2:3-2:18|1026|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 10,
|
||||
"parent_kind": 3,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [4731849186641714451, 4731849186641714451],
|
||||
"uses": ["6:22-6:29|4|-1", "6:44-6:51|4|-1", "10:18-10:25|4|-1"]
|
||||
}, {
|
||||
"usr": 11072669167287398027,
|
||||
"detailed_name": "namespace ns {}",
|
||||
"qual_name_offset": 10,
|
||||
"short_name": "ns",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [1532099849728741556, 12688716854043726585],
|
||||
"vars": [{
|
||||
"L": 12898699035586282159,
|
||||
"R": -1
|
||||
}, {
|
||||
"L": 9008550860229740818,
|
||||
"R": -1
|
||||
}],
|
||||
"alias_of": 0,
|
||||
"kind": 3,
|
||||
"parent_kind": 0,
|
||||
"declarations": ["1:11-1:13|1:1-15:2|1|-1"],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 12688716854043726585,
|
||||
"detailed_name": "struct ns::Holder {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Holder",
|
||||
"spell": "5:10-5:16|5:3-7:4|1026|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 3,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["10:26-10:32|4|-1", "13:13-13:19|4|-1", "14:14-14:20|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 4731849186641714451,
|
||||
"detailed_name": "static constexpr ns::VarType ns::Holder::static_var",
|
||||
"qual_name_offset": 29,
|
||||
"short_name": "static_var",
|
||||
"hover": "static constexpr ns::VarType ns::Holder::static_var = (VarType)0x0",
|
||||
"spell": "10:37-10:47|9:3-10:47|1026|-1",
|
||||
"type": 1532099849728741556,
|
||||
"kind": 13,
|
||||
"parent_kind": 23,
|
||||
"storage": 2,
|
||||
"declarations": ["6:30-6:40|6:5-6:55|1025|-1"],
|
||||
"uses": ["13:26-13:36|12|-1", "14:27-14:37|12|-1"]
|
||||
}, {
|
||||
"usr": 9008550860229740818,
|
||||
"detailed_name": "int ns::Foo2",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "Foo2",
|
||||
"hover": "int ns::Foo2 = Holder<int>::static_var",
|
||||
"spell": "14:7-14:11|14:3-14:37|1026|-1",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 3,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 12898699035586282159,
|
||||
"detailed_name": "int ns::Foo",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "Foo",
|
||||
"hover": "int ns::Foo = Holder<int>::static_var",
|
||||
"spell": "13:7-13:10|13:3-13:36|1026|-1",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 3,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
110
index_tests/templates/member_ref_in_template.cc
Normal file
110
index_tests/templates/member_ref_in_template.cc
Normal file
@ -0,0 +1,110 @@
|
||||
template <class T>
|
||||
struct C {
|
||||
T x;
|
||||
void bar();
|
||||
};
|
||||
|
||||
template <class T>
|
||||
void foo() {
|
||||
C<T> d;
|
||||
d.x; // spelling range is empty, use cursor extent for range
|
||||
d.bar(); // spelling range is empty, use cursor extent for range
|
||||
|
||||
auto e = new C<T>;
|
||||
e->x; // `x` seems not exposed by libclang
|
||||
e->bar(); // `bar` seems not exposed by libclang
|
||||
}
|
||||
|
||||
/*
|
||||
EXTRA_FLAGS:
|
||||
-fms-extensions
|
||||
-fms-compatibility
|
||||
-fdelayed-template-parsing
|
||||
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 6875364467121018690,
|
||||
"detailed_name": "void foo()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo",
|
||||
"spell": "8:6-8:9|8:1-8:11|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 8905286151237717330,
|
||||
"detailed_name": "void C::bar()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "bar",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["4:8-4:11|4:3-4:13|1025|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 8402783583255987702,
|
||||
"detailed_name": "struct C {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "C",
|
||||
"spell": "2:8-2:9|2:1-5:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [8905286151237717330],
|
||||
"types": [],
|
||||
"vars": [{
|
||||
"L": 5866801090710377175,
|
||||
"R": -1
|
||||
}],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 14750650276757822712,
|
||||
"detailed_name": "T",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "T",
|
||||
"spell": "1:17-1:18|1:11-1:18|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 26,
|
||||
"parent_kind": 5,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [5866801090710377175],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 5866801090710377175,
|
||||
"detailed_name": "T C::x",
|
||||
"qual_name_offset": 2,
|
||||
"short_name": "x",
|
||||
"spell": "3:5-3:6|3:3-3:6|1026|-1",
|
||||
"type": 14750650276757822712,
|
||||
"kind": 8,
|
||||
"parent_kind": 23,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
@ -0,0 +1,119 @@
|
||||
namespace ns {
|
||||
template<typename T>
|
||||
struct Foo {
|
||||
template<typename R>
|
||||
static int foo() {
|
||||
return 3;
|
||||
}
|
||||
};
|
||||
|
||||
int a = Foo<int>::foo<float>();
|
||||
int b = Foo<bool>::foo<double>();
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 8221803074608342407,
|
||||
"detailed_name": "static int ns::Foo::foo()",
|
||||
"qual_name_offset": 11,
|
||||
"short_name": "foo",
|
||||
"spell": "5:16-5:19|5:5-7:6|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 254,
|
||||
"parent_kind": 23,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": ["10:21-10:24|36|-1", "11:22-11:25|36|-1"]
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 53,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [15768138241775955040, 3182917058194750998],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 11072669167287398027,
|
||||
"detailed_name": "namespace ns {}",
|
||||
"qual_name_offset": 10,
|
||||
"short_name": "ns",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [14042997404480181958],
|
||||
"vars": [{
|
||||
"L": 15768138241775955040,
|
||||
"R": -1
|
||||
}, {
|
||||
"L": 3182917058194750998,
|
||||
"R": -1
|
||||
}],
|
||||
"alias_of": 0,
|
||||
"kind": 3,
|
||||
"parent_kind": 0,
|
||||
"declarations": ["1:11-1:13|1:1-12:2|1|-1"],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 14042997404480181958,
|
||||
"detailed_name": "struct ns::Foo {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Foo",
|
||||
"spell": "3:10-3:13|3:3-8:4|1026|-1",
|
||||
"bases": [],
|
||||
"funcs": [8221803074608342407],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 3,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["10:11-10:14|4|-1", "11:11-11:14|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 3182917058194750998,
|
||||
"detailed_name": "int ns::b",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "b",
|
||||
"hover": "int ns::b = Foo<bool>::foo<double>()",
|
||||
"spell": "11:7-11:8|11:3-11:35|1026|-1",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 3,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 15768138241775955040,
|
||||
"detailed_name": "int ns::a",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "a",
|
||||
"hover": "int ns::a = Foo<int>::foo<float>()",
|
||||
"spell": "10:7-10:8|10:3-10:33|1026|-1",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 3,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
@ -0,0 +1,81 @@
|
||||
namespace ns {
|
||||
template<typename T>
|
||||
class Foo {};
|
||||
|
||||
Foo<int> a;
|
||||
Foo<bool> b;
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [],
|
||||
"usr2type": [{
|
||||
"usr": 11072669167287398027,
|
||||
"detailed_name": "namespace ns {}",
|
||||
"qual_name_offset": 10,
|
||||
"short_name": "ns",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [14042997404480181958],
|
||||
"vars": [{
|
||||
"L": 15768138241775955040,
|
||||
"R": -1
|
||||
}, {
|
||||
"L": 3182917058194750998,
|
||||
"R": -1
|
||||
}],
|
||||
"alias_of": 0,
|
||||
"kind": 3,
|
||||
"parent_kind": 0,
|
||||
"declarations": ["1:11-1:13|1:1-7:2|1|-1"],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 14042997404480181958,
|
||||
"detailed_name": "class ns::Foo {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Foo",
|
||||
"spell": "3:9-3:12|3:3-3:15|1026|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 3,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [15768138241775955040, 3182917058194750998],
|
||||
"uses": ["5:3-5:6|4|-1", "6:3-6:6|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 3182917058194750998,
|
||||
"detailed_name": "Foo<bool> ns::b",
|
||||
"qual_name_offset": 10,
|
||||
"short_name": "b",
|
||||
"spell": "6:13-6:14|6:3-6:14|1026|-1",
|
||||
"type": 14042997404480181958,
|
||||
"kind": 13,
|
||||
"parent_kind": 3,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 15768138241775955040,
|
||||
"detailed_name": "Foo<int> ns::a",
|
||||
"qual_name_offset": 9,
|
||||
"short_name": "a",
|
||||
"spell": "5:12-5:13|5:3-5:13|1026|-1",
|
||||
"type": 14042997404480181958,
|
||||
"kind": 13,
|
||||
"parent_kind": 3,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
422
index_tests/templates/specialization.cc
Normal file
422
index_tests/templates/specialization.cc
Normal file
@ -0,0 +1,422 @@
|
||||
template<class T>
|
||||
class function;
|
||||
|
||||
template<typename T, typename... Args>
|
||||
class function<T(Args...)> {};
|
||||
|
||||
function<void(int)> f;
|
||||
|
||||
template<typename T> class allocator;
|
||||
|
||||
template<typename T, typename Alloc = allocator<T> >
|
||||
class vector {
|
||||
void clear();
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class vector<T*> {};
|
||||
|
||||
struct Z1 {};
|
||||
|
||||
template class vector<Z1>;
|
||||
|
||||
struct Z2 {};
|
||||
|
||||
template<>
|
||||
class vector<Z2> {
|
||||
void clear();
|
||||
};
|
||||
|
||||
vector<char> vc;
|
||||
vector<int*> vip;
|
||||
vector<Z1> vz1;
|
||||
vector<Z2> vz2;
|
||||
|
||||
enum Enum {
|
||||
Enum0, Enum1
|
||||
};
|
||||
template <typename T, int I, Enum, int E>
|
||||
void foo(T Value) {}
|
||||
|
||||
static const int kOnst = 7;
|
||||
template <>
|
||||
void foo<float, 9, Enum0, kOnst + 7>(float Value);
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 3861597222587452538,
|
||||
"detailed_name": "template<> void foo<float, 9, Enum0, 14>(float Value)",
|
||||
"qual_name_offset": 16,
|
||||
"short_name": "foo",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["43:6-43:9|42:1-43:50|1|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 6113470698424012876,
|
||||
"detailed_name": "void vector<Z2, allocator<Z2> >::clear()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "clear",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["27:8-27:13|27:3-27:15|1025|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 17498190318698490707,
|
||||
"detailed_name": "void foo(T Value)",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo",
|
||||
"spell": "39:6-39:9|39:1-39:21|2|-1",
|
||||
"bases": [],
|
||||
"vars": [17826688417349629938],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 18107614608385228556,
|
||||
"detailed_name": "void vector::clear()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "clear",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["13:8-13:13|13:3-13:15|1025|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 53,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [13914496963221806870],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 218068462278884837,
|
||||
"detailed_name": "template <typename T, typename ...Args> class function<type-parameter-0-0 (type-parameter-0-1...)> {}",
|
||||
"qual_name_offset": 46,
|
||||
"short_name": "function",
|
||||
"spell": "5:7-5:15|4:1-5:30|2|-1",
|
||||
"bases": [15019211479263750068],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [2933643612409209903],
|
||||
"uses": ["7:1-7:9|4|-1"]
|
||||
}, {
|
||||
"usr": 1663022413889915338,
|
||||
"detailed_name": "template<> class vector<Z2, allocator<Z2>> {}",
|
||||
"qual_name_offset": 17,
|
||||
"short_name": "vector",
|
||||
"spell": "26:7-26:13|25:1-28:2|2|-1",
|
||||
"bases": [7440942986741176606],
|
||||
"funcs": [6113470698424012876],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [15931696253641284761],
|
||||
"uses": ["26:7-26:13|4|-1", "33:1-33:7|4|-1"]
|
||||
}, {
|
||||
"usr": 5760043510674081814,
|
||||
"detailed_name": "struct Z1 {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Z1",
|
||||
"spell": "19:8-19:10|19:1-19:13|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["21:23-21:25|4|-1", "32:8-32:10|4|-1"]
|
||||
}, {
|
||||
"usr": 7440942986741176606,
|
||||
"detailed_name": "class vector {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "vector",
|
||||
"spell": "12:7-12:13|12:1-14:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [18107614608385228556],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [16155717907537731864, 1663022413889915338],
|
||||
"instances": [5792869548777559988],
|
||||
"uses": ["17:7-17:13|4|-1", "21:16-21:22|4|-1", "30:1-30:7|4|-1", "32:1-32:7|4|-1"]
|
||||
}, {
|
||||
"usr": 9201299975592934124,
|
||||
"detailed_name": "enum Enum {}",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "Enum",
|
||||
"spell": "35:6-35:10|35:1-37:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 10,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 10124869160135436852,
|
||||
"detailed_name": "struct Z2 {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Z2",
|
||||
"spell": "23:8-23:10|23:1-23:13|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["26:14-26:16|4|-1", "33:8-33:10|4|-1"]
|
||||
}, {
|
||||
"usr": 14111105212951082474,
|
||||
"detailed_name": "T",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "T",
|
||||
"spell": "38:20-38:21|38:11-38:21|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 26,
|
||||
"parent_kind": 5,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [17826688417349629938],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 15019211479263750068,
|
||||
"detailed_name": "class function",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "function",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": ["2:7-2:15|2:1-2:15|1|-1"],
|
||||
"derived": [218068462278884837],
|
||||
"instances": [],
|
||||
"uses": ["5:7-5:15|4|-1"]
|
||||
}, {
|
||||
"usr": 15440970074034693939,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [3566687051827176322],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 15695704394170757108,
|
||||
"detailed_name": "class allocator",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "allocator",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": ["9:28-9:37|9:22-9:37|1|-1"],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["11:39-11:48|4|-1"]
|
||||
}, {
|
||||
"usr": 16155717907537731864,
|
||||
"detailed_name": "template <typename T> class vector<type-parameter-0-0 *, allocator<type-parameter-0-0 *>> {}",
|
||||
"qual_name_offset": 28,
|
||||
"short_name": "vector",
|
||||
"spell": "17:7-17:13|16:1-17:20|2|-1",
|
||||
"bases": [7440942986741176606],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [86949563628772958],
|
||||
"uses": ["31:1-31:7|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 86949563628772958,
|
||||
"detailed_name": "vector<int *> vip",
|
||||
"qual_name_offset": 14,
|
||||
"short_name": "vip",
|
||||
"spell": "31:14-31:17|31:1-31:17|2|-1",
|
||||
"type": 16155717907537731864,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 2933643612409209903,
|
||||
"detailed_name": "function<void (int)> f",
|
||||
"qual_name_offset": 21,
|
||||
"short_name": "f",
|
||||
"spell": "7:21-7:22|7:1-7:22|2|-1",
|
||||
"type": 218068462278884837,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 3566687051827176322,
|
||||
"detailed_name": "vector<Z1> vz1",
|
||||
"qual_name_offset": 11,
|
||||
"short_name": "vz1",
|
||||
"spell": "32:12-32:15|32:1-32:15|2|-1",
|
||||
"type": 15440970074034693939,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 4917621020431490070,
|
||||
"detailed_name": "Enum1",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "Enum1",
|
||||
"hover": "Enum1 = 1",
|
||||
"spell": "36:10-36:15|36:10-36:15|1026|-1",
|
||||
"type": 9201299975592934124,
|
||||
"kind": 22,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 5792869548777559988,
|
||||
"detailed_name": "vector<char> vc",
|
||||
"qual_name_offset": 13,
|
||||
"short_name": "vc",
|
||||
"spell": "30:14-30:16|30:1-30:16|2|-1",
|
||||
"type": 7440942986741176606,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 13914496963221806870,
|
||||
"detailed_name": "static const int kOnst",
|
||||
"qual_name_offset": 17,
|
||||
"short_name": "kOnst",
|
||||
"hover": "static const int kOnst = 7",
|
||||
"spell": "41:18-41:23|41:1-41:27|2|-1",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 2,
|
||||
"declarations": [],
|
||||
"uses": ["43:27-43:32|12|-1"]
|
||||
}, {
|
||||
"usr": 15477793821005285152,
|
||||
"detailed_name": "Enum0",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "Enum0",
|
||||
"hover": "Enum0 = 0",
|
||||
"spell": "36:3-36:8|36:3-36:8|1026|-1",
|
||||
"type": 9201299975592934124,
|
||||
"kind": 22,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": ["43:20-43:25|4|-1"]
|
||||
}, {
|
||||
"usr": 15931696253641284761,
|
||||
"detailed_name": "vector<Z2> vz2",
|
||||
"qual_name_offset": 11,
|
||||
"short_name": "vz2",
|
||||
"spell": "33:12-33:15|33:1-33:15|2|-1",
|
||||
"type": 1663022413889915338,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 17826688417349629938,
|
||||
"detailed_name": "T Value",
|
||||
"qual_name_offset": 2,
|
||||
"short_name": "Value",
|
||||
"spell": "39:12-39:17|39:10-39:17|1026|-1",
|
||||
"type": 14111105212951082474,
|
||||
"kind": 253,
|
||||
"parent_kind": 12,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
92
index_tests/templates/specialized_func_definition.cc
Normal file
92
index_tests/templates/specialized_func_definition.cc
Normal file
@ -0,0 +1,92 @@
|
||||
template<class T>
|
||||
class Template {
|
||||
void Foo();
|
||||
};
|
||||
|
||||
template<class T>
|
||||
void Template<T>::Foo() {}
|
||||
|
||||
template<>
|
||||
void Template<void>::Foo() {}
|
||||
|
||||
|
||||
/*
|
||||
// TODO: usage information on Template is bad.
|
||||
// TODO: Foo() should have multiple definitions.
|
||||
|
||||
EXTRA_FLAGS:
|
||||
-fms-compatibility
|
||||
-fdelayed-template-parsing
|
||||
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 6995843774014807426,
|
||||
"detailed_name": "void Template<void>::Foo()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "Foo",
|
||||
"spell": "10:22-10:25|9:1-10:30|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 5,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 11994188353303124840,
|
||||
"detailed_name": "void Template::Foo()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "Foo",
|
||||
"spell": "7:19-7:22|6:1-7:24|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 5,
|
||||
"storage": 0,
|
||||
"declarations": ["3:8-3:11|3:3-3:13|1025|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 17107291254533526269,
|
||||
"detailed_name": "class Template {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Template",
|
||||
"spell": "2:7-2:15|2:1-4:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [11994188353303124840],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["7:6-7:14|4|-1", "10:6-10:14|4|-1"]
|
||||
}, {
|
||||
"usr": 17649312483543982122,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [6995843774014807426],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
@ -0,0 +1,94 @@
|
||||
template<typename T>
|
||||
struct Foo {
|
||||
static int foo() {
|
||||
return 3;
|
||||
}
|
||||
};
|
||||
|
||||
int a = Foo<int>::foo();
|
||||
int b = Foo<bool>::foo();
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 8340731781048851399,
|
||||
"detailed_name": "static int Foo::foo()",
|
||||
"qual_name_offset": 11,
|
||||
"short_name": "foo",
|
||||
"spell": "3:14-3:17|3:3-5:4|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 254,
|
||||
"parent_kind": 23,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": ["8:19-8:22|36|-1", "9:20-9:23|36|-1"]
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 53,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [16721564935990383768, 12028309045033782423],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 10528472276654770367,
|
||||
"detailed_name": "struct Foo {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Foo",
|
||||
"spell": "2:8-2:11|2:1-6:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [8340731781048851399],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["8:9-8:12|4|-1", "9:9-9:12|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 12028309045033782423,
|
||||
"detailed_name": "int b",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "b",
|
||||
"hover": "int b = Foo<bool>::foo()",
|
||||
"spell": "9:5-9:6|9:1-9:25|2|-1",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 16721564935990383768,
|
||||
"detailed_name": "int a",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "a",
|
||||
"hover": "int a = Foo<int>::foo()",
|
||||
"spell": "8:5-8:6|8:1-8:24|2|-1",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
@ -0,0 +1,95 @@
|
||||
template<typename T>
|
||||
struct Foo {
|
||||
template<typename R>
|
||||
static int foo() {
|
||||
return 3;
|
||||
}
|
||||
};
|
||||
|
||||
int a = Foo<int>::foo<float>();
|
||||
int b = Foo<bool>::foo<double>();
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 9034026360701857235,
|
||||
"detailed_name": "static int Foo::foo()",
|
||||
"qual_name_offset": 11,
|
||||
"short_name": "foo",
|
||||
"spell": "4:14-4:17|4:3-6:4|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 254,
|
||||
"parent_kind": 23,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": ["9:19-9:22|36|-1", "10:20-10:23|36|-1"]
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 53,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [16721564935990383768, 12028309045033782423],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 10528472276654770367,
|
||||
"detailed_name": "struct Foo {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Foo",
|
||||
"spell": "2:8-2:11|2:1-7:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [9034026360701857235],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["9:9-9:12|4|-1", "10:9-10:12|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 12028309045033782423,
|
||||
"detailed_name": "int b",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "b",
|
||||
"hover": "int b = Foo<bool>::foo<double>()",
|
||||
"spell": "10:5-10:6|10:1-10:33|2|-1",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 16721564935990383768,
|
||||
"detailed_name": "int a",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "a",
|
||||
"hover": "int a = Foo<int>::foo<float>()",
|
||||
"spell": "9:5-9:6|9:1-9:31|2|-1",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
@ -0,0 +1,131 @@
|
||||
enum A {};
|
||||
enum B {};
|
||||
|
||||
template<typename T>
|
||||
struct Foo {
|
||||
struct Inner {};
|
||||
};
|
||||
|
||||
Foo<A>::Inner a;
|
||||
Foo<B>::Inner b;
|
||||
|
||||
#if false
|
||||
EnumDecl A
|
||||
EnumDecl B
|
||||
ClassTemplate Foo
|
||||
TemplateTypeParameter T
|
||||
StructDecl Inner
|
||||
VarDecl a
|
||||
TemplateRef Foo
|
||||
TypeRef enum A
|
||||
TypeRef struct Foo<enum A>::Inner
|
||||
CallExpr Inner
|
||||
VarDecl b
|
||||
TemplateRef Foo
|
||||
TypeRef enum B
|
||||
TypeRef struct Foo<enum B>::Inner
|
||||
CallExpr Inner
|
||||
#endif
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": ["12:1-29:1"],
|
||||
"usr2func": [],
|
||||
"usr2type": [{
|
||||
"usr": 6697181287623958829,
|
||||
"detailed_name": "enum A {}",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "A",
|
||||
"spell": "1:6-1:7|1:1-1:10|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 10,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["9:5-9:6|4|-1"]
|
||||
}, {
|
||||
"usr": 10528472276654770367,
|
||||
"detailed_name": "struct Foo {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Foo",
|
||||
"spell": "5:8-5:11|5:1-7:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [13938528237873543349],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["9:1-9:4|4|-1", "10:1-10:4|4|-1"]
|
||||
}, {
|
||||
"usr": 13892793056005362145,
|
||||
"detailed_name": "enum B {}",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "B",
|
||||
"spell": "2:6-2:7|2:1-2:10|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 10,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["10:5-10:6|4|-1"]
|
||||
}, {
|
||||
"usr": 13938528237873543349,
|
||||
"detailed_name": "struct Foo::Inner {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Inner",
|
||||
"spell": "6:10-6:15|6:3-6:18|1026|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 23,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [16721564935990383768, 12028309045033782423],
|
||||
"uses": ["9:9-9:14|4|-1", "10:9-10:14|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 12028309045033782423,
|
||||
"detailed_name": "Foo<B>::Inner b",
|
||||
"qual_name_offset": 14,
|
||||
"short_name": "b",
|
||||
"spell": "10:15-10:16|10:1-10:16|2|-1",
|
||||
"type": 13938528237873543349,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 16721564935990383768,
|
||||
"detailed_name": "Foo<A>::Inner a",
|
||||
"qual_name_offset": 14,
|
||||
"short_name": "a",
|
||||
"spell": "9:15-9:16|9:1-9:16|2|-1",
|
||||
"type": 13938528237873543349,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
@ -0,0 +1,89 @@
|
||||
template<typename T>
|
||||
struct Foo {
|
||||
static constexpr int var = 3;
|
||||
};
|
||||
|
||||
int a = Foo<int>::var;
|
||||
int b = Foo<bool>::var;
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [],
|
||||
"usr2type": [{
|
||||
"usr": 53,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [13545144895171991916, 16721564935990383768, 12028309045033782423],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 10528472276654770367,
|
||||
"detailed_name": "struct Foo {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Foo",
|
||||
"spell": "2:8-2:11|2:1-4:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["6:9-6:12|4|-1", "7:9-7:12|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 12028309045033782423,
|
||||
"detailed_name": "int b",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "b",
|
||||
"hover": "int b = Foo<bool>::var",
|
||||
"spell": "7:5-7:6|7:1-7:23|2|-1",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 13545144895171991916,
|
||||
"detailed_name": "static constexpr int Foo::var",
|
||||
"qual_name_offset": 21,
|
||||
"short_name": "var",
|
||||
"hover": "static constexpr int Foo::var = 3",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 23,
|
||||
"storage": 2,
|
||||
"declarations": ["3:24-3:27|3:3-3:31|1025|-1"],
|
||||
"uses": ["6:19-6:22|12|-1", "7:20-7:23|12|-1"]
|
||||
}, {
|
||||
"usr": 16721564935990383768,
|
||||
"detailed_name": "int a",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "a",
|
||||
"hover": "int a = Foo<int>::var",
|
||||
"spell": "6:5-6:6|6:1-6:22|2|-1",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
78
index_tests/templates/template_func_usage_folded_into_one.cc
Normal file
78
index_tests/templates/template_func_usage_folded_into_one.cc
Normal file
@ -0,0 +1,78 @@
|
||||
template<typename T>
|
||||
static int foo() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
int a = foo<int>();
|
||||
int b = foo<bool>();
|
||||
|
||||
// TODO: put template foo inside a namespace
|
||||
// TODO: put template foo inside a template class inside a namespace
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 326583651986177228,
|
||||
"detailed_name": "static int foo()",
|
||||
"qual_name_offset": 11,
|
||||
"short_name": "foo",
|
||||
"spell": "2:12-2:15|2:1-4:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": ["6:9-6:12|36|-1", "7:9-7:12|36|-1"]
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 53,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [16721564935990383768, 12028309045033782423],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 12028309045033782423,
|
||||
"detailed_name": "int b",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "b",
|
||||
"hover": "int b = foo<bool>()",
|
||||
"spell": "7:5-7:6|7:1-7:20|2|-1",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 16721564935990383768,
|
||||
"detailed_name": "int a",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "a",
|
||||
"hover": "int a = foo<int>()",
|
||||
"spell": "6:5-6:6|6:1-6:19|2|-1",
|
||||
"type": 53,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
57
index_tests/templates/template_type_usage_folded_into_one.cc
Normal file
57
index_tests/templates/template_type_usage_folded_into_one.cc
Normal file
@ -0,0 +1,57 @@
|
||||
template<typename T>
|
||||
class Foo {};
|
||||
|
||||
Foo<int> a;
|
||||
Foo<bool> b;
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [],
|
||||
"usr2type": [{
|
||||
"usr": 10528472276654770367,
|
||||
"detailed_name": "class Foo {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Foo",
|
||||
"spell": "2:7-2:10|2:1-2:13|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [16721564935990383768, 12028309045033782423],
|
||||
"uses": ["4:1-4:4|4|-1", "5:1-5:4|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 12028309045033782423,
|
||||
"detailed_name": "Foo<bool> b",
|
||||
"qual_name_offset": 10,
|
||||
"short_name": "b",
|
||||
"spell": "5:11-5:12|5:1-5:12|2|-1",
|
||||
"type": 10528472276654770367,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 16721564935990383768,
|
||||
"detailed_name": "Foo<int> a",
|
||||
"qual_name_offset": 9,
|
||||
"short_name": "a",
|
||||
"spell": "4:10-4:11|4:1-4:11|2|-1",
|
||||
"type": 10528472276654770367,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
132
index_tests/templates/template_var_usage_folded_into_one.cc
Normal file
132
index_tests/templates/template_var_usage_folded_into_one.cc
Normal file
@ -0,0 +1,132 @@
|
||||
enum A {};
|
||||
enum B {};
|
||||
|
||||
template<typename T>
|
||||
T var = T();
|
||||
|
||||
A a = var<A>;
|
||||
B b = var<B>;
|
||||
|
||||
// NOTE: libclang before 4.0 doesn't expose template usage on |var|.
|
||||
|
||||
#if false
|
||||
EnumDecl A
|
||||
EnumDecl B
|
||||
UnexposedDecl var
|
||||
VarDecl a
|
||||
UnexposedExpr var
|
||||
UnexposedExpr var
|
||||
DeclRefExpr var
|
||||
TypeRef enum A
|
||||
UnexposedDecl var
|
||||
VarDecl b
|
||||
UnexposedExpr var
|
||||
UnexposedExpr var
|
||||
DeclRefExpr var
|
||||
TypeRef enum B
|
||||
UnexposedDecl var
|
||||
#endif
|
||||
|
||||
/*
|
||||
EXTRA_FLAGS:
|
||||
-std=c++14
|
||||
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": ["12:1-29:1"],
|
||||
"usr2func": [],
|
||||
"usr2type": [{
|
||||
"usr": 6697181287623958829,
|
||||
"detailed_name": "enum A {}",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "A",
|
||||
"spell": "1:6-1:7|1:1-1:10|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 10,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [16721564935990383768],
|
||||
"uses": ["7:1-7:2|4|-1", "7:11-7:12|4|-1"]
|
||||
}, {
|
||||
"usr": 11919899838872947844,
|
||||
"detailed_name": "T",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "T",
|
||||
"spell": "4:19-4:20|4:10-4:20|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 26,
|
||||
"parent_kind": 5,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [8096973118640070624],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 13892793056005362145,
|
||||
"detailed_name": "enum B {}",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "B",
|
||||
"spell": "2:6-2:7|2:1-2:10|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 10,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [12028309045033782423],
|
||||
"uses": ["8:1-8:2|4|-1", "8:11-8:12|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 8096973118640070624,
|
||||
"detailed_name": "T var",
|
||||
"qual_name_offset": 2,
|
||||
"short_name": "var",
|
||||
"hover": "T var = T()",
|
||||
"spell": "5:3-5:6|5:1-5:12|2|-1",
|
||||
"type": 11919899838872947844,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": ["7:7-7:10|12|-1", "8:7-8:10|12|-1"]
|
||||
}, {
|
||||
"usr": 12028309045033782423,
|
||||
"detailed_name": "B b",
|
||||
"qual_name_offset": 2,
|
||||
"short_name": "b",
|
||||
"hover": "B b = var<B>",
|
||||
"spell": "8:3-8:4|8:1-8:13|2|-1",
|
||||
"type": 13892793056005362145,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 16721564935990383768,
|
||||
"detailed_name": "A a",
|
||||
"qual_name_offset": 2,
|
||||
"short_name": "a",
|
||||
"hover": "A a = var<A>",
|
||||
"spell": "7:3-7:4|7:1-7:13|2|-1",
|
||||
"type": 6697181287623958829,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
134
index_tests/types/anonymous_struct.cc
Normal file
134
index_tests/types/anonymous_struct.cc
Normal file
@ -0,0 +1,134 @@
|
||||
union vector3 {
|
||||
struct { float x, y, z; };
|
||||
float v[3];
|
||||
};
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [],
|
||||
"usr2type": [{
|
||||
"usr": 82,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [3348817847649945564, 4821094820988543895, 15292551660437765731],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 1428566502523368801,
|
||||
"detailed_name": "anon struct",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "anon struct",
|
||||
"spell": "2:3-2:9|2:3-2:28|1026|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [{
|
||||
"L": 3348817847649945564,
|
||||
"R": 0
|
||||
}, {
|
||||
"L": 4821094820988543895,
|
||||
"R": 32
|
||||
}, {
|
||||
"L": 15292551660437765731,
|
||||
"R": 64
|
||||
}],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 5,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 17937907487590875128,
|
||||
"detailed_name": "union vector3 {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "vector3",
|
||||
"spell": "1:7-1:14|1:1-4:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [1428566502523368801],
|
||||
"vars": [{
|
||||
"L": 1963212417280098348,
|
||||
"R": 0
|
||||
}, {
|
||||
"L": 3348817847649945564,
|
||||
"R": 0
|
||||
}, {
|
||||
"L": 4821094820988543895,
|
||||
"R": 32
|
||||
}, {
|
||||
"L": 15292551660437765731,
|
||||
"R": 64
|
||||
}],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 1963212417280098348,
|
||||
"detailed_name": "float vector3::v[3]",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "v",
|
||||
"spell": "3:9-3:10|3:3-3:13|1026|-1",
|
||||
"type": 0,
|
||||
"kind": 8,
|
||||
"parent_kind": 5,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 3348817847649945564,
|
||||
"detailed_name": "float vector3::(anon struct)::x",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "x",
|
||||
"spell": "2:18-2:19|2:12-2:19|1026|-1",
|
||||
"type": 82,
|
||||
"kind": 8,
|
||||
"parent_kind": 23,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 4821094820988543895,
|
||||
"detailed_name": "float vector3::(anon struct)::y",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "y",
|
||||
"spell": "2:21-2:22|2:12-2:22|1026|-1",
|
||||
"type": 82,
|
||||
"kind": 8,
|
||||
"parent_kind": 23,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 15292551660437765731,
|
||||
"detailed_name": "float vector3::(anon struct)::z",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "z",
|
||||
"spell": "2:24-2:25|2:12-2:25|1026|-1",
|
||||
"type": 82,
|
||||
"kind": 8,
|
||||
"parent_kind": 23,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
44
index_tests/types/typedefs.cc
Normal file
44
index_tests/types/typedefs.cc
Normal file
@ -0,0 +1,44 @@
|
||||
typedef int (func)(const int *a, const int *b);
|
||||
static func g;
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 8105378401105136463,
|
||||
"detailed_name": "static int g(const int *, const int *)",
|
||||
"qual_name_offset": 11,
|
||||
"short_name": "g",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["2:13-2:14|2:1-2:14|1|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 10383876566159302459,
|
||||
"detailed_name": "typedef int (func)(const int *, const int *)",
|
||||
"qual_name_offset": 12,
|
||||
"short_name": "func",
|
||||
"spell": "1:14-1:18|1:1-1:47|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 252,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["2:8-2:12|4|-1"]
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
94
index_tests/unions/union_decl.cc
Normal file
94
index_tests/unions/union_decl.cc
Normal file
@ -0,0 +1,94 @@
|
||||
union Foo {
|
||||
int a;
|
||||
bool b;
|
||||
};
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [],
|
||||
"usr2type": [{
|
||||
"usr": 37,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [8804696910588009104],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 53,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [9529311430721959843],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 8501689086387244262,
|
||||
"detailed_name": "union Foo {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Foo",
|
||||
"spell": "1:7-1:10|1:1-4:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [{
|
||||
"L": 9529311430721959843,
|
||||
"R": 0
|
||||
}, {
|
||||
"L": 8804696910588009104,
|
||||
"R": 0
|
||||
}],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 8804696910588009104,
|
||||
"detailed_name": "bool Foo::b",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "b",
|
||||
"spell": "3:8-3:9|3:3-3:9|1026|-1",
|
||||
"type": 37,
|
||||
"kind": 8,
|
||||
"parent_kind": 5,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 9529311430721959843,
|
||||
"detailed_name": "int Foo::a",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "a",
|
||||
"spell": "2:7-2:8|2:3-2:8|1026|-1",
|
||||
"type": 53,
|
||||
"kind": 8,
|
||||
"parent_kind": 5,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
129
index_tests/unions/union_usage.cc
Normal file
129
index_tests/unions/union_usage.cc
Normal file
@ -0,0 +1,129 @@
|
||||
union Foo {
|
||||
int a : 5;
|
||||
bool b : 3;
|
||||
};
|
||||
|
||||
Foo f;
|
||||
|
||||
void act(Foo*) {
|
||||
f.a = 3;
|
||||
}
|
||||
|
||||
/*
|
||||
// TODO: instantiations on Foo should include parameter?
|
||||
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 13982179977217945200,
|
||||
"detailed_name": "void act(Foo *)",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "act",
|
||||
"spell": "8:6-8:9|8:1-10:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 37,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [8804696910588009104],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 53,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [9529311430721959843],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 8501689086387244262,
|
||||
"detailed_name": "union Foo {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Foo",
|
||||
"spell": "1:7-1:10|1:1-4:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [{
|
||||
"L": 9529311430721959843,
|
||||
"R": 0
|
||||
}, {
|
||||
"L": 8804696910588009104,
|
||||
"R": 0
|
||||
}],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [2933643612409209903],
|
||||
"uses": ["6:1-6:4|4|-1", "8:10-8:13|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 2933643612409209903,
|
||||
"detailed_name": "Foo f",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "f",
|
||||
"spell": "6:5-6:6|6:1-6:6|2|-1",
|
||||
"type": 8501689086387244262,
|
||||
"kind": 13,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": ["9:3-9:4|4|-1"]
|
||||
}, {
|
||||
"usr": 8804696910588009104,
|
||||
"detailed_name": "bool Foo::b : 3",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "b",
|
||||
"spell": "3:8-3:9|3:3-3:13|1026|-1",
|
||||
"type": 37,
|
||||
"kind": 8,
|
||||
"parent_kind": 5,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 9529311430721959843,
|
||||
"detailed_name": "int Foo::a : 5",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "a",
|
||||
"spell": "2:7-2:8|2:3-2:12|1026|-1",
|
||||
"type": 53,
|
||||
"kind": 8,
|
||||
"parent_kind": 5,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": ["9:5-9:6|20|-1"]
|
||||
}]
|
||||
}
|
||||
*/
|
67
index_tests/usage/func_called_from_constructor.cc
Normal file
67
index_tests/usage/func_called_from_constructor.cc
Normal file
@ -0,0 +1,67 @@
|
||||
void called() {}
|
||||
|
||||
struct Foo {
|
||||
Foo();
|
||||
};
|
||||
|
||||
Foo::Foo() {
|
||||
called();
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 468307235068920063,
|
||||
"detailed_name": "void called()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "called",
|
||||
"spell": "1:6-1:12|1:1-1:17|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": ["8:3-8:9|16420|-1"]
|
||||
}, {
|
||||
"usr": 3385168158331140247,
|
||||
"detailed_name": "Foo::Foo()",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "Foo",
|
||||
"spell": "7:6-7:9|7:1-9:2|1026|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": ["8:3-8:9|468307235068920063|3|16420"],
|
||||
"kind": 9,
|
||||
"parent_kind": 23,
|
||||
"storage": 0,
|
||||
"declarations": ["4:3-4:6|4:3-4:8|1025|-1"],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 15041163540773201510,
|
||||
"detailed_name": "struct Foo {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Foo",
|
||||
"spell": "3:8-3:11|3:1-5:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [3385168158331140247],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["4:3-4:6|4|-1", "7:1-7:4|4|-1", "7:6-7:9|4|-1"]
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
60
index_tests/usage/func_called_from_macro_argument.cc
Normal file
60
index_tests/usage/func_called_from_macro_argument.cc
Normal file
@ -0,0 +1,60 @@
|
||||
#define MACRO_CALL(e) e
|
||||
|
||||
bool called(bool a, bool b);
|
||||
|
||||
void caller() {
|
||||
MACRO_CALL(called(true, true));
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 3787803219955606747,
|
||||
"detailed_name": "bool called(bool a, bool b)",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "called",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["3:6-3:12|3:1-3:28|1|-1"],
|
||||
"derived": [],
|
||||
"uses": ["6:14-6:20|16420|-1", "6:14-6:20|64|0"]
|
||||
}, {
|
||||
"usr": 11404881820527069090,
|
||||
"detailed_name": "void caller()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "caller",
|
||||
"spell": "5:6-5:12|5:1-7:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": ["6:14-6:20|3787803219955606747|3|16420"],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [],
|
||||
"usr2var": [{
|
||||
"usr": 16326993795872073150,
|
||||
"detailed_name": "MACRO_CALL",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "MACRO_CALL",
|
||||
"hover": "#define MACRO_CALL(e) e",
|
||||
"spell": "1:9-1:19|1:9-1:24|2|-1",
|
||||
"type": 0,
|
||||
"kind": 255,
|
||||
"parent_kind": 1,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": ["6:3-6:13|64|-1"]
|
||||
}]
|
||||
}
|
||||
*/
|
81
index_tests/usage/func_called_from_template.cc
Normal file
81
index_tests/usage/func_called_from_template.cc
Normal file
@ -0,0 +1,81 @@
|
||||
void called();
|
||||
|
||||
template <typename T>
|
||||
void caller() {
|
||||
called();
|
||||
}
|
||||
|
||||
void foo() {
|
||||
caller<int>();
|
||||
}
|
||||
|
||||
/*
|
||||
// NOTE: without caller<int>() instantation caller() is never visited so
|
||||
// called() is never referenced.
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 468307235068920063,
|
||||
"detailed_name": "void called()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "called",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["1:6-1:12|1:1-1:14|1|-1"],
|
||||
"derived": [],
|
||||
"uses": ["5:3-5:9|16420|-1"]
|
||||
}, {
|
||||
"usr": 2459767597003442547,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": ["5:3-5:9|468307235068920063|3|16420"],
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 4259594751088586730,
|
||||
"detailed_name": "void foo()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo",
|
||||
"spell": "8:6-8:9|8:1-10:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": ["9:3-9:9|10177235824697315808|3|16420"],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 10177235824697315808,
|
||||
"detailed_name": "void caller()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "caller",
|
||||
"spell": "4:6-4:12|4:1-6:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": ["5:3-5:9|468307235068920063|3|16420"],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": ["9:3-9:9|16420|-1"]
|
||||
}],
|
||||
"usr2type": [],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
81
index_tests/usage/func_called_implicit_ctor.cc
Normal file
81
index_tests/usage/func_called_implicit_ctor.cc
Normal file
@ -0,0 +1,81 @@
|
||||
struct Wrapper {
|
||||
Wrapper(int i);
|
||||
};
|
||||
|
||||
int called() { return 1; }
|
||||
|
||||
Wrapper caller() {
|
||||
return called();
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 468307235068920063,
|
||||
"detailed_name": "int called()",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "called",
|
||||
"spell": "5:5-5:11|5:1-5:27|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": ["8:10-8:16|16420|-1"]
|
||||
}, {
|
||||
"usr": 10544127002917214589,
|
||||
"detailed_name": "Wrapper::Wrapper(int i)",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "Wrapper",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 9,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["2:3-2:10|2:3-2:17|1025|-1"],
|
||||
"derived": [],
|
||||
"uses": ["8:10-8:16|16676|-1"]
|
||||
}, {
|
||||
"usr": 11404881820527069090,
|
||||
"detailed_name": "Wrapper caller()",
|
||||
"qual_name_offset": 8,
|
||||
"short_name": "caller",
|
||||
"spell": "7:9-7:15|7:1-9:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": ["8:10-8:16|10544127002917214589|3|16676", "8:10-8:16|468307235068920063|3|16420"],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 13611487872560323389,
|
||||
"detailed_name": "struct Wrapper {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Wrapper",
|
||||
"spell": "1:8-1:15|1:1-3:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [10544127002917214589],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["2:3-2:10|4|-1", "7:1-7:8|4|-1"]
|
||||
}],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
77
index_tests/usage/func_usage_addr_func.cc
Normal file
77
index_tests/usage/func_usage_addr_func.cc
Normal file
@ -0,0 +1,77 @@
|
||||
void consume(void (*)()) {}
|
||||
|
||||
void used() {}
|
||||
|
||||
void user() {
|
||||
void (*x)() = &used;
|
||||
consume(&used);
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 5264867802674151787,
|
||||
"detailed_name": "void used()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "used",
|
||||
"spell": "3:6-3:10|3:1-3:15|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": ["6:18-6:22|132|-1", "7:12-7:16|132|-1"]
|
||||
}, {
|
||||
"usr": 9376923949268137283,
|
||||
"detailed_name": "void user()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "user",
|
||||
"spell": "5:6-5:10|5:1-8:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [16088407831770615719],
|
||||
"callees": ["6:18-6:22|5264867802674151787|3|132", "6:18-6:22|5264867802674151787|3|132", "7:3-7:10|12924914488846929470|3|16420", "7:12-7:16|5264867802674151787|3|132"],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 12924914488846929470,
|
||||
"detailed_name": "void consume(void (*)())",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "consume",
|
||||
"spell": "1:6-1:13|1:1-1:28|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": ["7:3-7:10|16420|-1"]
|
||||
}],
|
||||
"usr2type": [],
|
||||
"usr2var": [{
|
||||
"usr": 16088407831770615719,
|
||||
"detailed_name": "void (*x)()",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "x",
|
||||
"hover": "void (*x)() = &used",
|
||||
"spell": "6:10-6:11|6:3-6:22|2|-1",
|
||||
"type": 0,
|
||||
"kind": 13,
|
||||
"parent_kind": 12,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
78
index_tests/usage/func_usage_addr_method.cc
Normal file
78
index_tests/usage/func_usage_addr_method.cc
Normal file
@ -0,0 +1,78 @@
|
||||
struct Foo {
|
||||
void Used();
|
||||
};
|
||||
|
||||
void user() {
|
||||
auto x = &Foo::Used;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 9376923949268137283,
|
||||
"detailed_name": "void user()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "user",
|
||||
"spell": "5:6-5:10|5:1-7:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [4636142131003982569],
|
||||
"callees": ["6:18-6:22|18417145003926999463|3|132", "6:18-6:22|18417145003926999463|3|132"],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 18417145003926999463,
|
||||
"detailed_name": "void Foo::Used()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "Used",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["2:8-2:12|2:3-2:14|1025|-1"],
|
||||
"derived": [],
|
||||
"uses": ["6:18-6:22|132|-1"]
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 15041163540773201510,
|
||||
"detailed_name": "struct Foo {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Foo",
|
||||
"spell": "1:8-1:11|1:1-3:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [18417145003926999463],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": ["6:13-6:16|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 4636142131003982569,
|
||||
"detailed_name": "void (Foo::*)() x",
|
||||
"qual_name_offset": 16,
|
||||
"short_name": "x",
|
||||
"hover": "void (Foo::*)() x = &Foo::Used",
|
||||
"spell": "6:8-6:9|6:3-6:22|2|-1",
|
||||
"type": 0,
|
||||
"kind": 13,
|
||||
"parent_kind": 12,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
45
index_tests/usage/func_usage_call_func.cc
Normal file
45
index_tests/usage/func_usage_call_func.cc
Normal file
@ -0,0 +1,45 @@
|
||||
void called() {}
|
||||
void caller() {
|
||||
called();
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 468307235068920063,
|
||||
"detailed_name": "void called()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "called",
|
||||
"spell": "1:6-1:12|1:1-1:17|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": ["3:3-3:9|16420|-1"]
|
||||
}, {
|
||||
"usr": 11404881820527069090,
|
||||
"detailed_name": "void caller()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "caller",
|
||||
"spell": "2:6-2:12|2:1-4:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": ["3:3-3:9|468307235068920063|3|16420"],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
78
index_tests/usage/func_usage_call_method.cc
Normal file
78
index_tests/usage/func_usage_call_method.cc
Normal file
@ -0,0 +1,78 @@
|
||||
struct Foo {
|
||||
void Used();
|
||||
};
|
||||
|
||||
void user() {
|
||||
Foo* f = nullptr;
|
||||
f->Used();
|
||||
}
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 9376923949268137283,
|
||||
"detailed_name": "void user()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "user",
|
||||
"spell": "5:6-5:10|5:1-8:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [14045150712868309451],
|
||||
"callees": ["7:6-7:10|18417145003926999463|3|16420"],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 18417145003926999463,
|
||||
"detailed_name": "void Foo::Used()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "Used",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["2:8-2:12|2:3-2:14|1025|-1"],
|
||||
"derived": [],
|
||||
"uses": ["7:6-7:10|16420|-1"]
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 15041163540773201510,
|
||||
"detailed_name": "struct Foo {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Foo",
|
||||
"spell": "1:8-1:11|1:1-3:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [18417145003926999463],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [14045150712868309451],
|
||||
"uses": ["6:3-6:6|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 14045150712868309451,
|
||||
"detailed_name": "Foo *f",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "f",
|
||||
"hover": "Foo *f = nullptr",
|
||||
"spell": "6:8-6:9|6:3-6:19|2|-1",
|
||||
"type": 15041163540773201510,
|
||||
"kind": 13,
|
||||
"parent_kind": 12,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": ["7:3-7:4|12|-1"]
|
||||
}]
|
||||
}
|
||||
*/
|
82
index_tests/usage/func_usage_class_inline_var_def.cc
Normal file
82
index_tests/usage/func_usage_class_inline_var_def.cc
Normal file
@ -0,0 +1,82 @@
|
||||
static int helper() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
class Foo {
|
||||
int x = helper();
|
||||
};
|
||||
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 9630503130605430498,
|
||||
"detailed_name": "static int helper()",
|
||||
"qual_name_offset": 11,
|
||||
"short_name": "helper",
|
||||
"spell": "1:12-1:18|1:1-3:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": ["6:11-6:17|36|-1"]
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 53,
|
||||
"detailed_name": "",
|
||||
"qual_name_offset": 0,
|
||||
"short_name": "",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 0,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [4220150017963593039],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 15041163540773201510,
|
||||
"detailed_name": "class Foo {}",
|
||||
"qual_name_offset": 6,
|
||||
"short_name": "Foo",
|
||||
"spell": "5:7-5:10|5:1-7:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [],
|
||||
"types": [],
|
||||
"vars": [{
|
||||
"L": 4220150017963593039,
|
||||
"R": 0
|
||||
}],
|
||||
"alias_of": 0,
|
||||
"kind": 5,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 4220150017963593039,
|
||||
"detailed_name": "int Foo::x",
|
||||
"qual_name_offset": 4,
|
||||
"short_name": "x",
|
||||
"hover": "int Foo::x = helper()",
|
||||
"spell": "6:7-6:8|6:3-6:19|1026|-1",
|
||||
"type": 53,
|
||||
"kind": 8,
|
||||
"parent_kind": 5,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": []
|
||||
}]
|
||||
}
|
||||
*/
|
44
index_tests/usage/func_usage_forward_decl_func.cc
Normal file
44
index_tests/usage/func_usage_forward_decl_func.cc
Normal file
@ -0,0 +1,44 @@
|
||||
void foo();
|
||||
|
||||
void usage() {
|
||||
foo();
|
||||
}
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 4259594751088586730,
|
||||
"detailed_name": "void foo()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["1:6-1:9|1:1-1:11|1|-1"],
|
||||
"derived": [],
|
||||
"uses": ["4:3-4:6|16420|-1"]
|
||||
}, {
|
||||
"usr": 6767773193109753523,
|
||||
"detailed_name": "void usage()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "usage",
|
||||
"spell": "3:6-3:11|3:1-5:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": ["4:3-4:6|4259594751088586730|3|16420"],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}],
|
||||
"usr2type": [],
|
||||
"usr2var": []
|
||||
}
|
||||
*/
|
77
index_tests/usage/func_usage_forward_decl_method.cc
Normal file
77
index_tests/usage/func_usage_forward_decl_method.cc
Normal file
@ -0,0 +1,77 @@
|
||||
struct Foo {
|
||||
void foo();
|
||||
};
|
||||
|
||||
void usage() {
|
||||
Foo* f = nullptr;
|
||||
f->foo();
|
||||
}
|
||||
/*
|
||||
OUTPUT:
|
||||
{
|
||||
"includes": [],
|
||||
"skipped_ranges": [],
|
||||
"usr2func": [{
|
||||
"usr": 6767773193109753523,
|
||||
"detailed_name": "void usage()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "usage",
|
||||
"spell": "5:6-5:11|5:1-8:2|2|-1",
|
||||
"bases": [],
|
||||
"vars": [16229832321010999607],
|
||||
"callees": ["7:6-7:9|17922201480358737771|3|16420"],
|
||||
"kind": 12,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"uses": []
|
||||
}, {
|
||||
"usr": 17922201480358737771,
|
||||
"detailed_name": "void Foo::foo()",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "foo",
|
||||
"bases": [],
|
||||
"vars": [],
|
||||
"callees": [],
|
||||
"kind": 6,
|
||||
"parent_kind": 0,
|
||||
"storage": 0,
|
||||
"declarations": ["2:8-2:11|2:3-2:13|1025|-1"],
|
||||
"derived": [],
|
||||
"uses": ["7:6-7:9|16420|-1"]
|
||||
}],
|
||||
"usr2type": [{
|
||||
"usr": 15041163540773201510,
|
||||
"detailed_name": "struct Foo {}",
|
||||
"qual_name_offset": 7,
|
||||
"short_name": "Foo",
|
||||
"spell": "1:8-1:11|1:1-3:2|2|-1",
|
||||
"bases": [],
|
||||
"funcs": [17922201480358737771],
|
||||
"types": [],
|
||||
"vars": [],
|
||||
"alias_of": 0,
|
||||
"kind": 23,
|
||||
"parent_kind": 0,
|
||||
"declarations": [],
|
||||
"derived": [],
|
||||
"instances": [16229832321010999607],
|
||||
"uses": ["6:3-6:6|4|-1"]
|
||||
}],
|
||||
"usr2var": [{
|
||||
"usr": 16229832321010999607,
|
||||
"detailed_name": "Foo *f",
|
||||
"qual_name_offset": 5,
|
||||
"short_name": "f",
|
||||
"hover": "Foo *f = nullptr",
|
||||
"spell": "6:8-6:9|6:3-6:19|2|-1",
|
||||
"type": 15041163540773201510,
|
||||
"kind": 13,
|
||||
"parent_kind": 12,
|
||||
"storage": 0,
|
||||
"declarations": [],
|
||||
"uses": ["7:3-7:4|12|-1"]
|
||||
}]
|
||||
}
|
||||
*/
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user