Skip to content

Commit

Permalink
Fix workflow documentation navigation example
Browse files Browse the repository at this point in the history
Update the NodeDocumentationNavigationTargetProvider to not rely on the tasks name which is currently unreliable (see eclipse-glsp/glsp#1351) and instead relies on the `text` property of the tasks label.
  • Loading branch information
tortmayr committed Jun 21, 2024
1 parent a733f72 commit 0b849cf
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { Args, EditorContext, NavigationTarget } from '@eclipse-glsp/protocol';
import { JsonOpenerOptions, ModelState, NavigationTargetProvider } from '@eclipse-glsp/server';
import { GLabel, JsonOpenerOptions, ModelState, NavigationTargetProvider } from '@eclipse-glsp/server';
import { inject, injectable } from 'inversify';
import { TaskNode } from '../graph-extension';

Expand All @@ -27,8 +27,9 @@ export class NodeDocumentationNavigationTargetProvider implements NavigationTarg

getTargets(editorContext: EditorContext): NavigationTarget[] {
if (editorContext.selectedElementIds.length === 1) {
this.modelState.index.getAllByClass(TaskNode).find(node => node.id === editorContext.selectedElementIds[0]);
const taskNode = this.modelState.index.findByClass(editorContext.selectedElementIds[0], TaskNode);
if (!taskNode || !(taskNode.id === 'task0')) {
if (!taskNode || !taskNode.children.some(child => child instanceof GLabel && child.text === 'Push')) {
return [];
}

Expand Down

0 comments on commit 0b849cf

Please sign in to comment.