Provide links to navigate to reusable-workflows

This commit is contained in:
Christopher Schleiden
2023-03-16 17:09:23 -07:00
parent ac5b14b4c0
commit eb56401caf
5 changed files with 116 additions and 22 deletions
+3 -2
View File
@@ -1,5 +1,6 @@
import {documentLinks, hover, validate, ValidationConfig} from "@github/actions-languageservice";
import {registerLogger, setLogLevel} from "@github/actions-languageservice/log";
import {clearCache, clearCacheEntry} from "@github/actions-languageservice/utils/workflow-cache";
import {Octokit} from "@octokit/rest";
import {
CompletionItem,
@@ -28,7 +29,6 @@ import {fetchActionMetadata} from "./utils/action-metadata";
import {TTLCache} from "./utils/cache";
import {timeOperation} from "./utils/timer";
import {valueProviders} from "./value-providers";
import {clearCacheEntry, clearCache} from "@github/actions-languageservice/utils/workflow-cache";
export function initConnection(connection: Connection) {
const documents: TextDocuments<TextDocument> = new TextDocuments(TextDocument);
@@ -165,7 +165,8 @@ export function initConnection(connection: Connection) {
});
connection.onDocumentLinks(async ({textDocument}: DocumentLinkParams): Promise<DocumentLink[] | null> => {
return documentLinks(documents.get(textDocument.uri)!);
const repoContext = repos.find(repo => textDocument.uri.startsWith(repo.workspaceUri));
return documentLinks(documents.get(textDocument.uri)!, repoContext?.workspaceUri);
});
// Make the text document manager listen on the connection