File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1768,6 +1768,18 @@ func (handler *InoHandler) createClangdFormatterConfig(cppuri lsp.DocumentURI) (
1768
1768
config := `
1769
1769
AllowShortFunctionsOnASingleLine: None
1770
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
+
1771
1783
targetFile := cppuri .AsPath ()
1772
1784
if targetFile .IsNotDir () {
1773
1785
targetFile = targetFile .Parent ()
You can’t perform that action at this time.
0 commit comments