mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-11-21 07:51:39 +01:00
Variables under Environment, and render all props
This commit is contained in:
1 parent
eb1cd1c14b
commit
15087f2d5a
17 files changed
+263
-275
No files matched your search
@@ -9,11 +9,13 @@ import { twigCompletion } from './completion';
|
||||
import { parser as twigParser } from './twig';
|
||||
import type { Environment } from '../../../../lib/models';
|
||||
|
||||
export function twig(base: LanguageSupport, environment: Environment | null, autocomplete?: GenericCompletionConfig) {
|
||||
// TODO: fill variables here
|
||||
const data = environment?.data ?? {};
|
||||
const options = Object.keys(data).map(key => ({ name: key }));
|
||||
const completions = twigCompletion({ options });
|
||||
export function twig(
|
||||
base: LanguageSupport,
|
||||
environment: Environment | null,
|
||||
autocomplete?: GenericCompletionConfig,
|
||||
) {
|
||||
const variables = environment?.variables ?? [];
|
||||
const completions = twigCompletion({ options: variables });
|
||||
|
||||
const language = mixLanguage(base);
|
||||
const completion = language.data.of({ autocomplete: completions });
|
||||
|
||||
Reference in new issue
Block a user