@@ -11,6 +11,7 @@ import { useMemo } from "react";
1111import { Mode } from "../../model-editor/shared/mode" ;
1212import { sortMethods } from "../../model-editor/shared/sorting" ;
1313import { InProgressMethods } from "../../model-editor/shared/in-progress-methods" ;
14+ import { HiddenMethodsRow } from "./HiddenMethodsRow" ;
1415
1516export const GRID_TEMPLATE_COLUMNS = "0.5fr 0.125fr 0.125fr 0.125fr 0.125fr" ;
1617
@@ -35,11 +36,12 @@ export const ModeledMethodDataGrid = ({
3536 hideModeledApis,
3637 onChange,
3738} : Props ) => {
38- const methodsWithModelability : Array < {
39- method : Method ;
40- methodCanBeModeled : boolean ;
41- } > = useMemo ( ( ) => {
39+ const [ methodsWithModelability , numHiddenMethods ] : [
40+ Array < { method : Method ; methodCanBeModeled : boolean } > ,
41+ number ,
42+ ] = useMemo ( ( ) => {
4243 const methodsWithModelability = [ ] ;
44+ let numHiddenMethods = 0 ;
4345 for ( const method of sortMethods ( methods ) ) {
4446 const modeledMethod = modeledMethods [ method . signature ] ;
4547 const methodIsUnsaved = modifiedSignatures . has ( method . signature ) ;
@@ -50,9 +52,11 @@ export const ModeledMethodDataGrid = ({
5052
5153 if ( methodCanBeModeled || ! hideModeledApis ) {
5254 methodsWithModelability . push ( { method, methodCanBeModeled } ) ;
55+ } else {
56+ numHiddenMethods += 1 ;
5357 }
5458 }
55- return methodsWithModelability ;
59+ return [ methodsWithModelability , numHiddenMethods ] ;
5660 } , [ hideModeledApis , methods , modeledMethods , modifiedSignatures ] ) ;
5761
5862 const someMethodsAreVisible = methodsWithModelability . length > 0 ;
@@ -95,6 +99,10 @@ export const ModeledMethodDataGrid = ({
9599 ) ) }
96100 </ >
97101 ) }
102+ < HiddenMethodsRow
103+ numHiddenMethods = { numHiddenMethods }
104+ someMethodsAreVisible = { someMethodsAreVisible }
105+ />
98106 </ VSCodeDataGrid >
99107 ) ;
100108} ;
0 commit comments