VSCode Intellisence


#1

I use this setting in my VSCode IDE

"C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, ColumnLimit: 0 }",

Which, for the most part, formats code exactly the way I want. Nice.

After doing a nasty search for a compile problem, I noticed it alpha sorted my include directives.

#include "Toss.h"
#include <Arduino.h>
#include <ArduinoOTA.h>
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <SSD1306.h>
#include <WiFiClient.h>
#include <WiFiServer.h>
#include <WiFiUdp.h>
#include <Wire.h>

My “Toss.h” needs to be on the bottom to have the defines it needs to be defined. When I move it down, it gets sorted to the top. Bizarre.

Any clue how to stop this?


#2

I solved my own problem.

If include lines are next to each other, they will get sorted. If a blank line get’s placed in between lines, the following does not get sorted with the previous.