Four Js Development Tools Forum

Discussions by product => Genero Studio => Topic started by: Enrico S. on February 10, 2022, 01:48:55 pm



Title: Why autocompletion behaves wrong on GST 4.00 ?
Post by: Enrico S. on February 10, 2022, 01:48:55 pm
Hi,
I'm frustrated due to wrong autocompletion on GST4 (in GST3 it was working).
In some cases the autocompletion list is not-in-context (see screenshot) and in some other it doesn't appears at all.
It's very hard to use GST without autocompletion.


*** Current config [LOCAL] ***
Genero Studio            : 4.00.03 202109231810 Target __l64xl217

Have someone the same issue ?
Enrico


Title: Re: Why autocompletion behaves wrong on GST 4.00 ?
Post by: Leo S. on February 10, 2022, 02:48:29 pm
Hi Enrico, you may check if you get the same problem with the VIM plugin.
If yes, there is a general problem with the completion in your code (so a problem for fglcomp), if no there is a GST problem.
Please try to isolate that code piece and contact the support.
Regards, Leo


Title: Re: Why autocompletion behaves wrong on GST 4.00 ?
Post by: Reuben B. on February 10, 2022, 11:34:47 pm
I would check if there are any compilation errors showing on lines 1 through 369

Also if you read through $FGLDIR/vimfiles/autoload/fglcomplete.vim you will find the commands that are used to offer up the auto-completion suggestions.  (Studio uses those as a base and adds more based on what info it can gleam from .4pw structure).  You don't necessarily have to use VIM plugin as Leo suggested, you can use the same command vim and Studio uses from the command line ... (I won't type it here since it is not documented but your support contact might give it to you)

Also thinking to what has changed between 3 and 4 are you using any new code initiatives from 4, such as ability to place DEFINE a_servizi anywhere in your code rather than at the top


Title: Re: Why autocompletion behaves wrong on GST 4.00 ?
Post by: Rene S. on February 11, 2022, 08:57:55 am
Hello,
assume this code fragment represents your code:
Code
  1. DEFINE a_servici DYNAMIC ARRAY OF RECORD
  2.    f1, f2 INT
  3. END RECORD
  4. PRIVATE FUNCTION func1(i SMALLINT) RETURNS BOOLEAN
  5. DEFINE l_runString STRING
  6. LET l_runString = "fglrun"||a_servici[i].
  7.  
  8. RETURN TRUE
  9. END FUNCTION
  10.  

Studio uses the compiler for the code completion. The (hidden, undocumented) option -L<line>,<column> produces the proposals. Next invocation of the compiler asks for the code completion at line 6, column 42:

Code
  1. $ fglcomp -L 6,42 zz
  2. zz.4gl:8:1:8:6:error:(-6609) A grammatical error has been found at 'RETURN' expecting: $end CONSTANT DEFINE DIALOG FUNCTION PRIVATE PUBLIC REPORT TYPE.
  3. zz.4gl:6:42:6:42:error:(-4335) The symbol '' is not an element of the record 'a_servici'.
  4. zz.4gl:6:42:6:42:error:(-8416) Missing RETURN.
  5. proposal f1 scope=M entity=variable type=INTEGER
  6. proposal f2 scope=M entity=variable type=INTEGER
  7.  

The screenshot shows the result when using vim.

If you have doubts about the completion: perform the step above with your own code.

Rene
--
PS: return to the power of the command line


Title: Re: Why autocompletion behaves wrong on GST 4.00 ?
Post by: Enrico S. on February 11, 2022, 10:24:10 am
Hi.
I have found a possible reason.
The autocompletion feature is not working after the first code line having a national character (è,é,à for instance).
I opened a support ticket with a sample.

https://agile.strasbourg.4js.com/jira/servicedesk/customer/portal/2/SUP-29283