TypeCobol icon indicating copy to clipboard operation
TypeCobol copied to clipboard

Completion should propose all leaf variables?

Open smedilol opened this issue 7 years ago • 3 comments

With this kind of syntax:

       01 Person typedef strict.
         03 Names.
           05 LastName  pic X(30).
           05 FirstName pic X(30).
         03 BirthDate type Date.
      01 Person1 type Person.

When you ask for completion after: move Person1:: you only get:

Names
BirthDate

Shouldn't it be better to have all leaf variables as well?

Names
Names::LastName
Names::FirstName
BirthDate

So someone who don't know the structure doesn't have to look at its definition.

smedilol avatar Apr 19 '18 13:04 smedilol

This mechanism is already implemented when you ask completion for a procedure parameter.

smedilol avatar Apr 19 '18 13:04 smedilol

It's slightly different between procedure parameter completion and QualifiedName completion.

The pros of getting leaf children on QualifiedName completion is the fact that the developer will get the final variable quickly.

The cons of that is the fact that if there is a lot of children the completion list could be very extensive. Also, do we stop completion to propose only the first children or do we suggest all the available paths until the last children

You can discuss about that later :)

collarbe avatar Apr 19 '18 14:04 collarbe

There should be an option client side enable or disable this functionnality and let the programmer decide if he wants to use it or not.

maxime645 avatar Apr 08 '19 06:04 maxime645