New Document Type has vanished

Get help with the installation and running of the Zeus IDE. Please do not post bug reports or feature requests here. When in doubt post your question here.
Post Reply
Dataflex
Posts: 11
Joined: Fri Sep 22, 2023 9:46 am

New Document Type has vanished

Post by Dataflex »

I added a document type for the Seed7 language and now it is not in the list of document types. Between adding it and now I
a) purchased the product
b) did some Free Pascal work in a different workspace.
c) opened the Seed7 workspace
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Re: New Document Type has vanished

Post by jussij »

If you use the Tools, DOS Command Line menu and run this command:

Code: Select all

dir "$zud\zconfig\Zeus*.*"
That will list all the document type details that have been configured.
So, depending on the file extension used to create the document type you should see the configuration files associated with that document type.
For example for the .cpp[\i] file extension this command will show the files associated with the C++ document type:

Code: Select all

dir "$zud\zconfig\Zeuscpp*.*"
If you run that command for the file extension, you added you should see those configuration files for that document type extension.

A Google search tells me the file extension for Seed7 is .sd7 so this command should result in displaying the Zeus configuration files for that file extension:

Code: Select all

dir "$zud\zconfig\Zeussd7*.*"
If you run that command, can you see those files :?:

Cheers Jussi
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Re: New Document Type has vanished

Post by jussij »

Also, the document type settings are independent of workspace. If a file of a given extension maps to one of the document types then those document type details will be used to manage that file, based on file extension and this will be independent of any active workspace.

You can determine which document type a file has been associated with by opening that file and then using the Options, Properties menu to then display the document type for that file. The document type will be shown in the caption of the resulting dialog.

You can also use the Options, Set Document Type menu to move that file extension into another document type.

Cheers Jussi
Dataflex
Posts: 11
Joined: Fri Sep 22, 2023 9:46 am

Re: New Document Type has vanished

Post by Dataflex »

Thanks for the reply. There is no Seed7 document type shown among the Zeusxxx-keywords.ext files.

Do you have a feature where a Document Type can be created but not saved?

EDIT: It appears that the software does not automatically save loaded keyword and other files, nor warn that they will not be saved. I loaded mine from files that are not in the directory with the others - the software allows that - and then apparently it only stores them in memory and they are gone once the program terminates. Does that sound correct?
Last edited by Dataflex on Sat Sep 23, 2023 7:56 am, edited 2 times in total.
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Re: New Document Type has vanished

Post by jussij »

There is no Seed7 Document Type shown among the Zeusxxx-keywords.ext
This suggests to me no Document Type for Seed7 was ever created.

I'd recommend creating a Document Type only because it is actually very easy to do; it will take a minute or two.

Here are the instructions on how to find the details on create a new Document Type:
  1. F1 to bring up the Zeus help
  2. Select the Quick Start Guide link
  3. Select the Creating a Document Type link
At a minimum all you will need is a list of Seed7 keywords and the files extensions to be treated as Seed7.
Do you have a feature where a Document Type can be created but not saved?

If you don't hit the Apply button the changes do not get saved, but you will get a warning message to that effect.

Also without creating a Document Type the file extension will just default to using the Default Document Type.

As mentioned before, you can test which Document Type is being used for any given file extension by:
  1. Opening a file with that extension
  2. Using the Options, Properties menu
  3. The resulting dialog is the document type for that file extension
I was editing Seed7 files and getting appropriate syntax highlighting after loading files giving the keywords and some other info.
That is rather weird, as I'm not sure how it would be doing that :?

Now what may have happened is as follows:
  1. Open a Seed7 file with a given file extension
  2. Used the Options, Set Document Type menu to add that extension to an existing Document Type
Those steps add the file extension the Document Type selected and it will then syntax highlight using the details found in that Document Type.

Cheers Jussi
PS: I have also replied to your debugger question.
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Re: New Document Type has vanished

Post by jussij »

One further point. Looking at the Seed7 Wiki page it says it is a language similar to Pascal.

In that case I would also configure the folding for Seed7 as follows.

1: Open the file below by putting the text below into a new Zeus document and use the View, Open file menu to open the file.

Code: Select all

$zud\xfolder.ini
2: Find the Pascal entry and add the Seed7 extensions to that entry:

Code: Select all

Pascal=p;pas
2: Restart Zeus and you should now see there is now code folding for Seed7 files.

Cheers Jussi
Dataflex
Posts: 11
Joined: Fri Sep 22, 2023 9:46 am

Re: New Document Type has vanished

Post by Dataflex »

jussij wrote: Sat Sep 23, 2023 3:04 am
There is no Seed7 Document Type shown among the Zeusxxx-keywords.ext
This suggests to me no Document Type for Seed7 was ever created.
It was created, and in the list, and I was using it and was getting the syntax highlighting. However, I put the keywords in a file in a personal directory and loaded them from there. The software allows keyword files to be loaded from other directories (with other filename formats) than the "keyword file directory". And once loaded the syntax highlighting worked as desired . But Zeus apparently does not check to see if a keyword file exists in the "keyword directory" for the new document type and if not, save what it has for the new document type. Also no warning that "since you are loading from another directory, this document type info will be lost when the program terminates". So when the program terminated it appears the information that was loaded into Zeus was lost (I don't normally shut off my computer so it was up for days and working). But I still have the files I loaded and can move them to the "keyword file directory".
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Re: New Document Type has vanished

Post by jussij »

The software allows keyword files to be loaded from other directories (with other filename formats) than the "keyword file directory".

I'm not really sure what you mean by this :?:
But Zeus apparently does not check to see if a file exists in the "keyword directory" and save what it has for the new document type.

You may well have found a bug in Zeus, but it just isn't clear to me what steps you are using to do this configuration :?
And it doesn't warn that "since you are loading from another directory, this info will be lost when the program terminates".

If Zeus terminates unexpectedly, this means Zeus has crashed and generally, when this happens Zeus displays a crash dump dialog telling the user it has crashed.

But if the crash is really bad it can crash without any warning and no dialog.
But I still have the files I loaded and can move them to the "keyword file directory".
Can you send me these files as an e-mail attachment to:
info @ zeusedit . com
Also one thing that definitely will cause problems is if the Zeus configuration folder is a write protected folder.

For example, this is the default folder location fort the 64-bit Zeus configuration files:
C:\Users\<user ID>\AppData\Local\Programs\Zeus (x64)\zConfig
Now if for example you run the installer and use this as the Zeus installation folder:
C:\Program Files\Zeus (x64)
That then means the config folder ends up being here:
C:\Program Files\Zeus (x64)\zConfig
And that folder location is no good as it is write-protected for all users except the Admin user.

Using a folder like this will mean everything in Zeus goes haywire.

Cheers Jussi
Dataflex
Posts: 11
Joined: Fri Sep 22, 2023 9:46 am

Re: New Document Type has vanished

Post by Dataflex »

Sorry for the delayed response. I have three files in my home directory that I previously used for Seed7 syntax highlighting:

keywords.txt
standard_functions.txt
standard_types.txt

I did a new Seed7 document type and reloaded them and expected that when I closed the program I would lose that Seed7 Document Type as appeared to happen before. But that did not happen.
When I opened the Zeus IDE program the Seed7 Document Type was still there and the syntax highlighting and compiler information was there as well. So I don't know what happened before, but my problem is not there now and the appropriate files have been created:
Directory of C:\Program Files (x86)\Zeus\zConfig

10/11/2023 05:49 PM 195 Zeussd7-compiler.ext
10/11/2023 10:58 PM 244 Zeussd7-general.ext
10/11/2023 06:02 AM 735 Zeussd7-keywords.ext

The one thing I notice is that if I do a compile for Seed7 (actually am calling the Seed7 interpreter which executes the program) it brings up the compile screen as the current active tab. But when I compile a Free Pascal program the compile output is in a new tab but that tab is not the current one (the program code stays as the current tab). I would prefer it to be the current window as happens with Seed7.
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Re: New Document Type has vanished

Post by jussij »

I think the problem you are seeing might be related to this folder location:

Code: Select all

C:\Program Files (x86)\Zeus\zConfig
Windows write protects that folder for all users except admin users and that means Zeus will not be able to write to that folder location.

Now these Zeus files did get created, but I'm not really sure how that could have happened, as that folder should have been write protected:
10/11/2023 05:49 PM 195 Zeussd7-compiler.ext
10/11/2023 10:58 PM 244 Zeussd7-general.ext
10/11/2023 06:02 AM 735 Zeussd7-keywords.ext
Did you run Zeus as an Admin user :?:
When I opened the Zeus IDE program the Seed7 Document Type was still there and the syntax highlighting, and compiler information was there as well.
FYI the configurations files shown above are holding those settings. The terms general, keywords, and compile found in those file names match the details found in the tab with the corresponding name.
The one thing I notice is that if I do a compile for Seed7 (actually am calling the Seed7 interpreter which executes the program) it brings up the compile screen as the current active tab.
I'm assuming you are using the Compiler, Compile menu to run these compilers, which means the command being run is found in the Compiler tab of the document.
I would prefer it to be the current window as happens with Seed7.
That feature is controlled by the output display mode found in the Compiler section of the document type as shown below:
sd-compile.png
sd-compile.png (113.43 KiB) Viewed 189460 times
So, the first thing to check is the two document types have the same output display mode.

Now if the two document types do have the same output display mode, and the mode is set to errors and warnings, then the reason for the difference is the output being produced is not being recognized as an error or a warning.

To fix that you would need to add a regular expression that can identify a line of text as an error and another regular expression for a line containing a warning.

Those regular expressions are then added to the corresponding Regex entry field in the compiler section of the document type.

Cheers Jussi

PS: If you want to know what commands are being run, you can turn on the option as shown below:
sd-general.png
sd-general.png (150.54 KiB) Viewed 189460 times
That will produce extra debugging output that can help determine what is going on when this are compile or built.
Dataflex
Posts: 11
Joined: Fri Sep 22, 2023 9:46 am

Re: New Document Type has vanished

Post by Dataflex »

I only have one login on this computer so it shouldn't have been an administrative rights issue. But not an issue now so it's all good.

I put in regexes for Free Pascal warnings [ .*Note\:.* ] and errors [ (.*Fatal\:.*)|(.*Error\:.*) ] and it now makes the Compiler Messages tab the active one if something is encountered. And I can click on a line and it takes me to the corresponding source code line. Excellent!
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Re: New Document Type has vanished

Post by jussij »

I put in regexes for Free Pascal warnings ... I can click on a line and it takes me to the corresponding source code line.
This is the perfect fix, because that is exactly what those regular expressions options are for and as you've found, they also make the error/warning code navigation work.

FYI the Line Regexp found on that panel is used to help identify the line number from a line of text. Generally, it will not be needed because Zeus has a default line numbers regular expressions that it will use.

It reads like you have Zeus up and running for your two languages :)

But as always, if something else goes wrong or you have any question just create a new forum post with the details.

Cheers Jussi

PS: I would also recommend looking at the links found in the Quick Start Guide found in the Zeus help. There you'll find ways to tweak Zeus to add more functionality.

And the many scripting examples found on the bottom of the Macros menus and in the examples found in the Scripts section of the forum will show how to easy it is to create a Zeus macro to help with a specialized task.
Post Reply