Skip to content

Commit

Permalink
ci(lint): auto-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Apr 29, 2024
1 parent 665e137 commit 9327aae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions packages/language-server/lib/register/registerEditorFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ export function registerEditorFeatures(server: ServerBase) {
});
}

const languageService = (await server.projects!.get.call(server, textDocument.uri)).getLanguageService();
const languageService = (await server.projects.get.call(server, textDocument.uri)).getLanguageService();
return languageService.doDocumentDrop(textDocument.uri, position, dataTransferMap, token);
});
server.connection.onRequest(GetMatchTsConfigRequest.type, async params => {
const languageService = (await server.projects!.get.call(server, params.uri)).getLanguageService();
const languageService = (await server.projects.get.call(server, params.uri)).getLanguageService();
const configFileName = languageService.context.language.typescript?.projectHost.configFileName;
if (configFileName) {
return { uri: fileNameToUri(configFileName) };
}
});
server.connection.onRequest(GetVirtualFileRequest.type, async document => {
const languageService = (await server.projects!.get.call(server, document.uri)).getLanguageService();
const languageService = (await server.projects.get.call(server, document.uri)).getLanguageService();
const sourceScript = languageService.context.language.scripts.get(document.uri);
if (sourceScript?.generated) {
return prune(sourceScript.generated.root);
Expand All @@ -82,7 +82,7 @@ export function registerEditorFeatures(server: ServerBase) {
}
});
server.connection.onRequest(GetVirtualCodeRequest.type, async params => {
const languageService = (await server.projects!.get.call(server, params.fileUri)).getLanguageService();
const languageService = (await server.projects.get.call(server, params.fileUri)).getLanguageService();
const sourceScript = languageService.context.language.scripts.get(params.fileUri);
const virtualCode = sourceScript?.generated?.embeddedCodes.get(params.virtualCodeId);
if (virtualCode) {
Expand All @@ -101,7 +101,7 @@ export function registerEditorFeatures(server: ServerBase) {

const fsModeName = 'fs'; // avoid bundle
const fs: typeof import('fs') = await import(fsModeName);
const languageService = (await server.projects!.get.call(server, params.uri)).getLanguageService();
const languageService = (await server.projects.get.call(server, params.uri)).getLanguageService();

if (languageService.context.language.typescript) {

Expand Down Expand Up @@ -145,7 +145,7 @@ export function registerEditorFeatures(server: ServerBase) {
size: number;
}>();

for (const project of await server.projects!.all.call(server)) {
for (const project of await server.projects.all.call(server)) {
const languageService = project.getLanguageService();
const tsLanguageService: ts.LanguageService | undefined = languageService.context.inject<any>('typescript/languageService');
const program = tsLanguageService?.getProgram();
Expand Down Expand Up @@ -203,7 +203,7 @@ export function registerEditorFeatures(server: ServerBase) {
return result;
});
server.connection.onNotification(UpdateVirtualCodeStateNotification.type, async params => {
const project = await server.projects!.get.call(server, params.fileUri);
const project = await server.projects.get.call(server, params.fileUri);
const context = project.getLanguageServiceDontCreate()?.context;
if (context) {
const virtualFileUri = project.getLanguageService().context.encodeEmbeddedDocumentUri(params.fileUri, params.virtualCodeId);
Expand All @@ -216,7 +216,7 @@ export function registerEditorFeatures(server: ServerBase) {
}
});
server.connection.onNotification(UpdateServicePluginStateNotification.type, async params => {
const project = await server.projects!.get.call(server, params.uri);
const project = await server.projects.get.call(server, params.uri);
const context = project.getLanguageServiceDontCreate()?.context;
if (context) {
const service = context.services[params.serviceId as any][1];
Expand All @@ -229,7 +229,7 @@ export function registerEditorFeatures(server: ServerBase) {
}
});
server.connection.onRequest(GetServicePluginsRequest.type, async params => {
const project = await server.projects!.get.call(server, params.uri);
const project = await server.projects.get.call(server, params.uri);
const context = project.getLanguageServiceDontCreate()?.context;
if (context) {
const result: GetServicePluginsRequest.ResponseType = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export function registerLanguageFeatures(server: ServerBase) {
});
server.connection.onWorkspaceSymbol(async (params, token) => {
let results: vscode.WorkspaceSymbol[] = [];
for (const project of await server.projects!.all.call(server)) {
for (const project of await server.projects.all.call(server)) {
if (token.isCancellationRequested) {
return;
}
Expand Down Expand Up @@ -277,7 +277,7 @@ export function registerLanguageFeatures(server: ServerBase) {
resolve(undefined);
return;
}
const languageService = (await server.projects!.get.call(server, uri)).getLanguageService();
const languageService = (await server.projects.get.call(server, uri)).getLanguageService();
try { // handle TS cancel throw
const result = await cb(languageService);
if (token.isCancellationRequested) {
Expand Down

0 comments on commit 9327aae

Please sign in to comment.