parent
cca85a2724
commit
a31d8acf66
1 changed files with 12 additions and 4 deletions
|
@ -480,7 +480,10 @@ export default class BufferSyncSupport {
|
|||
}
|
||||
|
||||
public getErr(resources: Uri[]): any {
|
||||
const handledResources = resources.filter(resource => this.handles(resource.toString()))
|
||||
const handledResources = resources.filter(resource => {
|
||||
let syncedBuffer = this.syncedBuffers.get(resource.toString())
|
||||
return syncedBuffer && this.shouldValidate(syncedBuffer)
|
||||
})
|
||||
if (!handledResources.length) {
|
||||
return
|
||||
}
|
||||
|
@ -525,16 +528,21 @@ export default class BufferSyncSupport {
|
|||
this.pendingGetErr.cancel()
|
||||
for (const uri of this.pendingGetErr.uris) {
|
||||
let resource = uri.toString()
|
||||
if (this.syncedBuffers.get(resource)) {
|
||||
let syncedBuffer = this.syncedBuffers.get(resource)
|
||||
if (syncedBuffer && this.shouldValidate(syncedBuffer)) {
|
||||
orderedFileSet.set(resource, undefined)
|
||||
} else {
|
||||
orderedFileSet.delete(resource)
|
||||
}
|
||||
}
|
||||
this.pendingGetErr = undefined
|
||||
}
|
||||
// Add all open TS buffers to the geterr request. They might be visible
|
||||
for (const buffer of this.syncedBuffers.values) {
|
||||
if (this.shouldValidate(buffer)) {
|
||||
orderedFileSet.set(buffer.resource, undefined)
|
||||
}
|
||||
}
|
||||
if (orderedFileSet.size) {
|
||||
let uris = Array.from(orderedFileSet.uris).map(uri => Uri.parse(uri))
|
||||
const getErr = this.pendingGetErr = GetErrRequest.executeGetErrRequest(this.client, uris, () => {
|
||||
|
@ -554,7 +562,7 @@ export default class BufferSyncSupport {
|
|||
this._validateTypeScript = tsConfig.get<boolean>('validate.enable', true)
|
||||
}
|
||||
|
||||
private shouldValidate(buffer: SyncedBuffer) {
|
||||
private shouldValidate(buffer: SyncedBuffer): boolean {
|
||||
switch (buffer.kind) {
|
||||
case BufferKind.JavaScript:
|
||||
return this._validateJavaScript
|
||||
|
|
Loading…
Reference in a new issue