How to use the vscode-nls.loadMessageBundle function in vscode-nls

To help you get started, we’ve selected a few vscode-nls examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws / aws-toolkit-vscode / src / lambda / config / templates.ts View on Github external
// Use jsonc-parser.parse instead of JSON.parse, as JSONC can handle comments. VS Code uses jsonc-parser
// under the hood to provide symbols for JSON documents, so this will keep us consistent with VS code.
import { access, writeFile } from 'fs-extra'
import * as jsonParser from 'jsonc-parser'
import * as os from 'os'
import * as _path from 'path'
import * as vscode from 'vscode'
import * as nls from 'vscode-nls'
import { mkdir } from '../../shared/filesystem'
import * as fsUtils from '../../shared/filesystemUtilities'
import { getLogger, Logger } from '../../shared/logger'
import { getTabSizeSetting } from '../../shared/utilities/editorUtilities'
import { saveDocumentIfDirty } from '../../shared/utilities/textDocumentUtilities'

const localize = nls.loadMessageBundle()

export interface TemplatesConfig {
    templates: {
        [relativePath: string]: TemplateConfig | undefined
    }
}

export interface TemplateConfig {
    parameterOverrides?: {
        [key: string]: string | undefined
    }
    handlers?: {
        [handler: string]: HandlerConfig | undefined
    }
}
github microsoft / vscode-chrome-debug-core / src / chrome / internal / features / skipFiles.ts View on Github external
import { IToggleSkipFileStatusArgs, utils, Crdp, BaseSourceMapTransformer, parseResourceIdentifier } from '../../..';
import { logger } from 'vscode-debugadapter/lib/logger';
import { IScript } from '../scripts/script';
import { BasePathTransformer } from '../../../transformers/basePathTransformer';
import { CDTPDiagnostics } from '../../target/cdtpDiagnostics';
import { StackTracesLogic, IStackTracePresentationLogicProvider } from '../stackTraces/stackTracesLogic';
import { newResourceIdentifierMap, IResourceIdentifier, parseResourceIdentifiers } from '../sources/resourceIdentifier';
import { IComponent } from './feature';
import { ScriptParsedEvent } from '../../target/events';
import { LocationInLoadedSource } from '../locations/location';
import { ICallFramePresentationDetails } from '../stackTraces/callFramePresentation';
import * as nls from 'vscode-nls';
import { injectable, inject, LazyServiceIdentifer } from 'inversify';
import { DeleteMeScriptsRegistry } from '../scripts/scriptsRegistry';
import { TYPES } from '../../dependencyInjection.ts/types';
const localize = nls.loadMessageBundle();

export interface EventsConsumedBySkipFilesLogic {
    onScriptParsed(listener: (scriptEvent: ScriptParsedEvent) => Promise): void;
}

export interface ISkipFilesConfiguration {
    skipFiles?: string[]; // an array of file names or glob patterns
    skipFileRegExps?: string[]; // a supplemental array of library code regex patterns
}

@injectable()
export class SkipFilesLogic implements IComponent, IStackTracePresentationLogicProvider {
    private _blackboxedRegexes: RegExp[] = [];
    private _skipFileStatuses = newResourceIdentifierMap();
    public reprocessPausedEvent: () => void; // TODO DIEGO: Do this in a better way
github aws / aws-toolkit-vscode / src / awsexplorer / nodes / ecsClustersNode.ts View on Github external
/*!
 * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0
 */

import * as vscode from 'vscode'
import * as nls from 'vscode-nls'
const localize = nls.loadMessageBundle()

import { EcsClient } from '../../shared/clients/ecsClient'
import { ext } from '../../shared/extensionGlobals'
import { AWSTreeErrorHandlerNode } from '../../shared/treeview/nodes/awsTreeErrorHandlerNode'
import { ErrorNode } from '../../shared/treeview/nodes/errorNode'
import { PlaceholderNode } from '../../shared/treeview/nodes/placeholderNode'
import { asyncIterableWithStatusBarUpdate, toMapAsync, updateInPlace } from '../../shared/utilities/collectionUtils'
import { DefaultEcsClusterNode } from './ecsClusterNode'
import { EcsClusterNode, EcsClustersNode, EcsNode } from './ecsNodeInterfaces'

export class DefaultEcsClustersNode extends AWSTreeErrorHandlerNode implements EcsClustersNode {

    public get regionCode(): string {
        return this.parent.regionCode
    }
    private readonly clusterNodes: Map
github adamvoss / vscode-yaml / server / src / jsoncontributions / globPatternContribution.ts View on Github external
/*---------------------------------------------------------------------------------------------
 *  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 { MarkedString, CompletionItemKind, CompletionItem, InsertTextFormat } from 'vscode-languageserver';
import Strings = require('../utils/strings');
import { JSONWorkerContribution, JSONPath, CompletionsCollector } from 'vscode-json-languageservice';

import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();

let globProperties: CompletionItem[] = [
	{ kind: CompletionItemKind.Value, label: localize('fileLabel', "Files by Extension"), insertText: '"**/*.${1:extension}": true', insertTextFormat: InsertTextFormat.Snippet, 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: '"**/*.${1:source-extension}": { "when": "$(basename).${2:target-extension}" }', insertTextFormat: InsertTextFormat.Snippet, 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: '"${1:name}": true', insertTextFormat: InsertTextFormat.Snippet, 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: '"**/${1:name}": true', insertTextFormat: InsertTextFormat.Snippet, documentation: localize('folderDescription', "Match a folder with a specific name in any location.") },
];

let globValues: CompletionItem[] = [
	{ kind: CompletionItemKind.Value, label: localize('trueLabel', "true"), filterText: 'true', insertText: 'true', documentation: localize('trueDescription', "Enable the pattern.") },
	{ kind: CompletionItemKind.Value, label: localize('falseLabel', "false"), filterText: 'false', insertText: 'false', documentation: localize('falseDescription', "Disable the pattern.") },
	{ kind: CompletionItemKind.Value, label: localize('derivedLabel', "Files with Siblings by Name"), insertText: '{ "when": "$(basename).${1:extension}" }', insertTextFormat: InsertTextFormat.Snippet, documentation: localize('siblingsDescription', "Match files that have siblings with the same name but a different extension.") }
];
github neet / vscode-qiita / src / explorers / qiitaItems.ts View on Github external
import { Item } from 'qiita-js-2';
import {
  Command,
  Event,
  EventEmitter,
  TreeDataProvider,
  TreeItem,
  TreeItemCollapsibleState,
  Uri,
} from 'vscode';
import * as nls from 'vscode-nls';
import { itemsStore } from '../stores/itemsStore';

const localize = nls.loadMessageBundle();


export class QiitaItem extends TreeItem {
  /**
   * "Qiitaの投稿" ビューに表示されるアイテム
   * @param item Qiitaの投稿
   * @param collapsibleState アイテムが折り畳まれているかの状態
   * @param command クリック時に発火するコマンド
   */
  constructor (
    public readonly item: Item,
    public readonly collapsibleState: TreeItemCollapsibleState,
    public readonly command: Command,
  ) {
    super(item.title, collapsibleState);
  }
github microsoft / vscode-chrome-debug-core / src / chrome / internal / breakpoints / bpActionWhenHit.ts View on Github external
/*---------------------------------------------------------
 * Copyright (C) Microsoft Corporation. All rights reserved.
 *--------------------------------------------------------*/

import { IEquivalenceComparable } from '../../utils/equivalence';

import * as nls from 'vscode-nls';
let localize = nls.loadMessageBundle();

/**
 * These classes represents the different actions that a breakpoint can take when hit
 * Breakpoint: AlwaysPause
 * Conditional Breakpoint: ConditionalPause
 * Logpoint: LogMessage
 * Hit Count Breakpoint: PauseOnHitCount
 */
export interface IBPActionWhenHit extends IEquivalenceComparable {
    isEquivalentTo(bpActionWhenHit: IBPActionWhenHit): boolean;
}

export class AlwaysPause implements IBPActionWhenHit {
    public isEquivalentTo(bpActionWhenHit: IBPActionWhenHit): boolean {
        return bpActionWhenHit instanceof AlwaysPause;
    }
github codesandbox / codesandbox-client / standalone-packages / vscode-extensions / out / extensions / jpoissonnier.vscode-styled-components-0.0.26 / node_modules / vscode-css-languageservice / lib / umd / services / selectorPrinting.js View on Github external
})(function (require, exports) {
    /*---------------------------------------------------------------------------------------------
     *  Copyright (c) Microsoft Corporation. All rights reserved.
     *  Licensed under the MIT License. See License.txt in the project root for license information.
     *--------------------------------------------------------------------------------------------*/
    'use strict';
    Object.defineProperty(exports, "__esModule", { value: true });
    var nodes = require("../parser/cssNodes");
    var cssScanner_1 = require("../parser/cssScanner");
    var nls = require("vscode-nls");
    var localize = nls.loadMessageBundle();
    var Element = /** @class */ (function () {
        function Element() {
        }
        Element.prototype.findAttribute = function (name) {
            if (this.attributes) {
                for (var _i = 0, _a = this.attributes; _i < _a.length; _i++) {
                    var attribute = _a[_i];
                    if (attribute.name === name) {
                        return attribute.value;
                    }
                }
            }
            return null;
        };
        Element.prototype.addChild = function (child) {
            if (child instanceof Element) {
github microsoft / vscode-chrome-debug-core / src / chrome / internal / stackTraces / stackTracesLogic.ts View on Github external
import { DebugProtocol } from 'vscode-debugprotocol';
import { injectable, inject, LazyServiceIdentifer } from 'inversify';

import * as errors from '../../../errors';
import * as path from 'path';

import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
import { PausedEvent } from '../../target/events';
import { StackTracePresentation, FramePresentationOrLabel, StackTraceLabel } from './stackTracePresentation';
import { ILoadedSource } from '../sources/loadedSource';
import { CodeFlowStackTrace } from './stackTrace';
import { IScript } from '../scripts/script';
import { CodeFlowFrame, ICallFrame, ScriptCallFrame, LoadedSourceCallFrame } from './callFrame';
import { LocationInLoadedSource } from '../locations/location';
import { CallFramePresentation, CallFramePresentationHint, SourcePresentationHint, ICallFramePresentationDetails } from './callFramePresentation';
import { FormattedName } from './callFrameName';
import { IComponent, ComponentConfiguration } from '../features/feature';
import { InformationAboutPausedProvider } from '../features/takeProperActionOnPausedEvent';
import { asyncMap } from '../../collections/async';
import { TYPES } from '../../dependencyInjection.ts/types';
import { IAsyncDebuggingConfiguration } from '../../target/cdtpDebugger';

export interface EventsConsumedByStackTrace {
github microsoft / vscode / extensions / merge-conflict / src / commandHandler.ts View on Github external
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
import * as interfaces from './interfaces';
import ContentProvider from './contentProvider';
import * as path from 'path';
import { loadMessageBundle } from 'vscode-nls';
const localize = loadMessageBundle();

interface IDocumentMergeConflictNavigationResults {
	canNavigate: boolean;
	conflict?: interfaces.IDocumentMergeConflict;
}

enum NavigationDirection {
	Forwards,
	Backwards
}

export default class CommandHandler implements vscode.Disposable {

	private disposables: vscode.Disposable[] = [];
	private tracker: interfaces.IDocumentMergeConflictTracker;
github vscode-restructuredtext / vscode-restructuredtext / src / features / preview.ts View on Github external
import * as vscode from 'vscode';
import * as path from 'path';

import { Logger } from '../logger';
import { RSTContentProvider } from './previewContentProvider';
import { disposeAll } from '../util/dispose';

import * as nls from 'vscode-nls';
import { getVisibleLine, RSTFileTopmostLineMonitor } from '../util/topmostLineMonitor';
import { RSTPreviewConfigurationManager } from './previewConfig';
import { isRSTFile } from '../util/file';
import { getExtensionPath } from '../extension';
import { Configuration } from './utils/configuration';

const localize = nls.loadMessageBundle();

export class RSTPreview {

	public static viewType = 'restructuredtext.preview';

	private _resource: vscode.Uri;
	private _locked: boolean;

	private readonly editor: vscode.WebviewPanel;
	private throttleTimer: any;
	private line: number | undefined = undefined;
	private readonly disposables: vscode.Disposable[] = [];
	private firstUpdate = true;
	private currentVersion?: { resource: vscode.Uri, version: number };
	private forceUpdate = false;
	private isScrolling = false;

vscode-nls

NPM module to externalize and localize VSCode extensions

MIT
Latest version published 2 years ago

Package Health Score

56 / 100
Full package analysis

Similar packages