mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 01:18:23 +00:00
Fixed the issue (#4790)
This commit is contained in:
parent
60bc09f0ba
commit
c5d74c4a27
2 changed files with 9 additions and 3 deletions
|
|
@ -104,7 +104,7 @@ export function getSuggestionKeys(refState, refSource) {
|
|||
return suggestionList;
|
||||
}
|
||||
|
||||
export function generateHints(word, suggestions, isEnvironmentVariable = false) {
|
||||
export function generateHints(word, suggestions, isEnvironmentVariable = false, fromRunJs) {
|
||||
if (word === '') {
|
||||
return suggestions;
|
||||
}
|
||||
|
|
@ -114,6 +114,7 @@ export function generateHints(word, suggestions, isEnvironmentVariable = false)
|
|||
if (isEnvironmentVariable) {
|
||||
return hint.startsWith('client') || hint.startsWith('server');
|
||||
} else {
|
||||
if (fromRunJs) return hint;
|
||||
return !hint.startsWith('client') && !hint.startsWith('server');
|
||||
}
|
||||
});
|
||||
|
|
@ -207,7 +208,8 @@ export function handleChange(editor, onChange, ignoreBraces = false, currentStat
|
|||
const cursor = editor.getCursor();
|
||||
const currentWord = computeCurrentWord(editor, cursor.ch, ignoreBraces);
|
||||
const isEnvironmentVariable = editor.getValue().startsWith('%%') ?? false;
|
||||
const hints = currentWord !== '' ? generateHints(currentWord, suggestions, isEnvironmentVariable) : [];
|
||||
const hints =
|
||||
currentWord !== '' ? generateHints(currentWord, suggestions, isEnvironmentVariable, editorSource === 'Runjs') : [];
|
||||
const setCursorPosition = () => {
|
||||
const currentValue = editor.getValue();
|
||||
if (currentValue.slice(-4) === '{{}}' || currentValue.slice(-4) === '%%') {
|
||||
|
|
|
|||
|
|
@ -359,6 +359,8 @@ export async function executeMultilineJS(
|
|||
'axios',
|
||||
'variables',
|
||||
'actions',
|
||||
'client',
|
||||
'server',
|
||||
code
|
||||
);
|
||||
result = {
|
||||
|
|
@ -371,7 +373,9 @@ export async function executeMultilineJS(
|
|||
currentState.globals,
|
||||
axios,
|
||||
currentState.variables,
|
||||
actions
|
||||
actions,
|
||||
currentState?.client,
|
||||
currentState?.server
|
||||
),
|
||||
};
|
||||
} catch (err) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue