You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The auto-completion feature in the Kotlin Compiler Server does not support type-safe builders when used in a standalone context outside of a function, which is the scenario for *.kts files. This is particularly noticeable with DSLs.
Expected Behavior
Auto-completion should work consistently for type-safe builders, e.g. HTML builders, both within functions and in standalone usage. This would significantly improve the development experience, especially when working with DSLs.
Current Behavior
While auto-completion works correctly within a function scope, it fails to provide proper suggestions or hints for standalone type-safe builders without a main function.
Steps to Reproduce
Use a type-safe HTML builder within a function and observe the functioning auto-completion.
Use the same builder in a standalone context. Notice the lack of auto-completion hints.
Example
packagehtml// Inside a function - auto-completion worksfunmain() {
html {
head {
title { +"HTML encoding with Kotlin" }
}
}
}
// Standalone - auto-completion does not work
html {
head {
title { +"HTML encoding with Kotlin" }
}
}
classHTML() : TagWithText("html") {
funhead(init: Head.() ->Unit) = initTag(Head(), init)
val sampleValue =222
}
// [Rest of the provided code for Element, TextElement, Tag, etc.]
In the above example, the auto-completion feature assists with the html builder when used inside the main function but does not provide assistance for the standalone html builder.
The text was updated successfully, but these errors were encountered:
Description
The auto-completion feature in the Kotlin Compiler Server does not support type-safe builders when used in a standalone context outside of a function, which is the scenario for *.kts files. This is particularly noticeable with DSLs.
Expected Behavior
Auto-completion should work consistently for type-safe builders, e.g. HTML builders, both within functions and in standalone usage. This would significantly improve the development experience, especially when working with DSLs.
Current Behavior
While auto-completion works correctly within a function scope, it fails to provide proper suggestions or hints for standalone type-safe builders without a main function.
Steps to Reproduce
Use a type-safe HTML builder within a function and observe the functioning auto-completion.
Use the same builder in a standalone context. Notice the lack of auto-completion hints.
Example
In the above example, the auto-completion feature assists with the html builder when used inside the main function but does not provide assistance for the standalone html builder.
The text was updated successfully, but these errors were encountered: