How to use vscode-nls - 10 common examples

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 forcedotcom / salesforcedx-vscode / packages / salesforcedx-visualforce-language-server / src / visualforceServer.ts View on Github external
ServerCapabilities as CPServerCapabilities
} from 'vscode-languageserver-protocol';
import {
  ConfigurationParams,
  ConfigurationRequest
} from 'vscode-languageserver-protocol';

import { format } from './modes/formatting';
import { pushAll } from './utils/arrays';

import * as path from 'path';
import * as url from 'url';
import uri from 'vscode-uri';

import * as nls from 'vscode-nls';
nls.config(process.env['VSCODE_NLS_CONFIG']);

// tslint:disable-next-line:no-namespace
namespace TagCloseRequest {
  export const type: RequestType<
    TextDocumentPositionParams,
    string,
    any,
    any
  > = new RequestType('html/tag');
}

// Create a connection for the server
const connection: IConnection = createConnection();

console.log = connection.console.log.bind(connection.console);
console.error = connection.console.error.bind(connection.console);
github satokaz / vscode-memo-life-for-you / src / memoOpenFolder.ts View on Github external

'use strict';

import * as vscode from 'vscode';
import * as fs from 'fs';
import * as path from 'path';
import * as dateFns from 'date-fns';
import * as nls from 'vscode-nls';
import * as os from 'os';
import { memoConfigure } from './memoConfigure';

const localize = nls.config(process.env.VSCODE_NLS_CONFIG)();

export class memoOpenFolder extends memoConfigure {
    constructor() {
        super();
        // console.log('memoOpenFolder');
        // console.log(this.memodir);
        // console.log('vscode.Uri =', vscode.Uri.file(this.memodir));
    }

    /**
     * Open Dir
     */
    public OpenDir() {
        this.readConfig();
        let folderUrl = vscode.Uri.file(this.memodir);
        vscode.commands.executeCommand("vscode.openFolder", folderUrl, true);
github satokaz / vscode-memo-life-for-you / src / memoOpenTypora.ts View on Github external
'use strict';

import * as vscode from 'vscode';
import * as cp from 'child_process';
import * as fs from 'fs';
import * as nls from 'vscode-nls';
import { memoConfigure } from './memoConfigure';

const localize = nls.config(process.env.VSCODE_NLS_CONFIG)();

export class memoOpenTypora extends memoConfigure {

    constructor() {
        super();
    }
    
    /**
     * OpenTypora
     */
    public OpenTypora() {
        this.readConfig();
        // memopath に設定されたコマンドが実行可能かチェック
        console.log(this.memopath);

        // memo-life-for-you.TyporaExecPath
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 microsoft / vscode-cmake-tools / src / debugger.ts View on Github external
import {ExecutableTarget} from '@cmt/api';
import {CMakeCache} from '@cmt/cache';
import * as proc from '@cmt/proc';
import {createLogger} from './logging';
import * as nls from 'vscode-nls';

nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();

const log = createLogger('debugger');


export enum DebuggerType {
  VisualStudio = 'Visual Studio',
  LLDB = 'LLDB',
  GDB = 'GDB',
  // LAUNCH // Future
}

/**
 * Describes configuration options for debugger in kit
 */
export interface DebuggerConfiguration {
github zowe / vscode-extension-for-zowe / src / Profiles.ts View on Github external
* SPDX-License-Identifier: EPL-2.0                                                *
*                                                                                 *
* Copyright Contributors to the Zowe Project.                                     *
*                                                                                 *
*/

import { IProfileLoaded, Logger, CliProfileManager, Imperative, ImperativeConfig, IProfile, Session, ISession } from "@brightside/imperative";
import * as nls from "vscode-nls";
import * as os from "os";
import * as fs from "fs";
import * as path from "path";
import { URL } from "url";
import * as vscode from "vscode";
import * as zowe from "@brightside/core";
import * as ProfileLoader from "./ProfileLoader";
const localize = nls.config({ messageFormat: nls.MessageFormat.file })();
interface IUrlValidator {
    valid: boolean;
    host: string;
    port: number;
}

let IConnection: {
    name: string;
    host: string;
    port: number;
    user: string;
    password: string;
    rejectUnauthorized: boolean;
};

export class Profiles { // Processing stops if there are no profiles detected
github microsoft / vscode-cpptools / Extension / src / LanguageServer / references.ts View on Github external
/* --------------------------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All Rights Reserved.
 * See 'LICENSE' in the project root for license information.
 * ------------------------------------------------------------------------------------------ */
'use strict';
import * as vscode from 'vscode';
import { DefaultClient, RenameParams, FindAllReferencesParams } from './client';
import { FindAllRefsView } from './referencesView';
import * as telemetry from '../telemetry';
import * as nls from 'vscode-nls';
import { RenameView } from './renameView';
import * as logger from '../logger';
import { PersistentState } from './persistentState';

nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();

export enum ReferenceType {
    Confirmed,
    ConfirmationInProgress,
    Comment,
    String,
    Inactive,
    CannotConfirm,
    NotAReference
}

export interface ReferenceInfo {
    file: string;
    position: vscode.Position;
    text: string;
github microsoft / vscode-cpptools / Extension / src / LanguageServer / referencesTreeDataProvider.ts View on Github external
/* --------------------------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All Rights Reserved.
 * See 'LICENSE' in the project root for license information.
 * ------------------------------------------------------------------------------------------ */
'use strict';
import * as vscode from 'vscode';
import * as util from '../common';
import { ReferencesModel, TreeNode, NodeType } from './referencesModel';
import { ReferenceType, getReferenceTagString } from './references';
import * as nls from 'vscode-nls';

nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();

export function getReferenceTypeIconPath(referenceType: ReferenceType): { light: string; dark: string } {
    const assetsFolder: string = "assets/";
    const postFixLight: string = "-light.svg";
    const postFixDark: string = "-dark.svg";
    let basePath: string = "ref-cannot-confirm";

    switch (referenceType) {
        case ReferenceType.Confirmed: basePath = "ref-confirmed"; break;
        case ReferenceType.Comment: basePath = "ref-comment"; break;
        case ReferenceType.String: basePath = "ref-string"; break;
        case ReferenceType.Inactive: basePath = "ref-inactive"; break;
        case ReferenceType.CannotConfirm: basePath = "ref-cannot-confirm"; break;
        case ReferenceType.NotAReference: basePath = "ref-not-a-reference"; break;
        case ReferenceType.ConfirmationInProgress: basePath = "ref-confirmation-in-progress"; break;
github microsoft / vscode-cpptools / Extension / src / Debugger / attachQuickPick.ts View on Github external
/* --------------------------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All Rights Reserved.
 * See 'LICENSE' in the project root for license information.
 * ------------------------------------------------------------------------------------------ */

import * as util from '../common';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';

nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();

class RefreshButton implements vscode.QuickInputButton {
    get iconPath(): { dark: vscode.Uri; light: vscode.Uri } {
        const refreshImagePathDark: string = util.getExtensionFilePath("assets/Refresh_inverse.svg");
        const refreshImagePathLight: string = util.getExtensionFilePath("assets/Refresh.svg");

        return {
            dark: vscode.Uri.file(refreshImagePathDark),
            light: vscode.Uri.file(refreshImagePathLight)
        };
    }

    get tooltip(): string {
        return localize("refresh.process.list.tooltip", "Refresh process list");
    }

vscode-nls

NPM module to externalize and localize VSCode extensions

MIT
Latest version published 2 years ago

Package Health Score

58 / 100
Full package analysis

Similar packages