@@ -60,7 +60,7 @@ const cbcodeutils = {
6060 // Get parser for this file type
6161 const { parser, query } = languageParsers [ ext ] || { } ;
6262 if ( ! parser || ! query ) {
63- throw new Error ( `Unsupported file type : ${ ext } ` ) ;
63+ throw new Error ( `Unsupported language : ${ ext } ` ) ;
6464 }
6565
6666 // Read file content
@@ -125,19 +125,20 @@ const cbcodeutils = {
125125
126126 /**
127127 * Performs a matching operation based on the provided matcher definition and problem patterns.
128- * @param {object } matcherDefinition - The definition of the matcher.
129- * @param {Array } problemPatterns - The patterns to match against.
130- * @param {Array } problems - The list of problems.
128+ * @param {object } matcherDefinition - The definition of the matcher (name, pattern, language, etc.) .
129+ * @param {Array } problemPatterns - The patterns to match against (regex patterns with severity levels) .
130+ * @param {Array } problems - Optional list of pre-existing problems to include .
131131 * @returns {Promise<MatchProblemResponse> } A promise that resolves with the matching problem response.
132132 */
133- performMatch : ( matcherDefinition : object , problemPatterns : any [ ] , problems : any [ ] ) : Promise < MatchProblemResponse > => {
133+ performMatch : ( matcherDefinition : object , problemPatterns : any [ ] , problems : any [ ] = [ ] ) : Promise < MatchProblemResponse > => {
134134 return cbws . messageManager . sendAndWaitForResponse (
135135 {
136136 "type" : "codeEvent" ,
137137 "action" : "performMatch" ,
138138 payload : {
139139 matcherDefinition,
140140 problemPatterns,
141+ problems
141142 }
142143 } ,
143144 "matchProblemResponse"
@@ -160,7 +161,7 @@ const cbcodeutils = {
160161
161162 /**
162163 * Retrieves details of a match.
163- * @param {string } matcher - The matcher to retrieve details for.
164+ * @param {string } matcher - The matcher to retrieve details for (by name or identifier) .
164165 * @returns {Promise<getMatchDetail> } A promise that resolves with the match detail response.
165166 */
166167 matchDetail : ( matcher : string ) : Promise < getMatchDetail > => {
@@ -169,7 +170,7 @@ const cbcodeutils = {
169170 "type" : "codeEvent" ,
170171 "action" : "getMatchDetail" ,
171172 payload : {
172- match : matcher
173+ matcher : matcher
173174 }
174175 } ,
175176 "getMatchDetailResponse"
0 commit comments