File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
extensions/ql-vscode/src/model-editor Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,12 @@ export function getArgumentsList(methodParameters: string): string[] {
6666 return methodParameters . substring ( 1 , methodParameters . length - 1 ) . split ( "," ) ;
6767}
6868
69+ /**
70+ * Should we present the user with the ability to edit to modelings for this method.
71+ *
72+ * A method may be unmodelable if it is already modeled by CodeQL or by an extension
73+ * pack other than the one currently being edited.
74+ */
6975export function canMethodBeModeled (
7076 method : Method ,
7177 modeledMethods : readonly ModeledMethod [ ] ,
Original file line number Diff line number Diff line change 99 Uri ,
1010} from "vscode" ;
1111import { DisposableObject } from "../../common/disposable-object" ;
12- import { Method , Usage } from "../method" ;
12+ import { Method , Usage , canMethodBeModeled } from "../method" ;
1313import { DatabaseItem } from "../../databases/local-databases" ;
1414import { relative } from "path" ;
1515import { CodeQLCliServer } from "../../codeql-cli/cli" ;
@@ -146,7 +146,13 @@ export class MethodsUsageDataProvider
146146 getChildren ( item ?: MethodsUsageTreeViewItem ) : MethodsUsageTreeViewItem [ ] {
147147 if ( item === undefined ) {
148148 if ( this . hideModeledMethods ) {
149- return this . sortedTreeItems . filter ( ( api ) => ! api . method . supported ) ;
149+ return this . sortedTreeItems . filter ( ( api ) =>
150+ canMethodBeModeled (
151+ api . method ,
152+ this . modeledMethods [ api . method . signature ] ?? [ ] ,
153+ this . modifiedMethodSignatures . has ( api . method . signature ) ,
154+ ) ,
155+ ) ;
150156 } else {
151157 return [ ...this . sortedTreeItems ] ;
152158 }
You can’t perform that action at this time.
0 commit comments