当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript IConnection.onInitialized方法代码示例

本文整理汇总了TypeScript中vscode-languageserver.IConnection.onInitialized方法的典型用法代码示例。如果您正苦于以下问题:TypeScript IConnection.onInitialized方法的具体用法?TypeScript IConnection.onInitialized怎么用?TypeScript IConnection.onInitialized使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vscode-languageserver.IConnection的用法示例。

在下文中一共展示了IConnection.onInitialized方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: import

			connection.console.error(result.toString());

			return null;
		}
	}
	connection.console.info('Rebuild succeeded!');

	const { Server } = await import('./Server');
	server = new Server(connection, params);
	server.registerInitializeProviders();

	return server.capabilities;
});

connection.onInitialized(() => {
	server.registerInitializedProviders();
});

// Listen on the connection
connection.listen();

// Don't die on unhandled Promise rejections
process.on('unhandledRejection', (reason, p) => {
	connection.console.error(`Unhandled Rejection at: Promise ${p} reason:, ${reason}`);
});

// Don't die when attempting to pipe stdin to a bad spawn
// https://github.com/electron/electron/issues/13254
process.on('SIGPIPE', () => {
	// console.log('SIGPIPE!!');
});
开发者ID:rubyide,项目名称:vscode-ruby,代码行数:31,代码来源:index.ts


示例2: createConnection

import {
    createConnection,
    IConnection,
    IPCMessageReader,
    IPCMessageWriter,
    DidChangeConfigurationNotification
} from 'vscode-languageserver';

import { LocalSyncFs } from './local-sync-fs';
import { init } from './server-utils';
import { initializeResult } from '../view';

const connection: IConnection = createConnection(new IPCMessageReader(process), new IPCMessageWriter(process));

connection.listen();
connection.onInitialize(params => {
    const rootPath = params.rootPath || '';

    init(new LocalSyncFs(''), connection, rootPath);

    return initializeResult;
});

connection.onInitialized(() => {
    connection.client.register(DidChangeConfigurationNotification.type, undefined);
});
开发者ID:wix,项目名称:stylable-intelligence,代码行数:26,代码来源:server.ts



注:本文中的vscode-languageserver.IConnection.onInitialized方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。