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


TypeScript LanguageClient.notifyConfigurationChanged方法代码示例

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


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

示例1: activate

export function activate(context: ExtensionContext) {

    // The server is implemented in node
    let serverModule = context.asAbsolutePath(path.join('out', 'server', 'server.js'));
    // The debug options for the server
    let debugOptions = { execArgv: ["--nolazy", "--debug=6004"] };
	
    // If the extension is launch in debug mode the debug server options are use
    // Otherwise the run options are used
    let serverOptions: ServerOptions = {
        run: { module: serverModule, transport: TransportKind.ipc },
        debug: { module: serverModule, transport: TransportKind.ipc, options: debugOptions }
    }
	
    // Options to control the language client
    let clientOptions: LanguageClientOptions = {
        // Register the server for plain text documents
        documentSelector: ['python'],
        synchronize: {
            // Synchronize the setting section 'python' to the server
            configurationSection: 'python',
            // Notify the server about file changes to '.clientrc files contain in the workspace
            fileEvents: workspace.createFileSystemWatcher('**/.clientrc')
        }
    }
	
    // Create the language client and start the client.
    pythonLanguageClient = new LanguageClient('Python', serverOptions, clientOptions);
    var disposable = pythonLanguageClient.start();
    
    //Send info as soon as it starts
    var config = workspace.getConfiguration();
    pythonLanguageClient.notifyConfigurationChanged(config)

    var isWin = /^win/.test(process.platform);
    if (isWin) {
        // workspace.onDidSaveTextDocument(onDidSaveTextDocument, this, context.subscriptions);    
    }
    // Push the disposable to the context's subscriptions so that the 
    // client can be deactivated on extension deactivation
    context.subscriptions.push(disposable);
}
开发者ID:Erguotou,项目名称:pythonVSCode,代码行数:42,代码来源:languageClient.ts


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