Skip to content

Commit

Permalink
fix(restquery): treat ecu=null as undefined
Browse files Browse the repository at this point in the history
We do accept ecu="null" as ECU named "null" but treat ecu=null as no ecu specified.
  • Loading branch information
mbehr1 committed Jan 5, 2021
1 parent ab6db5e commit ad60877
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/dltDocumentProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -902,9 +902,12 @@ export class DltDocumentProvider implements vscode.TreeDataProvider<TreeViewNode
if (opt.startsWith('ecu=')) {
ecuNameFilter = decodeURIComponent(opt.slice(opt.indexOf('=') + 1));
// allow the string be placed in "":
ecuNameFilter = ecuNameFilter.replace(/^"(.*?)"$/g, (match, p1, offset) => p1);
if (ecuNameFilter.length === 0) { ecuNameFilter = undefined; } else {
console.log(`restQueryDocsEcus got ecuNameFilter='${ecuNameFilter}'`);
// we treat 'null' as undefined but "null" as ECU named null.
if (ecuNameFilter === 'null') { ecuNameFilter = undefined; } else {
ecuNameFilter = ecuNameFilter.replace(/^"(.*?)"$/g, (match, p1, offset) => p1);
if (ecuNameFilter.length === 0) { ecuNameFilter = undefined; } else {
console.log(`restQueryDocsEcus got ecuNameFilter='${ecuNameFilter}'`);
}
}
}
});
Expand Down

0 comments on commit ad60877

Please sign in to comment.