File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import * as xml2js from 'xml2js';
55
66import { documentationLinkMap } from './util/documentation' ;
77import { runCommand } from './util/scripts' ;
8- import { resolvePath , findWorkspaceRoot } from './util/path' ;
8+ import { isPath , resolvePath , findWorkspaceRoot } from './util/path' ;
99
1010enum SeverityNumber {
1111 Info = 0 ,
@@ -187,8 +187,8 @@ async function runCppcheckOnFileXML(
187187
188188 // Resolve paths for arguments where applicable
189189 const argsParsed = processedArgs . split ( " " ) . map ( ( arg ) => {
190- if ( arg . startsWith ( '--project' ) ) {
191- const splitArg = arg . split ( '=' ) ;
190+ const splitArg = arg . split ( '=' ) ;
191+ if ( isPath ( splitArg [ 1 ] ) ) {
192192 return `${ splitArg [ 0 ] } =${ resolvePath ( splitArg [ 1 ] ) } ` ;
193193 }
194194 return arg ;
Original file line number Diff line number Diff line change @@ -2,6 +2,13 @@ import * as path from "path";
22import * as os from "os" ;
33import * as vscode from 'vscode' ;
44
5+ export function isPath ( arg : string ) : boolean {
6+ if ( arg . includes ( '/' ) || arg . includes ( '\\' ) ) {
7+ return true ;
8+ }
9+ return false ;
10+ }
11+
512export function findWorkspaceRoot ( ) : string {
613 const folders = vscode . workspace . workspaceFolders ;
714 const workspaceRoot = folders && folders . length > 0
You can’t perform that action at this time.
0 commit comments