Skip to content
This repository was archived by the owner on Nov 6, 2018. It is now read-only.

Commit 73accd7

Browse files
committed
feat: save initialize params
This is useful for accessing experimental client capabilities on the server.
1 parent ad4a995 commit 73accd7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/extension/api.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Subscription } from 'rxjs'
22
import { Context } from '../environment/context/context'
33
import { MessageConnection } from '../jsonrpc2/connection'
4-
import { Settings } from '../protocol'
4+
import { InitializeParams, Settings } from '../protocol'
55
import { URI } from '../types/textDocument'
66

77
/**
@@ -10,6 +10,11 @@ import { URI } from '../types/textDocument'
1010
* @template C the extension's settings
1111
*/
1212
export interface CXP<C = Settings> {
13+
/**
14+
* The params passed by the client in the `initialize` request.
15+
*/
16+
initializeParams: InitializeParams
17+
1318
/**
1419
* The root URI of the workspace in which this extension is running.
1520
*

src/extension/extension.ts

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class ExtensionHandle<C> implements CXP<C> {
2525
constructor(public readonly rawConnection: MessageConnection, public readonly initializeParams: InitializeParams) {
2626
this.subscription.add(this.rawConnection)
2727

28+
this.initializeParams = initializeParams
2829
this.configuration = createExtConfiguration<C>(
2930
this,
3031
initializeParams.configurationCascade as ConfigurationCascade<C>

0 commit comments

Comments
 (0)