"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.NodeDocumentationNavigationTargetProvider = void 0;
const server_1 = require("@eclipse-glsp/server");
const inversify_1 = require("inversify");
const graph_extension_1 = require("../graph-extension");
let NodeDocumentationNavigationTargetProvider = class NodeDocumentationNavigationTargetProvider {
    constructor() {
        this.targetTypeId = 'documentation';
    }
    getTargets(editorContext) {
        if (editorContext.selectedElementIds.length === 1) {
            const taskNode = this.modelState.index.findByClass(editorContext.selectedElementIds[0], graph_extension_1.TaskNode);
            if (!taskNode || !(taskNode.id === 'task0')) {
                return [];
            }
            const sourceUri = this.modelState.sourceUri;
            if (!sourceUri) {
                return [];
            }
            const docUri = sourceUri.replace('.wf', '.md');
            const args = {};
            args['jsonOpenerOptions'] = new server_1.JsonOpenerOptions({
                start: { line: 2, character: 3 },
                end: { line: 2, character: 7 }
            }).toJson();
            return [{ uri: docUri, args: args }];
        }
        return [];
    }
};
__decorate([
    (0, inversify_1.inject)(server_1.ModelState),
    __metadata("design:type", Object)
], NodeDocumentationNavigationTargetProvider.prototype, "modelState", void 0);
NodeDocumentationNavigationTargetProvider = __decorate([
    (0, inversify_1.injectable)()
], NodeDocumentationNavigationTargetProvider);
exports.NodeDocumentationNavigationTargetProvider = NodeDocumentationNavigationTargetProvider;
//# sourceMappingURL=node-documentation-navigation-target-provider.js.map