Converted json extension to new vscode-nls npm module

This commit is contained in:
Dirk Baeumer
2016-03-03 16:54:36 +01:00
parent 189321eb12
commit 5354309a24
12 changed files with 167 additions and 144 deletions

View File

@@ -6,23 +6,25 @@
import {MarkedString, CompletionItemKind, CompletionItem} from 'vscode-languageserver';
import Strings = require('../utils/strings');
import nls = require('../utils/nls');
import {IJSONWorkerContribution, ISuggestionsCollector} from '../jsonContributions';
import {JSONLocation} from '../jsonLocation';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
let globProperties:CompletionItem[] = [
{ kind: CompletionItemKind.Value, label: nls.localize('fileLabel', "Files by Extension"), insertText: '"**/*.{{extension}}": true', documentation: nls.localize('fileDescription', "Match all files of a specific file extension.")},
{ kind: CompletionItemKind.Value, label: nls.localize('filesLabel', "Files with Multiple Extensions"), insertText: '"**/*.{ext1,ext2,ext3}": true', documentation: nls.localize('filesDescription', "Match all files with any of the file extensions.")},
{ kind: CompletionItemKind.Value, label: nls.localize('derivedLabel', "Files with Siblings by Name"), insertText: '"**/*.{{source-extension}}": { "when": "$(basename).{{target-extension}}" }', documentation: nls.localize('derivedDescription', "Match files that have siblings with the same name but a different extension.")},
{ kind: CompletionItemKind.Value, label: nls.localize('topFolderLabel', "Folder by Name (Top Level)"), insertText: '"{{name}}": true', documentation: nls.localize('topFolderDescription', "Match a top level folder with a specific name.")},
{ kind: CompletionItemKind.Value, label: nls.localize('topFoldersLabel', "Folders with Multiple Names (Top Level)"), insertText: '"{folder1,folder2,folder3}": true', documentation: nls.localize('topFoldersDescription', "Match multiple top level folders.")},
{ kind: CompletionItemKind.Value, label: nls.localize('folderLabel', "Folder by Name (Any Location)"), insertText: '"**/{{name}}": true', documentation: nls.localize('folderDescription', "Match a folder with a specific name in any location.")},
{ kind: CompletionItemKind.Value, label: localize('fileLabel', "Files by Extension"), insertText: '"**/*.{{extension}}": true', documentation: localize('fileDescription', "Match all files of a specific file extension.")},
{ kind: CompletionItemKind.Value, label: localize('filesLabel', "Files with Multiple Extensions"), insertText: '"**/*.{ext1,ext2,ext3}": true', documentation: localize('filesDescription', "Match all files with any of the file extensions.")},
{ kind: CompletionItemKind.Value, label: localize('derivedLabel', "Files with Siblings by Name"), insertText: '"**/*.{{source-extension}}": { "when": "$(basename).{{target-extension}}" }', documentation: localize('derivedDescription', "Match files that have siblings with the same name but a different extension.")},
{ kind: CompletionItemKind.Value, label: localize('topFolderLabel', "Folder by Name (Top Level)"), insertText: '"{{name}}": true', documentation: localize('topFolderDescription', "Match a top level folder with a specific name.")},
{ kind: CompletionItemKind.Value, label: localize('topFoldersLabel', "Folders with Multiple Names (Top Level)"), insertText: '"{folder1,folder2,folder3}": true', documentation: localize('topFoldersDescription', "Match multiple top level folders.")},
{ kind: CompletionItemKind.Value, label: localize('folderLabel', "Folder by Name (Any Location)"), insertText: '"**/{{name}}": true', documentation: localize('folderDescription', "Match a folder with a specific name in any location.")},
];
let globValues:CompletionItem[] = [
{ kind: CompletionItemKind.Value, label: nls.localize('trueLabel', "True"), insertText: 'true', documentation: nls.localize('trueDescription', "Enable the pattern.")},
{ kind: CompletionItemKind.Value, label: nls.localize('falseLabel', "False"), insertText: 'false', documentation: nls.localize('falseDescription', "Disable the pattern.")},
{ kind: CompletionItemKind.Value, label: nls.localize('derivedLabel', "Files with Siblings by Name"), insertText: '{ "when": "$(basename).{{extension}}" }', documentation: nls.localize('siblingsDescription', "Match files that have siblings with the same name but a different extension.")}
{ kind: CompletionItemKind.Value, label: localize('trueLabel', "True"), insertText: 'true', documentation: localize('trueDescription', "Enable the pattern.")},
{ kind: CompletionItemKind.Value, label: localize('falseLabel', "False"), insertText: 'false', documentation: localize('falseDescription', "Disable the pattern.")},
{ kind: CompletionItemKind.Value, label: localize('derivedLabel', "Files with Siblings by Name"), insertText: '{ "when": "$(basename).{{extension}}" }', documentation: localize('siblingsDescription', "Match files that have siblings with the same name but a different extension.")}
];
export class GlobPatternContribution implements IJSONWorkerContribution {