mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-03 10:37:48 +09:00
## Description Added autocomplete support for safe string and array methods in the expression editor, as suggested by @TrySound in PR #5403. ## Changes - Exported `allowedStringMethods` and `allowedArrayMethods` from `packages/sdk/src/expression.ts` - Enhanced the expression editor's autocomplete to suggest safe methods when typing after a variable (e.g., system) - Methods are displayed with parentheses for clarity (e.g., `toLowerCase()`, `replace()`, `split()`) - Autocomplete shows helpful labels: "string method" or "array method" ## How to Test 1. Open any project in the builder 2. Click the expression editor icon next to a text property 3. Type a variable name followed by a dot (e.g., `system.`) 4. You should see autocomplete suggestions for safe string methods like `toLowerCase()`, `replace()`, `split()`, etc. 5. Type a few letters to filter (e.g., `title.to` shows only methods starting with "to") 6. Select a method and it will be inserted with parentheses ## Related - Builds on PR #5403 which enabled these safe methods in the expression engine <img width="343" height="204" alt="Bildschirmfoto 2025-10-09 um 22 33 03" src="https://github.com/user-attachments/assets/206a36e8-1d68-4e2a-a045-1f9e95067a28" />