Opened 7 years ago

Last modified 7 years ago

#119 new defect

IntelliSense to work for local variables on Workspace

Reported by: patrik.svestka@… Owned by:
Priority: major Milestone:
Component: default Keywords:
Cc: Also affects CVS HEAD (eXept version): no

Description

The IntelliSense ignores completely the local variables at |localVariable|. That means more typing when using Workspace.

Jan suggested that it is similar issue to #99 (syntax highlighting).

Change History (3)

comment:1 by jan vrany, 7 years ago

Right, the problem is the same - it cannot parse it so it has no clue about the code so shows nothing. The solutions is similar as in #99.

It would actually help me a lot if you could start collecting concrete examples of what code it fails to complete so I have both better understanding of the problem and a real-world testcases. A code snippet, a cursor position and a list of items offered in completion list would be just perfect.

Since the completion logic is driven a lot by various heuristics its important to "train" it or real-world examples.

comment:2 by patrik.svestka@…, 7 years ago

One example would be:

|box field model warning condition|

    min_range := -50.
    max_range := 50.

   [:exit|
    model ifNil: [model := ValueHolder with:'Enter a value'].

    box := DialogBox new.
    box addTextLabel:'Enter some string, please:'.
    box addInputFieldOn:model.
    box addAbortButton; addOkButton.
    box open.


    box accepted
      ifTrue:[

        ((model value) allRegexMatches: '\d+') isEmpty
          ifTrue:[ warning := Dialog new.
                   warning warn: 'Please enter a number!'.
            ] ifFalse:[
                ((model value) asNumber between: min_range and: max_range)
                  ifTrue:[
                    Transcript showCR:'Input from user is OK.'.
                    exit value: 'Correctly entered input.'.
                  ] ifFalse:[warning := Dialog new.
                         warning warn: 'Please enter a number in a range of: ',min_range asString, '-',max_range asString,'!'.
                ].
            ].
      ] ifFalse:[
                   Transcript showCR:'User has cancled the action.'.
                   model := ValueHolder with:nil.
                   exit value: 'User exited.'.
                ].
    ] loopWithExit.
    (model value) ifNotNil: [Transcript showCR:'Model value is: ' , model value].    

Second example would be (for correct running you need to have Altap Salamnader installed - I'm trying to play around with the user menu of the application):

        |userMenuRegistryPath userMenuItemList registryPaths pathMappedToNamesAndValues|

        "registry"
        registryPaths                    := OrderedCollection new.
        pathMappedToNamesAndValues       := Dictionary new.

        userMenuRegistryPath := 'HKEY_USERS\S-1-5-21-119559289-1840127793-336618761-855951\Software\Altap\Altap Salamander 3.08\User Menu'.

        "Registry pathentry for Salamander's 'User Menu'"
        userMenuItemList := Win32OperatingSystem registryEntry key:userMenuRegistryPath.

        userMenuItemList subKeysDo:[:subKey | 
                             registryPaths add: (Win32OperatingSystem registryEntry key: subKey path)].

        registryPaths do:[:path |
            currentNamesAndValues := Dictionary new.  
            path valueNamesAndValuesDo:[:registryName :registryValue |
                     currentNamesAndValues at:registryName put:registryValue
            ].
            pathMappedToNamesAndValues at:path put:currentNamesAndValues
        ].

        pathMappedToNamesAndValues inspect.     

comment:3 by patrik.svestka@…, 7 years ago

Version 2, edited 7 years ago by patrik.svestka@… (previous) (next) (diff)
Note: See TracTickets for help on using tickets.