src/vs/base/common/jsonErrorMessages.ts

26 LOC · 12 covered · 14 uncovered · 1 ranges · 623 concepts · 1 introducers · 317 tests

File neighbourhood

The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the related-file, concept, and source links on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.

1 > /*--------------------------------------------------------------------------------------------- jsonErrorMessages.ts ×1
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > /**
7 > * Extracted from json.ts to keep json nls free.
8 > */
9 > import { localize } from '../../nls.js';
10 > import { ParseErrorCode } from './json.js';
11 >
12 > export function getParseErrorMessage(errorCode: ParseErrorCode): string {
13 switch (errorCode) {
14 case ParseErrorCode.InvalidSymbol: return localize('error.invalidSymbol', 'Invalid symbol');
15 case ParseErrorCode.InvalidNumberFormat: return localize('error.invalidNumberFormat', 'Invalid number format');
16 case ParseErrorCode.PropertyNameExpected: return localize('error.propertyNameExpected', 'Property name expected');
17 case ParseErrorCode.ValueExpected: return localize('error.valueExpected', 'Value expected');
18 case ParseErrorCode.ColonExpected: return localize('error.colonExpected', 'Colon expected');
19 case ParseErrorCode.CommaExpected: return localize('error.commaExpected', 'Comma expected');
20 case ParseErrorCode.CloseBraceExpected: return localize('error.closeBraceExpected', 'Closing brace expected');
21 case ParseErrorCode.CloseBracketExpected: return localize('error.closeBracketExpected', 'Closing bracket expected');
22 case ParseErrorCode.EndOfFileExpected: return localize('error.endOfFileExpected', 'End of file expected');
23 default:
24 return '';
25 }
26 }