@@ -8,11 +8,9 @@ import * as path from 'path';
88import * as nls from 'vscode-nls' ;
99const localize = nls . loadMessageBundle ( ) ;
1010
11- import { workspace , languages , ExtensionContext , extensions , Uri , TextDocument , ColorInformation , Color , ColorPresentation , LanguageConfiguration } from 'vscode' ;
11+ import { workspace , languages , ExtensionContext , extensions , Uri , LanguageConfiguration } from 'vscode' ;
1212import { LanguageClient , LanguageClientOptions , RequestType , ServerOptions , TransportKind , NotificationType , DidChangeConfigurationNotification } from 'vscode-languageclient' ;
1313import TelemetryReporter from 'vscode-extension-telemetry' ;
14- import { ConfigurationFeature } from 'vscode-languageclient/lib/configuration.proposed' ;
15- import { DocumentColorRequest , DocumentColorParams , ColorPresentationParams , ColorPresentationRequest } from 'vscode-languageserver-protocol/lib/protocol.colorProvider.proposed' ;
1614
1715import { hash } from './utils/hash' ;
1816
@@ -96,7 +94,7 @@ export function activate(context: ExtensionContext) {
9694
9795 // Create the language client and start the client.
9896 let client = new LanguageClient ( 'json' , localize ( 'jsonserver.name' , 'JSON Language Server' ) , serverOptions , clientOptions ) ;
99- client . registerFeature ( new ConfigurationFeature ( client ) ) ;
97+ client . registerProposedFeatures ( ) ;
10098
10199 let disposable = client . start ( ) ;
102100 toDispose . push ( disposable ) ;
@@ -126,37 +124,6 @@ export function activate(context: ExtensionContext) {
126124 toDispose . push ( workspace . onDidCloseTextDocument ( d => handleContentChange ( d . uri ) ) ) ;
127125
128126 client . sendNotification ( SchemaAssociationNotification . type , getSchemaAssociation ( context ) ) ;
129-
130- // register color provider
131- toDispose . push ( languages . registerColorProvider ( documentSelector , {
132- provideDocumentColors ( document : TextDocument ) : Thenable < ColorInformation [ ] > {
133- let params : DocumentColorParams = {
134- textDocument : client . code2ProtocolConverter . asTextDocumentIdentifier ( document )
135- } ;
136- return client . sendRequest ( DocumentColorRequest . type , params ) . then ( symbols => {
137- return symbols . map ( symbol => {
138- let range = client . protocol2CodeConverter . asRange ( symbol . range ) ;
139- let color = new Color ( symbol . color . red , symbol . color . green , symbol . color . blue , symbol . color . alpha ) ;
140- return new ColorInformation ( range , color ) ;
141- } ) ;
142- } ) ;
143- } ,
144- provideColorPresentations ( color : Color , context ) : Thenable < ColorPresentation [ ] > {
145- let params : ColorPresentationParams = {
146- textDocument : client . code2ProtocolConverter . asTextDocumentIdentifier ( context . document ) ,
147- color : color ,
148- range : client . code2ProtocolConverter . asRange ( context . range )
149- } ;
150- return client . sendRequest ( ColorPresentationRequest . type , params ) . then ( presentations => {
151- return presentations . map ( p => {
152- let presentation = new ColorPresentation ( p . label ) ;
153- presentation . textEdit = p . textEdit && client . protocol2CodeConverter . asTextEdit ( p . textEdit ) ;
154- presentation . additionalTextEdits = p . additionalTextEdits && client . protocol2CodeConverter . asTextEdits ( p . additionalTextEdits ) ;
155- return presentation ;
156- } ) ;
157- } ) ;
158- }
159- } ) ) ;
160127 } ) ;
161128
162129 let languageConfiguration : LanguageConfiguration = {
0 commit comments