Skip to content

Commit

Permalink
Pre-PR cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
daytonellwanger committed Jul 28, 2020
1 parent c7c5531 commit 0e4eb53
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
38 changes: 19 additions & 19 deletions src/components/liveshare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import * as vscode from 'vscode'
import * as vsls from 'vsls/vscode'
import { Extension } from 'src/main'

const serviceName = 'pdfSync'
const serviceName = 'latex-workshop'
const pdfUpdateNotificationName = 'pdfUpdated'
const requestPdfRequestName = 'getPdf'
const requestPdfRequestName = 'requestPdf'
const invokeRemoteCommandRequestName = 'invokeRemoteCommand'
const logUpdateNotificationName = 'logUpdated'
const compilerUpdateNotificationName = 'compilerUpdated'
Expand Down Expand Up @@ -51,16 +51,6 @@ export class LiveShare {
}
}

getOutDir(fullPath: string | undefined): string {
if (this.role === vsls.Role.Guest) {
const config = vscode.workspace.getConfiguration('latex-workshop')
const outDir = config.get<string>('liveshare.outDir')
return outDir || `${os.tmpdir}/latex-workshop-liveshare`
} else {
return this.extension.manager.getOutDir(fullPath)
}
}

get isGuest(): boolean {
return this.role === vsls.Role.Guest
}
Expand All @@ -73,6 +63,16 @@ export class LiveShare {
return this.pdfPromise
}

getOutDir(fullPath: string | undefined): string {
if (this.role === vsls.Role.Guest) {
const config = vscode.workspace.getConfiguration('latex-workshop')
const outDir = config.get<string>('liveshare.outDir')
return outDir || `${os.tmpdir}/latex-workshop-liveshare`
} else {
return this.extension.manager.getOutDir(fullPath)
}
}

remoteCommand(command: string, callback: (...args: any[]) => any) {
return (...args: any[]) => {
if (!this.isGuest) {
Expand Down Expand Up @@ -188,16 +188,16 @@ export class LiveShare {
}

async requestPdf(texPath: string) {
if (this.requestedPdfs.indexOf(texPath) < 0) {
this.requestedPdfs.push(texPath)
const p = async () => {
if (this.guestService) {
const results = await this.guestService.request(requestPdfRequestName, [texPath])
if (this.guestService) {
if (this.requestedPdfs.indexOf(texPath) < 0) {
this.requestedPdfs.push(texPath)
const p = async () => {
const results = await this.guestService?.request(requestPdfRequestName, [texPath])
await this.writePdf(results)
}
this.pdfPromise = p()
await this.pdfPromise
}
this.pdfPromise = p()
await this.pdfPromise
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {EnvPair} from './components/envpair'
import {Section} from './components/section'
import {Parser as LogParser} from './components/parser/log'
import {UtensilsParser as PEGParser} from './components/parser/syntax'
import { LiveShare } from './components/liveshare'

import {Completer} from './providers/completion'
import {BibtexCompleter} from './providers/bibtexcompletion'
Expand All @@ -36,7 +37,6 @@ import { SnippetPanel } from './components/snippetpanel'
import { BibtexFormater } from './components/bibtexformater'

import {checkDeprecatedFeatures, newVersionMessage, obsoleteConfigCheck} from './config'
import { LiveShare } from './components/liveshare'

function conflictExtensionCheck() {
function check(extensionID: string, name: string, suggestion: string) {
Expand Down

0 comments on commit 0e4eb53

Please sign in to comment.