[Improvement]: Allow the user to rename the targetType
in generated code
#41536
Labels
Area/CodeAction
Language Server Code Actions
Team/LanguageServer
Language Server Implementation related issues. #Compiler
Type/Improvement
Description
In dependently-typed functions, there can be cases where the user may trigger a create variable code action without providing the expected type in the context. In this scenario, the code action will generate the variable with
targetType
as the placeholder. Preferably, the cursor should be placed to rename this value.Describe your problem(s)
Consider the following example of Bal Persistent, in which the user attempts to create a variable for dependently-typed resource access.
In this context, the user hasn't provided the expected type yet, so the code action will not replace the
targetType
as shown:stream<targetType, persist:Error?> streamResult = self.dbClient->/employees();
. Ideally, the cursor should be positioned to rename thetargetType
in this scenario.Describe your solution(s)
Ideally, the LS should allow the user to rename the
targetType
, so the user can enter the expected type after the generation.Related area
-> Compilation
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response
The text was updated successfully, but these errors were encountered: