@@ -302,6 +302,7 @@ public partial class CodeActionRegistrationOptions : IWorkDoneProgressOptions, I
302
302
///
303
303
/// @since 3.16.0
304
304
/// </summary>
305
+ [ Optional ]
305
306
public bool ResolveProvider { get ; set ; }
306
307
307
308
class CodeActionRegistrationOptionsConverter : RegistrationOptionsConverterBase < CodeActionRegistrationOptions , StaticOptions >
@@ -324,113 +325,113 @@ public override StaticOptions Convert(CodeActionRegistrationOptions source)
324
325
}
325
326
}
326
327
327
- /// <summary>
328
- /// A set of predefined code action kinds
329
- /// </summary>
330
- [ DebuggerDisplay ( "{" + nameof ( _value ) + "}" ) ]
331
- [ JsonConverter ( typeof ( EnumLikeStringConverter ) ) ]
332
- public readonly struct CodeActionKind : IEquatable < CodeActionKind > , IEnumLikeString
333
- {
334
- private static readonly Lazy < IReadOnlyList < CodeActionKind > > _defaults =
335
- new Lazy < IReadOnlyList < CodeActionKind > > (
336
- ( ) => {
337
- return typeof ( CodeActionKind )
338
- . GetFields ( BindingFlags . Static | BindingFlags . Public )
339
- . Select ( z => z . GetValue ( null ) )
340
- . Cast < CodeActionKind > ( )
341
- . ToArray ( ) ;
342
- }
343
- ) ;
344
-
345
- public static IEnumerable < CodeActionKind > Defaults => _defaults . Value ;
346
-
347
328
/// <summary>
348
- /// Base kind for quickfix actions: ''
329
+ /// A set of predefined code action kinds
349
330
/// </summary>
350
- public static readonly CodeActionKind Empty = new CodeActionKind ( "" ) ;
331
+ [ DebuggerDisplay ( "{" + nameof ( _value ) + "}" ) ]
332
+ [ JsonConverter ( typeof ( EnumLikeStringConverter ) ) ]
333
+ public readonly struct CodeActionKind : IEquatable < CodeActionKind > , IEnumLikeString
334
+ {
335
+ private static readonly Lazy < IReadOnlyList < CodeActionKind > > _defaults =
336
+ new Lazy < IReadOnlyList < CodeActionKind > > (
337
+ ( ) => {
338
+ return typeof ( CodeActionKind )
339
+ . GetFields ( BindingFlags . Static | BindingFlags . Public )
340
+ . Select ( z => z . GetValue ( null ) )
341
+ . Cast < CodeActionKind > ( )
342
+ . ToArray ( ) ;
343
+ }
344
+ ) ;
345
+
346
+ public static IEnumerable < CodeActionKind > Defaults => _defaults . Value ;
351
347
352
- /// <summary>
353
- /// Base kind for quickfix actions: 'quickfix '
354
- /// </summary>
355
- public static readonly CodeActionKind QuickFix = new CodeActionKind ( "quickfix " ) ;
348
+ /// <summary>
349
+ /// Base kind for quickfix actions: ''
350
+ /// </summary>
351
+ public static readonly CodeActionKind Empty = new CodeActionKind ( "" ) ;
356
352
357
- /// <summary>
358
- /// Base kind for refactoring actions: 'refactor '
359
- /// </summary>
360
- public static readonly CodeActionKind Refactor = new CodeActionKind ( "refactor " ) ;
353
+ /// <summary>
354
+ /// Base kind for quickfix actions: 'quickfix '
355
+ /// </summary>
356
+ public static readonly CodeActionKind QuickFix = new CodeActionKind ( "quickfix " ) ;
361
357
362
- /// <summary>
363
- /// Base kind for refactoring extraction actions: 'refactor.extract'
364
- ///
365
- /// Example extract actions:
366
- ///
367
- /// - Extract method
368
- /// - Extract function
369
- /// - Extract variable
370
- /// - Extract interface from class
371
- /// - ...
372
- /// </summary>
373
- public static readonly CodeActionKind RefactorExtract = new CodeActionKind ( "refactor.extract" ) ;
358
+ /// <summary>
359
+ /// Base kind for refactoring actions: 'refactor'
360
+ /// </summary>
361
+ public static readonly CodeActionKind Refactor = new CodeActionKind ( "refactor" ) ;
374
362
375
- /// <summary>
376
- /// Base kind for refactoring inline actions: 'refactor.inline'
377
- ///
378
- /// Example inline actions:
379
- ///
380
- /// - Inline function
381
- /// - Inline variable
382
- /// - Inline constant
383
- /// - ...
384
- /// </summary>
385
- public static readonly CodeActionKind RefactorInline = new CodeActionKind ( "refactor.inline" ) ;
363
+ /// <summary>
364
+ /// Base kind for refactoring extraction actions: 'refactor.extract'
365
+ ///
366
+ /// Example extract actions:
367
+ ///
368
+ /// - Extract method
369
+ /// - Extract function
370
+ /// - Extract variable
371
+ /// - Extract interface from class
372
+ /// - ...
373
+ /// </summary>
374
+ public static readonly CodeActionKind RefactorExtract = new CodeActionKind ( "refactor.extract" ) ;
386
375
387
- /// <summary>
388
- /// Base kind for refactoring rewrite actions: 'refactor.rewrite'
389
- ///
390
- /// Example rewrite actions:
391
- ///
392
- /// - Convert JavaScript function to class
393
- /// - Add or remove parameter
394
- /// - Encapsulate field
395
- /// - Make method static
396
- /// - Move method to base class
397
- /// - ...
398
- /// </summary>
399
- public static readonly CodeActionKind RefactorRewrite = new CodeActionKind ( "refactor.rewrite" ) ;
376
+ /// <summary>
377
+ /// Base kind for refactoring inline actions: 'refactor.inline'
378
+ ///
379
+ /// Example inline actions:
380
+ ///
381
+ /// - Inline function
382
+ /// - Inline variable
383
+ /// - Inline constant
384
+ /// - ...
385
+ /// </summary>
386
+ public static readonly CodeActionKind RefactorInline = new CodeActionKind ( "refactor.inline" ) ;
400
387
401
- /// <summary>
402
- /// Base kind for source actions: `source`
403
- ///
404
- /// Source code actions apply to the entire file.
405
- /// </summary>
406
- public static readonly CodeActionKind Source = new CodeActionKind ( "source" ) ;
388
+ /// <summary>
389
+ /// Base kind for refactoring rewrite actions: 'refactor.rewrite'
390
+ ///
391
+ /// Example rewrite actions:
392
+ ///
393
+ /// - Convert JavaScript function to class
394
+ /// - Add or remove parameter
395
+ /// - Encapsulate field
396
+ /// - Make method static
397
+ /// - Move method to base class
398
+ /// - ...
399
+ /// </summary>
400
+ public static readonly CodeActionKind RefactorRewrite = new CodeActionKind ( "refactor.rewrite" ) ;
407
401
408
- /// <summary>
409
- /// Base kind for an organize imports source action: `source.organizeImports`
410
- /// </summary>
411
- public static readonly CodeActionKind SourceOrganizeImports = new CodeActionKind ( "source.organizeImports" ) ;
402
+ /// <summary>
403
+ /// Base kind for source actions: `source`
404
+ ///
405
+ /// Source code actions apply to the entire file.
406
+ /// </summary>
407
+ public static readonly CodeActionKind Source = new CodeActionKind ( "source" ) ;
408
+
409
+ /// <summary>
410
+ /// Base kind for an organize imports source action: `source.organizeImports`
411
+ /// </summary>
412
+ public static readonly CodeActionKind SourceOrganizeImports = new CodeActionKind ( "source.organizeImports" ) ;
412
413
413
- private readonly string ? _value ;
414
+ private readonly string ? _value ;
414
415
415
- public CodeActionKind ( string kind ) => _value = kind ;
416
+ public CodeActionKind ( string kind ) => _value = kind ;
416
417
417
- public static implicit operator CodeActionKind ( string kind ) => new CodeActionKind ( kind ) ;
418
+ public static implicit operator CodeActionKind ( string kind ) => new CodeActionKind ( kind ) ;
418
419
419
- public static implicit operator string ( CodeActionKind kind ) => kind . _value ?? string . Empty ;
420
+ public static implicit operator string ( CodeActionKind kind ) => kind . _value ?? string . Empty ;
420
421
421
- /// <inheritdoc />
422
- public override string ToString ( ) => _value ?? string . Empty ;
422
+ /// <inheritdoc />
423
+ public override string ToString ( ) => _value ?? string . Empty ;
423
424
424
- public bool Equals ( CodeActionKind other ) => _value == other . _value ;
425
+ public bool Equals ( CodeActionKind other ) => _value == other . _value ;
425
426
426
- public override bool Equals ( object obj ) => obj is CodeActionKind other && Equals ( other ) ;
427
+ public override bool Equals ( object obj ) => obj is CodeActionKind other && Equals ( other ) ;
427
428
428
- public override int GetHashCode ( ) => _value != null ? _value . GetHashCode ( ) : 0 ;
429
+ public override int GetHashCode ( ) => _value != null ? _value . GetHashCode ( ) : 0 ;
429
430
430
- public static bool operator == ( CodeActionKind left , CodeActionKind right ) => left . Equals ( right ) ;
431
+ public static bool operator == ( CodeActionKind left , CodeActionKind right ) => left . Equals ( right ) ;
431
432
432
- public static bool operator != ( CodeActionKind left , CodeActionKind right ) => ! left . Equals ( right ) ;
433
- }
433
+ public static bool operator != ( CodeActionKind left , CodeActionKind right ) => ! left . Equals ( right ) ;
434
+ }
434
435
}
435
436
436
437
namespace Client . Capabilities
@@ -479,6 +480,18 @@ public partial class CodeActionCapability : DynamicCapability, ConnectedCapabili
479
480
/// </summary>
480
481
[ Optional ]
481
482
public CodeActionCapabilityResolveSupportOptions ? ResolveSupport { get ; set ; }
483
+
484
+ /// <summary>
485
+ /// Whether th client honors the change annotations in
486
+ /// text edits and resource operations returned via the
487
+ /// `CodeAction#edit` property by for example presenting
488
+ /// the workspace edit in the user interface and asking
489
+ /// for confirmation.
490
+ ///
491
+ /// @since 3.16.0 - proposed state
492
+ /// </summary>
493
+ [ Optional ]
494
+ public bool HonorsChangeAnnotations { get ; set ; }
482
495
}
483
496
484
497
public class CodeActionLiteralSupportOptions
0 commit comments