Pass featureFlags to onCompletion in language server (#304)
* Pass featureFlags to onCompletion in language server * Use import type for FeatureFlags in on-completion.ts
This commit is contained in:
@@ -154,7 +154,8 @@ export function initConnection(connection: Connection) {
|
|||||||
getDocument(documents, textDocument),
|
getDocument(documents, textDocument),
|
||||||
client,
|
client,
|
||||||
repos.find(repo => textDocument.uri.startsWith(repo.workspaceUri)),
|
repos.find(repo => textDocument.uri.startsWith(repo.workspaceUri)),
|
||||||
cache
|
cache,
|
||||||
|
featureFlags
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import {complete} from "@actions/languageservice/complete";
|
import {complete} from "@actions/languageservice/complete";
|
||||||
|
import type {FeatureFlags} from "@actions/expressions";
|
||||||
import {Octokit} from "@octokit/rest";
|
import {Octokit} from "@octokit/rest";
|
||||||
import {CompletionItem, Connection, Position} from "vscode-languageserver";
|
import {CompletionItem, Connection, Position} from "vscode-languageserver";
|
||||||
import {TextDocument} from "vscode-languageserver-textdocument";
|
import {TextDocument} from "vscode-languageserver-textdocument";
|
||||||
@@ -15,11 +16,13 @@ export async function onCompletion(
|
|||||||
document: TextDocument,
|
document: TextDocument,
|
||||||
client: Octokit | undefined,
|
client: Octokit | undefined,
|
||||||
repoContext: RepositoryContext | undefined,
|
repoContext: RepositoryContext | undefined,
|
||||||
cache: TTLCache
|
cache: TTLCache,
|
||||||
|
featureFlags?: FeatureFlags
|
||||||
): Promise<CompletionItem[]> {
|
): Promise<CompletionItem[]> {
|
||||||
return await complete(document, position, {
|
return await complete(document, position, {
|
||||||
valueProviderConfig: repoContext && valueProviders(client, repoContext, cache),
|
valueProviderConfig: repoContext && valueProviders(client, repoContext, cache),
|
||||||
contextProviderConfig: repoContext && contextProviders(client, repoContext, cache),
|
contextProviderConfig: repoContext && contextProviders(client, repoContext, cache),
|
||||||
|
featureFlags,
|
||||||
fileProvider: getFileProvider(client, cache, repoContext?.workspaceUri, async path => {
|
fileProvider: getFileProvider(client, cache, repoContext?.workspaceUri, async path => {
|
||||||
return await connection.sendRequest(Requests.ReadFile, {path});
|
return await connection.sendRequest(Requests.ReadFile, {path});
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user