From a user perspective, if someone wants to navigate smart contracts with clangd a compilation database is needed.
~/eosio.contracts/build $ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
-- The C compiler identification is AppleClang 12.0.0.12000032
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting up Eosio Wasm Toolchain 1.7.0 at //usr/local
-- Building eosio.contracts v1.9.1
-- Using eosio.cdt version 1.7.0
-- Unit tests will not be built. To build unit tests, set BUILD_TESTS to true.
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_EXPORT_COMPILE_COMMANDS
-- Build files have been written to: /Users/john.debord/eosio.contracts/build
~/eosio.contracts/build $ ls
CMakeCache.txt CMakeFiles Makefile cmake_install.cmake contracts contracts_project-prefix
~/eosio.contracts/build $
From a user perspective, if someone wants to navigate smart contracts with
clangd
a compilation database is needed.Investigating further by modifying https://github.com/EOSIO/eosio.contracts/blob/master/CMakeLists.txt#L48-L58:
Generates the
compile_commands.json
file:clangd
starts up correctly, but is unable to recognize the AST. I'm assuming because it's incompatible with WASM.