當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript vscode-languageserver-types.Diagnostic類代碼示例

本文整理匯總了TypeScript中vscode-languageserver-types.Diagnostic的典型用法代碼示例。如果您正苦於以下問題:TypeScript Diagnostic類的具體用法?TypeScript Diagnostic怎麽用?TypeScript Diagnostic使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Diagnostic類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: test

	test('Diagnostic', () => {
		let diagnostic = Diagnostic.create(Range.create(1,2,8,9), 'message', DiagnosticSeverity.Warning, 99, 'source');
		ok(Range.is(diagnostic.range));
		strictEqual(diagnostic.message, 'message');
		strictEqual(diagnostic.severity, DiagnosticSeverity.Warning);
		strictEqual(diagnostic.code, 99);
		strictEqual(diagnostic.source, 'source');
	});
開發者ID:Blacklite,項目名稱:vscode-languageserver-node,代碼行數:8,代碼來源:helpers.test.ts

示例2: createDiagnosis

function createDiagnosis(range: Range, message: string, source: string = 'stylable', code?: string): Diagnostic {
    return Diagnostic.create(range, message, 2, code, source);
}
開發者ID:wix,項目名稱:stylable-intelligence,代碼行數:3,代碼來源:service.spec.ts

示例3: reportToDiagnostic

 // stylable diagnostic to protocol diagnostic
 function reportToDiagnostic(report: StylableDiagnostic) {
     const severity = report.type === 'error' ? 1 : 2;
     const range = createRange(report);
     return Diagnostic.create(range, report.message, severity);
 }
開發者ID:wix,項目名稱:stylable-intelligence,代碼行數:6,代碼來源:diagnosis.ts

示例4: createDiagnostic

function createDiagnostic(msg: string, range?: Range, severity?: DiagnosticSeverity): Diagnostic {
  range = range ? range : Range.create(0, 0, 0, 1)
  return Diagnostic.create(range, msg, severity || DiagnosticSeverity.Error)
}
開發者ID:demelev,項目名稱:coc.nvim,代碼行數:4,代碼來源:diagnosticManager.test.ts

示例5: createDiagnostic

function createDiagnostic(msg: string, range?: Range): Diagnostic {
  range = range ? range : Range.create(0, 0, 0, 1)
  return Diagnostic.create(range, msg)
}
開發者ID:demelev,項目名稱:coc.nvim,代碼行數:4,代碼來源:diagnosticCollection.test.ts


注:本文中的vscode-languageserver-types.Diagnostic類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。