We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2b471cf commit 59f0539Copy full SHA for 59f0539
handler/handler.go
@@ -1768,6 +1768,18 @@ func (handler *InoHandler) createClangdFormatterConfig(cppuri lsp.DocumentURI) (
1768
config := `
1769
AllowShortFunctionsOnASingleLine: None
1770
`
1771
+
1772
+ // If a custom config is present in the sketch folder, use that one
1773
+ customConfigFile := handler.sketchRoot.Join(".clang-format")
1774
+ if customConfigFile.Exist() {
1775
+ if c, err := customConfigFile.ReadFile(); err != nil {
1776
+ log.Printf(" error reading custom formatter config file %s: %s", customConfigFile, err)
1777
+ } else {
1778
+ log.Printf(" using custom formatter config file %s", customConfigFile)
1779
+ config = string(c)
1780
+ }
1781
1782
1783
targetFile := cppuri.AsPath()
1784
if targetFile.IsNotDir() {
1785
targetFile = targetFile.Parent()
0 commit comments