@@ -21,13 +21,12 @@ import { EMPTY_ELEMENTS } from './htmlEmptyTagsShared';
21
21
import { activateTagClosing } from './tagClosing' ;
22
22
import TelemetryReporter from 'vscode-extension-telemetry' ;
23
23
import { getCustomDataPathsInAllWorkspaces , getCustomDataPathsFromAllExtensions } from './customData' ;
24
- import { activateMirrorCursor } from './mirrorCursor' ;
25
24
26
25
namespace TagCloseRequest {
27
26
export const type : RequestType < TextDocumentPositionParams , string , any , any > = new RequestType ( 'html/tag' ) ;
28
27
}
29
- namespace MatchingTagPositionRequest {
30
- export const type : RequestType < TextDocumentPositionParams , Position | null , any , any > = new RequestType ( 'html/matchingTagPosition ' ) ;
28
+ namespace OnTypeRenameRequest {
29
+ export const type : RequestType < TextDocumentPositionParams , Range [ ] | null , any , any > = new RequestType ( 'html/onTypeRename ' ) ;
31
30
}
32
31
33
32
// experimental: semantic tokens
@@ -131,14 +130,6 @@ export function activate(context: ExtensionContext) {
131
130
disposable = activateTagClosing ( tagRequestor , { html : true , handlebars : true } , 'html.autoClosingTags' ) ;
132
131
toDispose . push ( disposable ) ;
133
132
134
- const matchingTagPositionRequestor = ( document : TextDocument , position : Position ) => {
135
- let param = client . code2ProtocolConverter . asTextDocumentPositionParams ( document , position ) ;
136
- return client . sendRequest ( MatchingTagPositionRequest . type , param ) ;
137
- } ;
138
-
139
- disposable = activateMirrorCursor ( matchingTagPositionRequestor , { html : true , handlebars : true } , 'html.mirrorCursorOnMatchingTag' ) ;
140
- toDispose . push ( disposable ) ;
141
-
142
133
disposable = client . onTelemetry ( e => {
143
134
if ( telemetryReporter ) {
144
135
telemetryReporter . sendTelemetryEvent ( e . key , e . data ) ;
@@ -289,6 +280,15 @@ export function activate(context: ExtensionContext) {
289
280
return results ;
290
281
}
291
282
} ) ;
283
+
284
+ languages . registerOnTypeRenameProvider ( documentSelector , {
285
+ async provideOnTypeRenameRanges ( document , position ) {
286
+ const param = client . code2ProtocolConverter . asTextDocumentPositionParams ( document , position ) ;
287
+ const response = await client . sendRequest ( OnTypeRenameRequest . type , param ) ;
288
+
289
+ return response || [ ] ;
290
+ }
291
+ } ) ;
292
292
}
293
293
294
294
function getPackageInfo ( context : ExtensionContext ) : IPackageInfo | null {
0 commit comments