@@ -13,7 +13,6 @@ import { DocumentFormattingEditProvider } from './Providers/documentFormattingEd
1313import { DocumentRangeFormattingEditProvider } from './Providers/documentRangeFormattingEditProvider' ;
1414import { DocumentSymbolProvider } from './Providers/documentSymbolProvider' ;
1515import { FindAllReferencesProvider } from './Providers/findAllReferencesProvider' ;
16- import { FoldingRangeProvider } from './Providers/foldingRangeProvider' ;
1716import { CppInlayHint , InlayHintsProvider } from './Providers/inlayHintProvider' ;
1817import { OnTypeFormattingEditProvider } from './Providers/onTypeFormattingEditProvider' ;
1918import { RenameProvider } from './Providers/renameProvider' ;
@@ -228,11 +227,6 @@ interface FileChangedParams extends WorkspaceFolderParams {
228227 uri : string ;
229228}
230229
231- interface InputLineRange {
232- startLine : number ;
233- endLine : number ;
234- }
235-
236230interface InputRegion {
237231 startLine : number ;
238232 startColumn : number ;
@@ -364,26 +358,6 @@ export interface FormatResult {
364358 edits : TextEdit [ ] ;
365359}
366360
367- export interface GetFoldingRangesParams {
368- uri : string ;
369- }
370-
371- export enum FoldingRangeKind {
372- None = 0 ,
373- Comment = 1 ,
374- Imports = 2 ,
375- Region = 3
376- }
377-
378- export interface CppFoldingRange {
379- kind : FoldingRangeKind ;
380- range : InputLineRange ;
381- }
382-
383- export interface GetFoldingRangesResult {
384- ranges : CppFoldingRange [ ] ;
385- }
386-
387361export interface IntelliSenseResult {
388362 uri : string ;
389363 fileVersion : number ;
@@ -625,7 +599,6 @@ const SwitchHeaderSourceRequest: RequestType<SwitchHeaderSourceParams, string, v
625599const GetTranslationUnitSourceCandidatesRequest : RequestType < TextDocumentIdentifier , GetTranslationUnitSourceCandidatesResult , void > = new RequestType < TextDocumentIdentifier , GetTranslationUnitSourceCandidatesResult , void > ( 'cpptools/getTranslationUnitSourceCandidates' ) ;
626600const GetDiagnosticsRequest : RequestType < void , GetDiagnosticsResult , void > = new RequestType < void , GetDiagnosticsResult , void > ( 'cpptools/getDiagnostics' ) ;
627601export const GetDocumentSymbolRequest : RequestType < GetDocumentSymbolRequestParams , GetDocumentSymbolResult , void > = new RequestType < GetDocumentSymbolRequestParams , GetDocumentSymbolResult , void > ( 'cpptools/getDocumentSymbols' ) ;
628- export const GetFoldingRangesRequest : RequestType < GetFoldingRangesParams , GetFoldingRangesResult , void > = new RequestType < GetFoldingRangesParams , GetFoldingRangesResult , void > ( 'cpptools/getFoldingRanges' ) ;
629602export const FormatDocumentRequest : RequestType < FormatParams , FormatResult , void > = new RequestType < FormatParams , FormatResult , void > ( 'cpptools/formatDocument' ) ;
630603export const FormatRangeRequest : RequestType < FormatParams , FormatResult , void > = new RequestType < FormatParams , FormatResult , void > ( 'cpptools/formatRange' ) ;
631604export const FormatOnTypeRequest : RequestType < FormatParams , FormatResult , void > = new RequestType < FormatParams , FormatResult , void > ( 'cpptools/formatOnType' ) ;
@@ -903,8 +876,6 @@ export class DefaultClient implements Client {
903876 private documentFormattingProviderDisposable : vscode . Disposable | undefined ;
904877 private formattingRangeProviderDisposable : vscode . Disposable | undefined ;
905878 private onTypeFormattingProviderDisposable : vscode . Disposable | undefined ;
906- private codeFoldingProvider : FoldingRangeProvider | undefined ;
907- private codeFoldingProviderDisposable : vscode . Disposable | undefined ;
908879 private inlayHintsProvider : InlayHintsProvider | undefined ;
909880 private semanticTokensProvider : SemanticTokensProvider | undefined ;
910881 private semanticTokensProviderDisposable : vscode . Disposable | undefined ;
@@ -1431,16 +1402,12 @@ export class DefaultClient implements Client {
14311402 this . disposables . push ( vscode . languages . registerDocumentSymbolProvider ( util . documentSelector , instrument ( new DocumentSymbolProvider ( ) ) , undefined ) ) ;
14321403 this . disposables . push ( vscode . languages . registerCodeActionsProvider ( util . documentSelector , instrument ( new CodeActionProvider ( this ) ) , undefined ) ) ;
14331404
1434- // Because formatting and codeFolding can vary per folder, we need to register these providers once
1435- // and leave them registered. The decision of whether to provide results needs to be made on a per folder basis,
1436- // within the providers themselves.
1405+ // Because formatting can vary per folder, we need to register these providers once and leave them registered.
1406+ // The decision of whether to provide results needs to be made on a per folder basis, within the providers themselves.
14371407 this . documentFormattingProviderDisposable = vscode . languages . registerDocumentFormattingEditProvider ( util . documentSelector , instrument ( new DocumentFormattingEditProvider ( this ) ) ) ;
14381408 this . formattingRangeProviderDisposable = vscode . languages . registerDocumentRangeFormattingEditProvider ( util . documentSelector , instrument ( new DocumentRangeFormattingEditProvider ( this ) ) ) ;
14391409 this . onTypeFormattingProviderDisposable = vscode . languages . registerOnTypeFormattingEditProvider ( util . documentSelector , instrument ( new OnTypeFormattingEditProvider ( this ) ) , ";" , "}" , "\n" ) ;
14401410
1441- this . codeFoldingProvider = new FoldingRangeProvider ( this ) ;
1442- this . codeFoldingProviderDisposable = vscode . languages . registerFoldingRangeProvider ( util . documentSelector , instrument ( this . codeFoldingProvider ) ) ;
1443-
14441411 const settings : CppSettings = new CppSettings ( ) ;
14451412 if ( settings . isEnhancedColorizationEnabled && semanticTokensLegend ) {
14461413 this . semanticTokensProvider = instrument ( new SemanticTokensProvider ( ) ) ;
@@ -2648,7 +2615,7 @@ export class DefaultClient implements Client {
26482615 this . inlayHintsProvider . deliverInlayHints ( intelliSenseResult . uri , intelliSenseResult . inlayHints , intelliSenseResult . clearExistingInlayHint ) ;
26492616 }
26502617
2651- this . updateInactiveRegions ( intelliSenseResult . uri , intelliSenseResult . inactiveRegions , intelliSenseResult . clearExistingInactiveRegions , intelliSenseResult . isCompletePass ) ;
2618+ this . updateInactiveRegions ( intelliSenseResult . uri , intelliSenseResult . inactiveRegions , intelliSenseResult . clearExistingInactiveRegions ) ;
26522619 if ( intelliSenseResult . clearExistingDiagnostics || intelliSenseResult . diagnostics . length > 0 ) {
26532620 this . updateSquiggles ( intelliSenseResult . uri , intelliSenseResult . diagnostics , intelliSenseResult . clearExistingDiagnostics ) ;
26542621 }
@@ -2960,11 +2927,7 @@ export class DefaultClient implements Client {
29602927 this . model . isParsingWorkspacePaused . Value = tagParseStatus . isPaused ;
29612928 }
29622929
2963- private updateInactiveRegions ( uriString : string , inactiveRegions : InputRegion [ ] , startNewSet : boolean , updateFoldingRanges : boolean ) : void {
2964- if ( this . codeFoldingProvider && updateFoldingRanges ) {
2965- this . codeFoldingProvider . refresh ( ) ;
2966- }
2967-
2930+ private updateInactiveRegions ( uriString : string , inactiveRegions : InputRegion [ ] , startNewSet : boolean ) : void {
29682931 const client : Client = clients . getClientFor ( vscode . Uri . parse ( uriString ) ) ;
29692932 if ( ! ( client instanceof DefaultClient ) || ( ! startNewSet && inactiveRegions . length === 0 ) ) {
29702933 return ;
@@ -4291,10 +4254,6 @@ export class DefaultClient implements Client {
42914254 this . onTypeFormattingProviderDisposable . dispose ( ) ;
42924255 this . onTypeFormattingProviderDisposable = undefined ;
42934256 }
4294- if ( this . codeFoldingProviderDisposable ) {
4295- this . codeFoldingProviderDisposable . dispose ( ) ;
4296- this . codeFoldingProviderDisposable = undefined ;
4297- }
42984257 if ( this . semanticTokensProviderDisposable ) {
42994258 this . semanticTokensProviderDisposable . dispose ( ) ;
43004259 this . semanticTokensProviderDisposable = undefined ;
0 commit comments