Skip to content

Commit

Permalink
fix: opening ant task does not find correct position if it is the def…
Browse files Browse the repository at this point in the history
…ault task
  • Loading branch information
spmeesseman committed Feb 6, 2021
1 parent fa351e1 commit 62fe08c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/taskTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,18 @@ export class TaskTreeDataProvider implements TreeDataProvider<TreeItem>
{
let scriptName = script.task.name.replace(" - Default", "");
scriptOffset = this._findScriptPosition("name=", scriptName, documentText, 6);

if (scriptOffset > 0)
{ //
// Check to make sure this isnt the 'default task' position,i.e.:
//
// <project basedir="." default="test-build">
//
const scriptOffset2 = this._findScriptPosition("name=", scriptName, documentText, 6, scriptOffset + 1);
if (scriptOffset2 > 0) {
scriptOffset = scriptOffset2;
}
}
}
else if (script.taskSource === "gulp")
{
Expand Down

0 comments on commit 62fe08c

Please sign in to comment.