ignore fugitive scheme

Closes  #395
This commit is contained in:
Qiming Zhao 2022-08-27 12:28:53 +08:00
parent d4a7f4f38f
commit dea4c3a0c6
No known key found for this signature in database
GPG key ID: 9722CD0E8D4DCB8C
5 changed files with 12 additions and 9 deletions

View file

@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { DiagnosticCollection, languages, workspace } from 'coc.nvim'
import { DiagnosticCollection, Uri, languages, workspace } from 'coc.nvim'
import { Diagnostic, DiagnosticTag } from 'vscode-languageserver-protocol'
import { ResourceMap } from './resourceMap'

View file

@ -42,6 +42,7 @@ export default class TypeScriptServiceClient implements ITypeScriptServiceClient
private fileConfigurationManager: FileConfigurationManager
private pathSeparator: string
private readonly emptyAuthority = 'ts-nul-authority'
private tracer: Tracer
private _configuration: TypeScriptServiceConfiguration
private versionProvider: TypeScriptVersionProvider
@ -432,7 +433,7 @@ export default class TypeScriptServiceClient implements ITypeScriptServiceClient
public toResource(filepath: string): string {
if (filepath.includes('zipfile:')) {
return filepath.replace(/.*zipfile:/, 'zipfile://');
return filepath.replace(/.*zipfile:/, 'zipfile://')
}
if (this._apiVersion.gte(API.v213)) {
if (filepath.startsWith(this.inMemoryResourcePrefix + 'untitled:')) {
@ -938,7 +939,7 @@ function getDiagnosticsKind(event: Proto.Event): DiagnosticKind {
case 'suggestionDiag':
return DiagnosticKind.Suggestion
}
throw new Error('Unknown dignostics kind')
throw new Error('Unknown diagnostics kind')
}
const fenceCommands = new Set(['change', 'close', 'open'])

View file

@ -215,11 +215,11 @@ export default class TypeScriptServiceClientHost implements Disposable {
language.diagnosticsReceived(
kind,
resource,
this.createMarkerDatas(diagnostics))
this.createMarkerData(diagnostics))
}
}
private createMarkerDatas(diagnostics: Proto.Diagnostic[]): (Diagnostic & { reportUnnecessary: any, reportDeprecated: any })[] {
private createMarkerData(diagnostics: Proto.Diagnostic[]): (Diagnostic & { reportUnnecessary: any, reportDeprecated: any })[] {
return diagnostics.map(tsDiag => this.tsDiagnosticToLspDiagnostic(tsDiag))
}

View file

@ -6,6 +6,7 @@
export const file = 'file'
export const untitled = 'untitled'
export const git = 'git'
export const fugitive = 'fugitive'
/** Live share scheme */
export const vsls = 'vsls'
export const walkThroughSnippet = 'walkThroughSnippet'
@ -21,5 +22,6 @@ export const semanticSupportedSchemes = [
*/
export const disabledSchemes = new Set([
git,
fugitive,
vsls
])