當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。