parent
d4a7f4f38f
commit
dea4c3a0c6
5 changed files with 12 additions and 9 deletions
|
@ -30,21 +30,21 @@ class CloseOperation {
|
||||||
readonly type = BufferOperationType.Close;
|
readonly type = BufferOperationType.Close;
|
||||||
constructor(
|
constructor(
|
||||||
public readonly args: string
|
public readonly args: string
|
||||||
) { }
|
) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
class OpenOperation {
|
class OpenOperation {
|
||||||
readonly type = BufferOperationType.Open;
|
readonly type = BufferOperationType.Open;
|
||||||
constructor(
|
constructor(
|
||||||
public readonly args: Proto.OpenRequestArgs
|
public readonly args: Proto.OpenRequestArgs
|
||||||
) { }
|
) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ChangeOperation {
|
class ChangeOperation {
|
||||||
readonly type = BufferOperationType.Change;
|
readonly type = BufferOperationType.Change;
|
||||||
constructor(
|
constructor(
|
||||||
public readonly args: Proto.FileCodeEdits
|
public readonly args: Proto.FileCodeEdits
|
||||||
) { }
|
) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
type BufferOperation = CloseOperation | OpenOperation | ChangeOperation
|
type BufferOperation = CloseOperation | OpenOperation | ChangeOperation
|
||||||
|
@ -59,7 +59,7 @@ class SyncedBuffer {
|
||||||
public readonly filepath: string,
|
public readonly filepath: string,
|
||||||
private readonly client: ITypeScriptServiceClient,
|
private readonly client: ITypeScriptServiceClient,
|
||||||
private readonly synchronizer: BufferSynchronizer,
|
private readonly synchronizer: BufferSynchronizer,
|
||||||
) { }
|
) {}
|
||||||
|
|
||||||
public open(): void {
|
public open(): void {
|
||||||
const args: Proto.OpenRequestArgs = {
|
const args: Proto.OpenRequestArgs = {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* 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 { Diagnostic, DiagnosticTag } from 'vscode-languageserver-protocol'
|
||||||
import { ResourceMap } from './resourceMap'
|
import { ResourceMap } from './resourceMap'
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,7 @@ export default class TypeScriptServiceClient implements ITypeScriptServiceClient
|
||||||
|
|
||||||
private fileConfigurationManager: FileConfigurationManager
|
private fileConfigurationManager: FileConfigurationManager
|
||||||
private pathSeparator: string
|
private pathSeparator: string
|
||||||
|
private readonly emptyAuthority = 'ts-nul-authority'
|
||||||
private tracer: Tracer
|
private tracer: Tracer
|
||||||
private _configuration: TypeScriptServiceConfiguration
|
private _configuration: TypeScriptServiceConfiguration
|
||||||
private versionProvider: TypeScriptVersionProvider
|
private versionProvider: TypeScriptVersionProvider
|
||||||
|
@ -432,7 +433,7 @@ export default class TypeScriptServiceClient implements ITypeScriptServiceClient
|
||||||
|
|
||||||
public toResource(filepath: string): string {
|
public toResource(filepath: string): string {
|
||||||
if (filepath.includes('zipfile:')) {
|
if (filepath.includes('zipfile:')) {
|
||||||
return filepath.replace(/.*zipfile:/, 'zipfile://');
|
return filepath.replace(/.*zipfile:/, 'zipfile://')
|
||||||
}
|
}
|
||||||
if (this._apiVersion.gte(API.v213)) {
|
if (this._apiVersion.gte(API.v213)) {
|
||||||
if (filepath.startsWith(this.inMemoryResourcePrefix + 'untitled:')) {
|
if (filepath.startsWith(this.inMemoryResourcePrefix + 'untitled:')) {
|
||||||
|
@ -938,7 +939,7 @@ function getDiagnosticsKind(event: Proto.Event): DiagnosticKind {
|
||||||
case 'suggestionDiag':
|
case 'suggestionDiag':
|
||||||
return DiagnosticKind.Suggestion
|
return DiagnosticKind.Suggestion
|
||||||
}
|
}
|
||||||
throw new Error('Unknown dignostics kind')
|
throw new Error('Unknown diagnostics kind')
|
||||||
}
|
}
|
||||||
|
|
||||||
const fenceCommands = new Set(['change', 'close', 'open'])
|
const fenceCommands = new Set(['change', 'close', 'open'])
|
||||||
|
|
|
@ -215,11 +215,11 @@ export default class TypeScriptServiceClientHost implements Disposable {
|
||||||
language.diagnosticsReceived(
|
language.diagnosticsReceived(
|
||||||
kind,
|
kind,
|
||||||
resource,
|
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))
|
return diagnostics.map(tsDiag => this.tsDiagnosticToLspDiagnostic(tsDiag))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
export const file = 'file'
|
export const file = 'file'
|
||||||
export const untitled = 'untitled'
|
export const untitled = 'untitled'
|
||||||
export const git = 'git'
|
export const git = 'git'
|
||||||
|
export const fugitive = 'fugitive'
|
||||||
/** Live share scheme */
|
/** Live share scheme */
|
||||||
export const vsls = 'vsls'
|
export const vsls = 'vsls'
|
||||||
export const walkThroughSnippet = 'walkThroughSnippet'
|
export const walkThroughSnippet = 'walkThroughSnippet'
|
||||||
|
@ -21,5 +22,6 @@ export const semanticSupportedSchemes = [
|
||||||
*/
|
*/
|
||||||
export const disabledSchemes = new Set([
|
export const disabledSchemes = new Set([
|
||||||
git,
|
git,
|
||||||
|
fugitive,
|
||||||
vsls
|
vsls
|
||||||
])
|
])
|
||||||
|
|
Loading…
Reference in a new issue