Updated validator output parsing for new method

This commit is contained in:
Noah Santschi-Cooney 2021-01-12 00:01:56 +00:00
parent 96eaac213a
commit 8878b20631
No known key found for this signature in database
GPG key ID: 3B22282472C8AE48
4 changed files with 34 additions and 45 deletions

View file

@ -23,11 +23,14 @@ export function restartExtension(e: Extension): Command {
}
export function virtualMergedDocument(e: Extension): Command {
const getVirtualDocument = async (path: string): Promise<string> => {
const content = await e.lspClient.sendRequest<string>(lsp.ExecuteCommandRequest.type.method, {
command: 'virtualMerge',
arguments: [path]
})
const getVirtualDocument = async (path: string): Promise<string | null> => {
let content: string = ""
try {
content = await e.lspClient.sendRequest<string>(lsp.ExecuteCommandRequest.type.method, {
command: 'virtualMerge',
arguments: [path]
})
} catch(e) {}
return content
}