Skip to content

Commit

Permalink
Fix workflow documentation navigation example (#89)
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 authored Jun 21, 2024
1 parent a733f72 commit 0fee91e
Showing 1 changed file with 2 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 @@ -28,7 +28,7 @@ export class NodeDocumentationNavigationTargetProvider implements NavigationTarg
getTargets(editorContext: EditorContext): NavigationTarget[] {
if (editorContext.selectedElementIds.length === 1) {
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 0fee91e

Please sign in to comment.