import type * as lspTypes from "vscode-languageserver-protocol" ; import { applyLSPEdits } from "./applyLSPEdits" ; import { openFile } from "./novaUtils" ; export async function applyWorkspaceEdit ( workspaceEdit ) { if ( ! workspaceEdit . changes ) { return ; } for ( const uri in workspaceEdit . changes ) { const changes = workspaceEdit . changes [ uri ] ; if ( ! changes . length ) { continue ; } const editor = await openFile ( uri ) ; if ( ! editor ) { nova . workspace . showWarningMessage ( `Failed to open ${ uri }` ) ; continue ; } applyLSPEdits ( editor , changes ) ; } }