Skip to content

Commit

Permalink
switches to clangd as a language server
Browse files Browse the repository at this point in the history
  • Loading branch information
BlakeFreer committed Apr 3, 2024
1 parent 69d4bb9 commit c21e34d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 119 deletions.
2 changes: 2 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CompileFlags:
CompilationDatabase: "firmware/build"
62 changes: 0 additions & 62 deletions .vscode/c_cpp_properties.json

This file was deleted.

55 changes: 0 additions & 55 deletions .vscode/settings.json

This file was deleted.

9 changes: 7 additions & 2 deletions firmware/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
PLATFORM =
PROJECT =

BUILD_DIR = build/$(PROJECT)/$(PLATFORM)
BUILD = build
BUILD_DIR = $(BUILD)/$(PROJECT)/$(PLATFORM)
CUBEMX_DIR := projects/$(PROJECT)/platforms/$(PLATFORM)/cubemx

COMPILE_COMMANDS_DEST = $(BUILD)/compile_commands.json

build: FORCE
cmake -B $(BUILD_DIR) -S. -G"Unix Makefiles" -DPROJECT=$(PROJECT) -DPLATFORM=$(PLATFORM)
cmake -B $(BUILD_DIR) -S. -G"Unix Makefiles" -DPROJECT=$(PROJECT) -DPLATFORM=$(PLATFORM) -D CMAKE_EXPORT_COMPILE_COMMANDS=1
cmake --build $(BUILD_DIR)
cp $(BUILD_DIR)/compile_commands.json $(COMPILE_COMMANDS_DEST)

clean: FORCE
rm -rf $(BUILD_DIR)
rm $(COMPILE_COMMANDS_DEST)

deepclean: clean
ifeq ($(findstring stm32,$(PLATFORM)),stm32)
Expand Down
6 changes: 6 additions & 0 deletions firmware/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ The following dependecies must be installed __and added to your PATH variable.__
* STM32CubeMX 6.8.1 - [link](https://www.st.com/en/development-tools/stm32cubemx)
* Select the 6.8.1 version in the __Get Software__ section.
* Verify by running `stm32cubemx`. The application should open.

* clangd - [link](https://clangd.llvm.org/installation)
* This is our "official" C/C++ language server.
* You should also install the __clangd__ extension for your IDE.
* If you have the Microsoft __C/C++__ extension installed, disable it for the `racecar` workspace.
* Verify with ``clangd --version``.

0 comments on commit c21e34d

Please sign in to comment.