<commit_before>/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
'use strict';

import Parser = require('./jsonParser');
import SchemaService = require('./jsonSchemaService');
import Strings = require('./utils/strings');

import {SymbolInformation, SymbolKind, ITextDocument, Range, Location} from 'vscode-languageserver';

export class JSONDocumentSymbols {

	constructor() {
	}

	public compute(document: ITextDocument, doc: Parser.JSONDocument): Promise<SymbolInformation[]> {

		let root = doc.root;
		if (!root) {
			return Promise.resolve(null);
		}

		// special handling for key bindings
		let resourceString = document.uri;
		if ((resourceString === 'inmemory://defaults/keybindings.json') || Strings.endsWith(resourceString.toLowerCase(), '/user/keybindings.json')) {
			if (root.type === 'array') {
				let result: SymbolInformation[] = [];<commit_msg>Use 'vscode' URI for keybinding schema and default doc<commit_after>/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
'use strict';

import Parser = require('./jsonParser');
import SchemaService = require('./jsonSchemaService');
import Strings = require('./utils/strings');

import {SymbolInformation, SymbolKind, ITextDocument, Range, Location} from 'vscode-languageserver';

export class JSONDocumentSymbols {

	constructor() {
	}

	public compute(document: ITextDocument, doc: Parser.JSONDocument): Promise<SymbolInformation[]> {

		let root = doc.root;
		if (!root) {
			return Promise.resolve(null);
		}

		// special handling for key bindings
		let resourceString = document.uri;
		if ((resourceString === 'vscode://defaultsettings/keybindings.json') || Strings.endsWith(resourceString.toLowerCase(), '/user/keybindings.json')) {
			if (root.type === 'array') {
				let result: SymbolInformation[] = [];
{'fraction_non_alphanumeric': 0.26936026936026936, 'fraction_numerical': 0.0, 'mean_word_length': 2.3431786216596344, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3810366', 'n_tokens_mistral': 588, 'n_tokens_neox': 555, 'n_words': 162}