@@ -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 ;
@@ -362,26 +356,6 @@ export interface FormatResult {
362356 edits : TextEdit [ ] ;
363357}
364358
365- export interface GetFoldingRangesParams {
366- uri : string ;
367- }
368-
369- export enum FoldingRangeKind {
370- None = 0 ,
371- Comment = 1 ,
372- Imports = 2 ,
373- Region = 3
374- }
375-
376- export interface CppFoldingRange {
377- kind : FoldingRangeKind ;
378- range : InputLineRange ;
379- }
380-
381- export interface GetFoldingRangesResult {
382- ranges : CppFoldingRange [ ] ;
383- }
384-
385359export interface IntelliSenseResult {
386360 uri : string ;
387361 fileVersion : number ;
@@ -623,7 +597,6 @@ const SwitchHeaderSourceRequest: RequestType<SwitchHeaderSourceParams, string, v
623597const GetTranslationUnitSourceCandidatesRequest : RequestType < TextDocumentIdentifier , GetTranslationUnitSourceCandidatesResult , void > = new RequestType < TextDocumentIdentifier , GetTranslationUnitSourceCandidatesResult , void > ( 'cpptools/getTranslationUnitSourceCandidates' ) ;
624598const GetDiagnosticsRequest : RequestType < void , GetDiagnosticsResult , void > = new RequestType < void , GetDiagnosticsResult , void > ( 'cpptools/getDiagnostics' ) ;
625599export const GetDocumentSymbolRequest : RequestType < GetDocumentSymbolRequestParams , GetDocumentSymbolResult , void > = new RequestType < GetDocumentSymbolRequestParams , GetDocumentSymbolResult , void > ( 'cpptools/getDocumentSymbols' ) ;
626- export const GetFoldingRangesRequest : RequestType < GetFoldingRangesParams , GetFoldingRangesResult , void > = new RequestType < GetFoldingRangesParams , GetFoldingRangesResult , void > ( 'cpptools/getFoldingRanges' ) ;
627600export const FormatDocumentRequest : RequestType < FormatParams , FormatResult , void > = new RequestType < FormatParams , FormatResult , void > ( 'cpptools/formatDocument' ) ;
628601export const FormatRangeRequest : RequestType < FormatParams , FormatResult , void > = new RequestType < FormatParams , FormatResult , void > ( 'cpptools/formatRange' ) ;
629602export const FormatOnTypeRequest : RequestType < FormatParams , FormatResult , void > = new RequestType < FormatParams , FormatResult , void > ( 'cpptools/formatOnType' ) ;
@@ -901,8 +874,6 @@ export class DefaultClient implements Client {
901874 private documentFormattingProviderDisposable : vscode . Disposable | undefined ;
902875 private formattingRangeProviderDisposable : vscode . Disposable | undefined ;
903876 private onTypeFormattingProviderDisposable : vscode . Disposable | undefined ;
904- private codeFoldingProvider : FoldingRangeProvider | undefined ;
905- private codeFoldingProviderDisposable : vscode . Disposable | undefined ;
906877 private inlayHintsProvider : InlayHintsProvider | undefined ;
907878 private semanticTokensProvider : SemanticTokensProvider | undefined ;
908879 private semanticTokensProviderDisposable : vscode . Disposable | undefined ;
@@ -1429,16 +1400,12 @@ export class DefaultClient implements Client {
14291400 this . disposables . push ( vscode . languages . registerDocumentSymbolProvider ( util . documentSelector , instrument ( new DocumentSymbolProvider ( ) ) , undefined ) ) ;
14301401 this . disposables . push ( vscode . languages . registerCodeActionsProvider ( util . documentSelector , instrument ( new CodeActionProvider ( this ) ) , undefined ) ) ;
14311402
1432- // Because formatting and codeFolding can vary per folder, we need to register these providers once
1433- // and leave them registered. The decision of whether to provide results needs to be made on a per folder basis,
1434- // within the providers themselves.
1403+ // Because formatting can vary per folder, we need to register these providers once and leave them registered.
1404+ // The decision of whether to provide results needs to be made on a per folder basis, within the providers themselves.
14351405 this . documentFormattingProviderDisposable = vscode . languages . registerDocumentFormattingEditProvider ( util . documentSelector , instrument ( new DocumentFormattingEditProvider ( this ) ) ) ;
14361406 this . formattingRangeProviderDisposable = vscode . languages . registerDocumentRangeFormattingEditProvider ( util . documentSelector , instrument ( new DocumentRangeFormattingEditProvider ( this ) ) ) ;
14371407 this . onTypeFormattingProviderDisposable = vscode . languages . registerOnTypeFormattingEditProvider ( util . documentSelector , instrument ( new OnTypeFormattingEditProvider ( this ) ) , ";" , "}" , "\n" ) ;
14381408
1439- this . codeFoldingProvider = new FoldingRangeProvider ( this ) ;
1440- this . codeFoldingProviderDisposable = vscode . languages . registerFoldingRangeProvider ( util . documentSelector , instrument ( this . codeFoldingProvider ) ) ;
1441-
14421409 const settings : CppSettings = new CppSettings ( ) ;
14431410 if ( settings . isEnhancedColorizationEnabled && semanticTokensLegend ) {
14441411 this . semanticTokensProvider = instrument ( new SemanticTokensProvider ( ) ) ;
@@ -2645,7 +2612,7 @@ export class DefaultClient implements Client {
26452612 this . inlayHintsProvider . deliverInlayHints ( intelliSenseResult . uri , intelliSenseResult . inlayHints , intelliSenseResult . clearExistingInlayHint ) ;
26462613 }
26472614
2648- this . updateInactiveRegions ( intelliSenseResult . uri , intelliSenseResult . inactiveRegions , intelliSenseResult . clearExistingInactiveRegions , intelliSenseResult . isCompletePass ) ;
2615+ this . updateInactiveRegions ( intelliSenseResult . uri , intelliSenseResult . inactiveRegions , intelliSenseResult . clearExistingInactiveRegions ) ;
26492616 if ( intelliSenseResult . clearExistingDiagnostics || intelliSenseResult . diagnostics . length > 0 ) {
26502617 this . updateSquiggles ( intelliSenseResult . uri , intelliSenseResult . diagnostics , intelliSenseResult . clearExistingDiagnostics ) ;
26512618 }
@@ -2956,11 +2923,7 @@ export class DefaultClient implements Client {
29562923 this . model . isParsingWorkspacePaused . Value = tagParseStatus . isPaused ;
29572924 }
29582925
2959- private updateInactiveRegions ( uriString : string , inactiveRegions : InputRegion [ ] , startNewSet : boolean , updateFoldingRanges : boolean ) : void {
2960- if ( this . codeFoldingProvider && updateFoldingRanges ) {
2961- this . codeFoldingProvider . refresh ( ) ;
2962- }
2963-
2926+ private updateInactiveRegions ( uriString : string , inactiveRegions : InputRegion [ ] , startNewSet : boolean ) : void {
29642927 const client : Client = clients . getClientFor ( vscode . Uri . parse ( uriString ) ) ;
29652928 if ( ! ( client instanceof DefaultClient ) || ( ! startNewSet && inactiveRegions . length === 0 ) ) {
29662929 return ;
@@ -4287,10 +4250,6 @@ export class DefaultClient implements Client {
42874250 this . onTypeFormattingProviderDisposable . dispose ( ) ;
42884251 this . onTypeFormattingProviderDisposable = undefined ;
42894252 }
4290- if ( this . codeFoldingProviderDisposable ) {
4291- this . codeFoldingProviderDisposable . dispose ( ) ;
4292- this . codeFoldingProviderDisposable = undefined ;
4293- }
42944253 if ( this . semanticTokensProviderDisposable ) {
42954254 this . semanticTokensProviderDisposable . dispose ( ) ;
42964255 this . semanticTokensProviderDisposable = undefined ;
0 commit comments