Clean up error messages for using TypeScript syntax in JavaScr… (#35254)

* Fix up quotation marks in error messages in JavaScript files.

* Accepted baselines.

* Typescript -> TypeScript

* Accepted baselines.

* Migrate syntactic diagnostics tests to baselining tests.

* Accepted baselines.

* Update diagnosticMessages.json

* Removed markers.

* Add ability to baseline both semantic and syntactic diagnostics.

* Fix up broken diagnostics when using a server LS.

* Accepted baselines.

* Lints.

* Fake up sourcefile objects in the tsserver session client instead.

* Fewer allocations.
This commit is contained in:
Daniel Rosenwasser authored and GitHub committed 2019-11-22 14:51:22 -08:00
1 parent 3e329469c1
commit 3da85df511
79 files changed
+547 -387

No files matched your search

+1 -1
View File
@@ -1539,7 +1539,7 @@ namespace ts {
}
if (element.questionToken) {
errors.push(createDiagnosticForNodeInSourceFile(sourceFile, element.questionToken, Diagnostics._0_can_only_be_used_in_a_ts_file, "?"));
errors.push(createDiagnosticForNodeInSourceFile(sourceFile, element.questionToken, Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?"));
}
if (!isDoubleQuotedString(element.name)) {
errors.push(createDiagnosticForNodeInSourceFile(sourceFile, element.name, Diagnostics.String_literal_with_double_quotes_expected));