File tree Expand file tree Collapse file tree 1 file changed +13
-21
lines changed
Extension/src/LanguageServer Expand file tree Collapse file tree 1 file changed +13
-21
lines changed Original file line number Diff line number Diff line change @@ -712,29 +712,21 @@ export class CppSettings extends Settings {
712712 return true ;
713713 }
714714 }
715- if ( editorConfigSettings . root !== undefined ) {
716- if ( typeof editorConfigSettings . root === "boolean" ) {
717- if ( editorConfigSettings . root ) {
718- return true ;
719- }
720- } else if ( typeof editorConfigSettings . root === "string" ) {
721- if ( editorConfigSettings . root . toLowerCase ( ) === "true" ) {
722- return true ;
723- }
724- }
725- }
726- } else {
727- const clangFormatPath1 : string = path . join ( parentPath , ".clang-format" ) ;
728- if ( fs . existsSync ( clangFormatPath1 ) ) {
729- return true ;
730- } else {
731- const clangFormatPath2 : string = path . join ( parentPath , "_clang-format" ) ;
732- if ( fs . existsSync ( clangFormatPath2 ) ) {
733- return true ;
734- }
715+ switch ( typeof editorConfigSettings . root ) {
716+ case "boolean" :
717+ return editorConfigSettings . root ;
718+ case "string" :
719+ return editorConfigSettings . root . toLowerCase ( ) === "true" ;
720+ default :
721+ return false ;
735722 }
736723 }
737- return false ;
724+ const clangFormatPath1 : string = path . join ( parentPath , ".clang-format" ) ;
725+ if ( fs . existsSync ( clangFormatPath1 ) ) {
726+ return true ;
727+ }
728+ const clangFormatPath2 : string = path . join ( parentPath , "_clang-format" ) ;
729+ return fs . existsSync ( clangFormatPath2 ) ;
738730 } ;
739731 // Scan parent paths to see which we find first, ".clang-format" or ".editorconfig"
740732 const fsPath : string = document . uri . fsPath ;
You can’t perform that action at this time.
0 commit comments