minor
#29089
Extend the TL Script functions log() and info() to include selectable message levels (INFO, WARN, ERROR)
#29306
TL Script: dateFormat() should accept an explicit timezone to format Calendar values losslessly
defect
major
#29383
A dead SOCKET_APPENDER (Chainsaw, localhost:4445) in the default logging configuration can cause logging to stall and operations to abort under heavy load
minor
#29380
Context-sensitive auto-numbering fails if the context and the numbered object are created within a single transaction
#29393
URL routing in the React view layer is broken: ForwardingReactContext does not delegate getRouteManager()
enhancement
The TL Script Editor (TLScriptCodeEditorControl) already offers code completion: When you type `, model elements are suggested; when you type ., functions are suggested.
Extension: When you type ` $, the variables available at the cursor position within the scope should be suggested.
Behavior
- Typing $ opens the completion popup with the variables available in the current scope; typing further filters the list.
- Only variables whose scope includes the cursor are suggested:
- Lambda parameters (x -> ...) are only visible within the lambda body. The body ends at `,`, `;`, or the closing parenthesis.
- Local assignments (name = ...;) are visible in the following statements of the same block (block-local), but not within their own right-hand side.
- No suggestions:
- at the top level without an enclosing lambda or a preceding assignment,
- inside string literals ("...", '...'),
- within model constants (` `... ``).
Examples
count(all(`MyModule:MyType`), x -> $ ) // provides $x
.filter(y -> $ ) // provides $x and $y
$ // top level: nothing
fun = x -> $x + 1; $ // returns $fun (not $x)
a = 5; b = 3; $ // returns $a and $b
Implementation
- New scope analyzer TLScriptVariableScope: tokenizes the text up to the cursor using the TL-Script lexer and determines the visible variables via a stack of bracket frames (lambda parameters per statement/argument, local assignments per block). Robust against incomplete input while typing.
- TLScriptAutoCompletionCommand: new variable completion mode; reads the new command argument textToCursor. Mode order ensures that $ in strings/model constants does not trigger completion.
- TLScriptCodeEditorControl: Trigger regex extended to include a $ branch.
- Client (mode-tlscript.js): additionally sends the text up to the cursor position (textToCursor).
Affected module: com.top_logic.model.search.