How to use the vscode-languageclient.RevealOutputChannelOn.Never function in vscode-languageclient

To help you get started, we’ve selected a few vscode-languageclient 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 redhat-developer / vscode-xml / src / extension.ts View on Github external
}).then(requirements => {
    let clientOptions: LanguageClientOptions = {
      // Register the server for xml and xsl
      documentSelector: [
        { scheme: 'file', language: 'xml' },
        { scheme: 'file', language: 'xsl' },
        { scheme: 'untitled', language: 'xml' },
        { scheme: 'untitled', language: 'xsl' }
      ],
      revealOutputChannelOn: RevealOutputChannelOn.Never,
      //wrap with key 'settings' so it can be handled same a DidChangeConfiguration
      initializationOptions: {
        settings: getXMLSettings(requirements.java_home),
        extendedClientCapabilities: {
          codeLens: {
            codeLensKind: {
              valueSet: [
                'references'
              ]
            }
          }
        }
      }, 
      synchronize: {
        //preferences starting with these will trigger didChangeConfiguration
        configurationSection: ['xml', '[xml]']
github bmewburn / vscode-intelephense / src / extension.ts View on Github external
let initializationOptions = {
		storagePath: context.storagePath,
		clearCache: clearCache,
        globalStoragePath: context.globalStoragePath,
        licenceKey: context.globalState.get(LICENCE_MEMENTO_KEY),
		isVscode: true
	};

	// Options to control the language client
	let clientOptions: LanguageClientOptions = {
		documentSelector: [
			{ language: PHP_LANGUAGE_ID, scheme: 'file' },
			{ language: PHP_LANGUAGE_ID, scheme: 'untitled' }
		],
        initializationOptions: initializationOptions,
        revealOutputChannelOn: RevealOutputChannelOn.Never,
		middleware: middleware
	}

	// Create the language client and start the client.
	languageClient = new LanguageClient('intelephense', 'intelephense', serverOptions, clientOptions);
	languageClient.onReady().then(() => {
		registerNotificationListeners();
		showStartMessage(context);
	});
	return languageClient;
}
github vuejs / vetur / client / vueMain.ts View on Github external
const documentSelector = [
    { language: 'vue', scheme: 'file' },
    { language: 'vue', scheme: 'untitled' }
  ];
  const config = workspace.getConfiguration();

  const clientOptions: LanguageClientOptions = {
    documentSelector,
    synchronize: {
      // the settings to synchronize
      configurationSection: ['vetur', 'emmet', 'html', 'javascript', 'typescript', 'prettier', 'stylusSupremacy']
    },
    initializationOptions: {
      config
    },
    revealOutputChannelOn: RevealOutputChannelOn.Never
  };

  // Create the language client and start the client.
  const client = new LanguageClient('vue', 'Vue Language Server', serverOptions, clientOptions);
  const disposable = client.start();
  context.subscriptions.push(disposable);
  const isDecoratorEnabled = workspace.getConfiguration().get('vetur.colorDecorators.enable');

  if (isDecoratorEnabled) {
    client.onReady().then(registerColorProvider);
  }

  languages.setLanguageConfiguration('vue-html', {
    wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,
    onEnterRules: [
      {
github microsoft / vscode-go / src / goLanguageServer.ts View on Github external
{
			command: path,
			args: ['-mode=stdio', ...config.flags],
			options: {
				env: getToolsEnvVars(),
			},
		},
		{
			initializationOptions: {},
			documentSelector: ['go', 'go.mod', 'go.sum'],
			uriConverters: {
				// Apply file:/// scheme to all file paths.
				code2Protocol: (uri: vscode.Uri): string => (uri.scheme ? uri : uri.with({ scheme: 'file' })).toString(),
				protocol2Code: (uri: string) => vscode.Uri.parse(uri),
			},
			revealOutputChannelOn: RevealOutputChannelOn.Never,
			middleware: {
				provideDocumentFormattingEdits: (document: vscode.TextDocument, options: FormattingOptions, token: vscode.CancellationToken, next: ProvideDocumentFormattingEditsSignature) => {
					if (!config.features.format) {
						return [];
					}
					return next(document, options, token);
				},
				provideCompletionItem: async (document: vscode.TextDocument, position: vscode.Position, context: vscode.CompletionContext, token: vscode.CancellationToken, next: ProvideCompletionItemsSignature) => {
					if (!config.features.completion) {
						return [];
					}
					return next(document, position, context, token);
				},
				provideRenameEdits: (document: vscode.TextDocument, position: vscode.Position, newName: string, token: vscode.CancellationToken, next: ProvideRenameEditsSignature) => {
					if (!config.features.rename) {
						return null;
github juanfranblanco / vscode-solidity / src / extension.ts View on Github external
execArgv: ['--nolazy', '--inspect=6009'],
            },
            transport: TransportKind.ipc,
        },
        run: {
            module: serverModule,
            transport: TransportKind.ipc,
        },
    };

    const clientOptions: LanguageClientOptions = {
        documentSelector: [
            { language: 'solidity', scheme: 'file' },
            { language: 'solidity', scheme: 'untitled' },
        ],
        revealOutputChannelOn: RevealOutputChannelOn.Never,
        synchronize: {
                    // Synchronize the setting section 'solidity' to the server
                    configurationSection: 'solidity',
                    // Notify the server about file changes to '.sol.js files contain in the workspace (TODO node, linter)
                    // fileEvents: vscode.workspace.createFileSystemWatcher('**/.sol.js'),
                },
    };

    const ws: WorkspaceFolder[] | undefined = workspace.workspaceFolders;

    let clientDisposable;
    if (ws) {
        clientDisposable = new LanguageClient(
            'solidity',
            'Solidity Language Server',
            serverOptions,
github alanz / vscode-hie-server / src / extension.ts View on Github external
const outputChannel: OutputChannel = window.createOutputChannel(langName);
  const clientOptions: LanguageClientOptions = {
    // Use the document selector to only notify the LSP on files inside the folder
    // path for the specific workspace.
    documentSelector: [
      { scheme: 'file', language: 'haskell', pattern: `${folder.uri.fsPath}/**/*` },
      { scheme: 'file', language: 'literate haskell', pattern: `${folder.uri.fsPath}/**/*` }
    ],
    synchronize: {
      // Synchronize the setting section 'languageServerHaskell' to the server.
      configurationSection: 'languageServerHaskell',
      // Notify the server about file changes to '.clientrc files contain in the workspace.
      fileEvents: workspace.createFileSystemWatcher('**/.clientrc')
    },
    diagnosticCollectionName: langName,
    revealOutputChannelOn: RevealOutputChannelOn.Never,
    outputChannel,
    outputChannelName: langName,
    middleware: {
      provideHover: DocsBrowser.hoverLinksMiddlewareHook
    },
    // Set the current working directory, for HIE, to be the workspace folder.
    workspaceFolder: folder
  };

  // Create the LSP client.
  const langClient = new LanguageClient(langName, langName, serverOptions, clientOptions, true);

  // Register ClientCapabilities for stuff like window/progress
  langClient.registerProposedFeatures();

  if (workspace.getConfiguration('languageServerHaskell', uri).showTypeForSelection.onHover) {
github UnwrittenFun / svelte-vscode / src / extension.ts View on Github external
run: { module: serverModule, transport: TransportKind.ipc },
        debug: { module: serverModule, transport: TransportKind.ipc, options: debugOptions },
    };

    const lsConfig = workspace.getConfiguration('svelte.language-server');

    const serverRuntime = lsConfig.get('runtime');
    if (serverRuntime) {
        serverOptions.run.runtime = serverRuntime;
        serverOptions.debug.runtime = serverRuntime;
        console.log('setting server runtime to', serverRuntime);
    }

    let clientOptions: LanguageClientOptions = {
        documentSelector: [{ scheme: 'file', language: 'svelte' }],
        revealOutputChannelOn: RevealOutputChannelOn.Never,
        synchronize: {
            configurationSection: ['svelte', 'html'],
        },
    };

    let ls = createLanguageServer(serverOptions, clientOptions);
    context.subscriptions.push(ls.start());

    ls.onReady().then(() => {
        let tagRequestor = (document: TextDocument, position: Position) => {
            let param = ls.code2ProtocolConverter.asTextDocumentPositionParams(document, position);
            return ls.sendRequest(TagCloseRequest.type, param);
        };
        let disposable = activateTagClosing(tagRequestor, { svelte: true }, 'html.autoClosingTags');
        context.subscriptions.push(disposable);
    });
github getgauge / gauge-vscode / src / gaugeWorkspace.ts View on Github external
};

        this._launchConfig = workspace.getConfiguration(GAUGE_LAUNCH_CONFIG);
        if (this._launchConfig.get(DEBUG_LOG_LEVEL_CONFIG)) {
            serverOptions.args.push("-l");
            serverOptions.args.push("debug");
        }
        this._codeLensConfig = workspace.getConfiguration(GAUGE_CODELENS_CONFIG);
        if (this._codeLensConfig.has(REFERENCE_CONFIG) && !this._codeLensConfig.get(REFERENCE_CONFIG)) {
            serverOptions.options.env.gauge_lsp_reference_codelens = 'false';
        }
        let clientOptions: LanguageClientOptions = {
            documentSelector: [{ scheme: 'file', language: 'gauge', pattern: `${project.root()}/**/*` }],
            diagnosticCollectionName: 'gauge',
            outputChannel: this._outputChannel,
            revealOutputChannelOn: RevealOutputChannelOn.Never,
        };
        clientOptions.workspaceFolder = workspace.getWorkspaceFolder(Uri.file(folder));
        let languageClient = new LanguageClient('gauge', 'Gauge', serverOptions, clientOptions);
        this._clientsMap.set(project.root(), { project: project, client: languageClient });
        await this.installRunnerFor(project);
        this.generateJavaConfig(project);
        this.registerDynamicFeatures(languageClient);
        languageClient.start();
        return languageClient.onReady().then(() => { this.setLanguageId(languageClient, project.root()); });
    }
github tsufeki / vscode-tenkawa-php / src / extension.ts View on Github external
});

    const clientOptions: LanguageClientOptions = {
        documentSelector: [
            { scheme: 'file', language: 'php' },
            { scheme: 'untitled', language: 'php' }
        ],
        initializationOptions: {
            tenkawaphp: {
                diagnostics: config.get('diagnostics'),
                completion: config.get('completion'),
                index: config.get('index'),
            },
        },
        middleware: new TriggerSignatureHelpAfterCompletionMiddleware(),
        revealOutputChannelOn: RevealOutputChannelOn.Never,
    };

    const client = new LanguageClient('tenkawaphp', 'Tenkawa PHP', serverOptions, clientOptions);
    let disposable = client.start();
    context.subscriptions.push(disposable);

    disposable = new ProgressFeature(client).initialize();
    context.subscriptions.push(disposable);
}
github scalameta / metals-vscode / src / extension.ts View on Github external
const launchArgs = baseProperties
    .concat(javaOptions)
    .concat(serverProperties)
    .concat(mainArgs);

  const serverOptions: ServerOptions = {
    run: { command: javaPath, args: launchArgs, options: { env } },
    debug: { command: javaPath, args: launchArgs, options: { env } }
  };

  const clientOptions: LanguageClientOptions = {
    documentSelector: [{ scheme: "file", language: "scala" }],
    synchronize: {
      configurationSection: "metals"
    },
    revealOutputChannelOn: RevealOutputChannelOn.Never,
    outputChannel: outputChannel
  };

  const client = new LanguageClient(
    "metals",
    "Metals",
    serverOptions,
    clientOptions
  );
  const features = new MetalsFeatures();
  client.registerFeature(features);

  function registerCommand(command: string, callback: (...args: any[]) => any) {
    context.subscriptions.push(commands.registerCommand(command, callback));
  }