Remove useless call to EventsFunctionExtractorDialog.

This commit is contained in:
Davy Hélard
2024-04-11 17:29:09 +02:00
parent 1cd8999589
commit d512d90224
4 changed files with 5 additions and 35 deletions

View File

@@ -38,10 +38,7 @@ import {
import AsyncIcon from '../../UI/CustomSvgIcons/Async';
import Tooltip from '@material-ui/core/Tooltip';
import GDevelopThemeContext from '../../UI/Theme/GDevelopThemeContext';
import {
type EventsScope,
getProjectScopedContainersFromScope,
} from '../../InstructionOrExpression/EventsScope.flow';
import { type EventsScope } from '../../InstructionOrExpression/EventsScope.flow';
import { enumerateParametersUsableInExpressions } from '../ParameterFields/EnumerateFunctionParameters';
import { getFunctionNameFromType } from '../../EventsFunctionsExtensionsLoader';
import { ExtensionStoreContext } from '../../AssetStore/ExtensionStore/ExtensionStoreContext';

View File

@@ -34,7 +34,6 @@ import {
type FieldFocusFunction,
} from '../ParameterFields/ParameterFieldCommons';
import Edit from '../../UI/CustomSvgIcons/Edit';
import { getProjectScopedContainersFromScope } from '../../InstructionOrExpression/EventsScope.flow';
import { switchBetweenUnifiedInstructionIfNeeded } from '../../EventsSheet/ParameterFields/AnyVariableField';
import { switchBetweenUnifiedObjectInstructionIfNeeded } from '../../EventsSheet/ParameterFields/ObjectVariableField';

View File

@@ -48,7 +48,7 @@ import {
shouldValidate,
} from '../../../UI/KeyboardShortcuts/InteractionKeys';
import Paper from '../../../UI/Paper';
import { getProjectScopedContainersFromScope } from '../../../InstructionOrExpression/EventsScope.flow';
const gd: libGDevelop = global.gd;
const styles = {
@@ -279,13 +279,7 @@ export default class ExpressionField extends React.Component<Props, State> {
parameterValues: ParameterValues
) => {
if (!this._inputElement) return;
const {
globalObjectsContainer,
objectsContainer,
scope,
expressionType,
value,
} = this.props;
const { projectScopedContainers, expressionType, value } = this.props;
const cursorPosition = this._inputElement.selectionStart;
const parser = new gd.ExpressionParser2();
@@ -306,11 +300,6 @@ export default class ExpressionField extends React.Component<Props, State> {
expressionNode,
cursorPosition + 'fakeIdentifier'.length - 1
);
const projectScopedContainers = getProjectScopedContainersFromScope(
scope,
globalObjectsContainer,
objectsContainer
);
const type = gd.ExpressionTypeFinder.getType(
gd.JsPlatform.get(),
projectScopedContainers,
@@ -430,8 +419,7 @@ export default class ExpressionField extends React.Component<Props, State> {
_doValidation = () => {
const {
project,
globalObjectsContainer,
objectsContainer,
projectScopedContainers,
expressionType,
scope,
onGetAdditionalAutocompletions,
@@ -447,12 +435,6 @@ export default class ExpressionField extends React.Component<Props, State> {
const parser = new gd.ExpressionParser2();
const expressionNode = parser.parseExpression(expression).get();
const projectScopedContainers = getProjectScopedContainersFromScope(
scope,
globalObjectsContainer,
objectsContainer
);
const { errorText, errorHighlights } = extractErrors(
gd.JsPlatform.get(),
project,

View File

@@ -23,7 +23,6 @@ import { TextFieldWithButtonLayout } from '../../UI/Layout';
import { type ParameterInlineRendererProps } from './ParameterInlineRenderer.flow';
import ShareExternal from '../../UI/CustomSvgIcons/ShareExternal';
import SvgIcon, { type SvgIconProps } from '@material-ui/core/SvgIcon';
import { getProjectScopedContainersFromScope } from '../../InstructionOrExpression/EventsScope.flow';
import SelectField from '../../UI/SelectField';
import SelectOption from '../../UI/SelectOption';
import { ColumnStackLayout } from '../../UI/Layout';
@@ -163,9 +162,7 @@ export default React.forwardRef<Props, VariableFieldInterface>(
function VariableField(props: Props, ref) {
const {
project,
globalObjectsContainer,
objectsContainer,
scope,
projectScopedContainers,
variablesContainers,
enumerateVariables,
instruction,
@@ -280,11 +277,6 @@ export default React.forwardRef<Props, VariableFieldInterface>(
? t`This variable is not declared. It's recommended to use the *variables editor* to add it.`
: null;
const projectScopedContainers = getProjectScopedContainersFromScope(
scope,
globalObjectsContainer,
objectsContainer
);
const variableType =
project && instruction && getVariableTypeFromParameters
? getVariableTypeFromParameters(