-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): introduce kv() and secret() pebble autocompletions
closes kestra-io/kestra-ee#77
- Loading branch information
1 parent
9b5b2b9
commit a064c7a
Showing
7 changed files
with
229 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import {YamlElement} from "../utils/yamlUtils"; | ||
|
||
export const QUOTE = "'"; | ||
|
||
export class YamlNoAutoCompletion { | ||
rootFieldAutoCompletion(): Promise<string[]> { | ||
return Promise.resolve([]); | ||
} | ||
|
||
nestedFieldAutoCompletion(_source: string, _parsed: any | undefined, _parentField: string): Promise<string[]> { | ||
return Promise.resolve([]) | ||
} | ||
|
||
valueAutoCompletion(_source: string, _parsed: any | undefined, _yamlElement: YamlElement | undefined): Promise<string[]> { | ||
return Promise.resolve([]); | ||
} | ||
|
||
functionAutoCompletion(_parsed: any | undefined, _functionName: string, _args: Record<string, string>): Promise<string[]> { | ||
return Promise.resolve([]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
const pebbleStart = "\\{\\{ *"; | ||
const fieldWithoutDotCapture = "([^}:~. ]*)(?![^}\\s])"; | ||
const dotAccessedFieldWithParentCapture = "([^}:~ ]+)\\." + fieldWithoutDotCapture; | ||
const maybeTextFollowedBySeparator = "(?:[^~}: ]*[~ ]+)*"; | ||
const fieldWithoutDotCapture = "([^\\(\\)}:~. ]*)(?![^\\(\\)}\\s])"; | ||
const dotAccessedFieldWithParentCapture = "([^\\(\\)},:~ ]+)\\." + fieldWithoutDotCapture; | ||
const maybeTextFollowedBySeparator = "(?:[^~},: ]*[~ ]+)*"; | ||
const maybeParams = "((?:[^\\n\\(\\)~},:= ]+=[^\\n~},:= ]+(?: *, *)?)+)?['\"]?([^\\n\\(\\)~},:= ]*)?"; | ||
const functionWithMaybeParams = "([^\\n\\(\\)},:~ ]+)\\(" + maybeParams | ||
|
||
export default { | ||
beforeSeparator: "([^}:\\s]*)", | ||
beforeSeparator: (additionalSeparators = []) => `([^}:\\s${additionalSeparators.join("")}]*)`, | ||
/** [fullMatch, dotForbiddenField] */ | ||
capturePebbleVarRoot: `${pebbleStart}${maybeTextFollowedBySeparator}${fieldWithoutDotCapture}`, | ||
/** [fullMatch, parentFieldMaybeIncludingDots, childField] */ | ||
capturePebbleVarParent: `${pebbleStart}${maybeTextFollowedBySeparator}${dotAccessedFieldWithParentCapture}`, | ||
/** [fullMatch, functionName, textBetweenParenthesis, maybeTypedWordStart] */ | ||
capturePebbleFunction: `${pebbleStart}${maybeTextFollowedBySeparator}${functionWithMaybeParams}`, | ||
captureStringValue: "^[\"']([^\"']+)[\"']$" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.