Jump to content

Recommended Posts

SQDevLogo.png

Generic error in expression!

If you have had enough of these or similar log entries during the code development then this post is exactly for you!

 

I'd like to use this post in order to present you a plugin I have written for the Eclipse IDE. It's named "SQDev" and it aims for providing the possibility to develop Arma projects from within Eclipse.

But the goal is not only to simply provide the ability to do so, but rather give the developer as many tools as possible in order to facilitate the developing process. The live syntax check is only one example for such a facilitation.

I am now working for about 3 years on this plugin and I now have the feeling that it is good enough to share it with you guys.

 

 

Features

Editors:

  • There are editors included for the following file types: .sqf, .ext, .cpp, .hpp, .sqm and for a Stringtable.xml
  • Basic syntax highlighting and content-assist for all editors
  • Full macro support in all file types (highlighting + content-assist)
  • Advanced syntax highlighting and content-assist for the SQF-Editor
  • Live syntax-check and type checking for the SQF-Editor with basically no restrictions (in terms of the syntax-checking; Type checking still has some restrictions) - Just code in a way the Arma-engine understands and the plugin will get it too (minor exceptions aside)
  • Project-wide syntax check - No need to open each file and check it for errors as the plugin will do that for you in the background
  • Hover-Information for SQF commands including the majority of the information listed on the respective BIKI page
  • The BIKI page of each command  is only one click away when using the SQF-Editor
  • Graphical user interface for editing the Stringtable.xml

 

Wizards:

  • NewProjectWizard - Creates a new mission with the needed folder infrastructure so you can start coding right away
  • Import- and ExportWizard - Import and export your missions to and from eclipse
  • NewFileWizard - Creates a new SQF-file with a generic header containing the name of the project, of the script itself and the author.

 

Miscellaneous:

  • A big settings framework allowing you to customize the plugin to your needs and preferences (Window -> Preferences)
  • Integrated RPT-Viewer - No more switching between the editor and the file explorer in order to look into the local log files
  • Custom SQDev perspective in eclipse that adapts the UI to the needs of a SQF scripter
  • Parse tree visualization - See how the engine will interpret your code
  • Supports both: Windows and Linux
  • You are not dependent on me updating the plugin if a new SQF command is introduced as the plugin has a command-update functionality that reads all commands and the corresponding information from the BIKI itself. That means you can update the used commands whenever you feel the need for it (Can be done from within the preferences)

 

 

 

Documentation

A complete documentation of the plugin can be found here. It contains everything there is to know about the plugin. Part of it is of course how to install the plugin and how to get started with it.

If you have any questions or need some help with the plugin you can join my discord channel (see Feedback and contact).

 

 

Source code + Issue tracker

The plugin is maintained on GitHub. That means you can at any time take a look into the source code of it. But it does also mean that all bug reports and feature requests have to be created there. If you experience a bug please follow the following steps:

  1. Make sure no one else has filed this bug before by having a look at the list of known bugs
  2. Try to reproduce the error - The more detail you can provide on this the likelier it is that the bug gets fixed
  3. Create a new issue on GitHub and describe the bug with as many details as possible
  4. Attach some general system information to your bug report. You can do so by using the "Plugin info creator" of the plugin itself that is accessible through the toolbar (red exclamation mark on a green circle)

 

There is also a list of known feature requests, so please try to avoid duplicates. But you are more than welcome to comment on these requests so I can see what you are thinking about them.

 

 

Feedback and contact

You can leave your feedback here in this thread. However for faster responses and a more direct contact to me I'd suggest you to join my discord channel. Do not get confused because of my second Nickname (Raven) there.

 

 

 

Media

Spoiler

2444-sqdev-fullview-png

 

2445-sqdev-errordisplay-png

 

1665-sqdev-hoverassist-gif

 

1666-sqdev-contentassist-png

 

1902-stringtableeditor-png

  • Like 7

Share this post


Link to post
Share on other sites

Version 0.7.1 is now out.

 

Changelog:

| Added: Preference specifying whether a notification should pop up on parseMode change
| Improved: Includes now check for the use of a backslash
| Improved: SQF parser now recognizes numbers in scientific and hexadecimal notation
| Fixed: Parsing getting really slow under certain circumstances
| Fixed: Files do no longer get parsed multiple times at once
| Fixed: Includes on unix systems no longer fail because of backslash
| Fixed: Mulitline comments not being highlighted immediately

 

Share this post


Link to post
Share on other sites

I'm kind of surprised you're doing this. The documentation for Eclipse is terrible. I'm looking forward to what you do though. I might be able to use some of your ideas ;)

Share this post


Link to post
Share on other sites
On 2/23/2017 at 3:40 AM, K-Town said:

I'm kind of surprised you're doing this. The documentation for Eclipse is terrible.

Yeah well... It's a lot of trial and error but in the end I worked myself into the framework and once you have done that the documentation becomes somewhat useful ^^

  • Like 1

Share this post


Link to post
Share on other sites

The new version 0.7.2 has made its way out of testing today and it will bring various bug fixes and - momst notably - teaches the plugin to recognize the return type of a command based on the syntax it is used with. Therefore it can now determine whether Operators like + return a String, an Array or a Number so the error messages gained another level of depth :)

Furthermore it is now possible to import mod projects into the plugin.

 

You can get the latest plugin version here (just install the update as if you'd install it for the first time and eclipse will take care of the rest).

Also feel free to pay the SQDev-Discord a visit ;)

 

Changelog:

| Added: Rudimentary support for mod projects (creation + import)
| Fixed: Wrongly escaped quotation marks in config files
| Fixed: Binary operators that don't have (yet) a right argument causing a NullpointerException during parsing
| Fixed: Error occuring on startup of the StringTableEditor
| Fixed: Inappropriate selection in the package-tree of the StringTableEditor
| Fixed: Error during command update on windows machines
| Fixed: RPTViewer formatting now works as expected
| Fixed: Error markers only appearing at the start of an element instead of underlining it completely
| Fixed: Endless loop in SQDev-Editor when typing in a '@'
| Improved: Numbers between 0 and 1 can now be entered as '.x' (instead of '0.x') without getting an error
| Improved: Return value is now determined according to the context in which the operator is used
| Improved: Operators having multiple return values depending on the used syntax are now respected
| Improved: Parsing now gets triggered by content change instead of keyboard inputs
| Improved: Vital commands (control structures) can no longer be left out

 

  • Like 1

Share this post


Link to post
Share on other sites

I have finall been able to finish the work on the 0.7.3 release. The biggest improvement this release brings is the global project parsing. That means that you no longer have to open every single SQF-file in your project manually in order to see if the parser finds ay errors in them as this check is now automatically performed in the background.

 

After having installed the new version you should consider to rebuild all (SQDev-)Projects in your workspace in order for this feature to aplly to all your "old" SQDev-Projects. To do so you have to go to the Menu Project -> Clean... and then select all your SQDev-projects (or simply let it select all projects) and hit `clean`. Note that it can take quite a while to complete the building (you will see a notification in the bottom right corner saying "building workspace" (or somehting simliar)).

 

Changelog:

| Added: Parser testcases for improved stability throughout development
| Added: Possibility to create necessary file-infrastructure as dummy on machines that don't have ArmA installed
| Added: MP option to Project wizard
| Added: Global Project Parsing
| Added: SQDev Project Nature for identifying SQDev projects properly
| Added: Custom SQDev Navigator (experimental only)
| Improved: SQDev projects are now encoded with UTF-8 per default (independently from the system's default)
| Improved: Command info is now two staged (first basic, then full)
| Improved: Editors now restart automatically after command update
| Improved: Command update now uses the BIKI API
| Improved: SQF validation is no longer bound to the SQFEditor allowing for more flexible usage
| Improved: Hidden files are now ignored during export
| Improved: All parsing is now done with the SLL(*) approach
| Fixed: Little bugs in command update
| Fixed: Error markers are now displayed on external files as well
| Fixed: (Un)Indentation of whole selection area is no longer broken

If you are having any trouble with this release come and pay me a visit on the official SQDev-Discord.

 

The new version can be directly downloaded from GitHub.

  • Thanks 1

Share this post


Link to post
Share on other sites

Version 0.7.4 just got released.

It consists of bug fixes for bugs that came with v0.7.3 plus an upgrade to the newest ANTLR version

 

Changelog

| Improved: Switched to latest ANTLR release (4.7) which should decrease the parse-time
| Fixed: Continuous NullPointerExceptions during normal coding
| Fixed: Building projects incredibly slow
| Fixed: Increasing command-access time during validation in builder
| Fixed: Permission problems when creating dummy directories
| Fixed: Missing return value after project building

If you are having any trouble with this release come and pay me a visit on the official SQDev-Discord.

 

The new version can be directly downloaded from GitHub.

Share this post


Link to post
Share on other sites

I'm currently writing a manual for the plugin that should cover everything there is to say about it plus some "tutorials" on how to use it properly.

 

Does anyone has any wishes or ideas that should be covered in there?

  • Thanks 2

Share this post


Link to post
Share on other sites

The plugin's manual is finally available in its first version. It still lacks images and some more exotic parts are missing, but it does contain all important information one could need when using it.

 

The manual is available here.

 

If you miss any documentation or have other improvement suggestions just let me know (I can be found on the official Discord server).

Share this post


Link to post
Share on other sites

Thank you for making this!

 

I've been using your plugin for a while and I must say it does a great job!

  • Like 1

Share this post


Link to post
Share on other sites

You are very welcome!

 

Always encouraging to know that others can make a use of it :)

Share this post


Link to post
Share on other sites

Hello!

I startet editing missions not long ago, only changed other players mission to learn what's going on so far... I think R34P3Rs framework seems to be really cool, so I tried to understand how it works and how I can implement it in other missions. As I thought about doing this in eclipse and found your plugin I was very happy, thanks for your work!!! :-)

But my Problem is:

Eclipse shows me 100000 syntax errors! The framework works in the game, so why is that? I can "correct" the errors by changing the syntax of the code a bit in a way I know from other languages but that can't be the point?!?! What am I missing here?

(Everything installed properly, set the paths, imported the unPBOed file and so on... R34P3Rs Framework causes errors together with ALiVE so I thought about eclipse for better checking/understanding.)

Greetings an keep going!

Share this post


Link to post
Share on other sites
11 hours ago, .NoName. said:

I can "correct" the errors by changing the syntax of the code a bit in a way I know from other languages but that can't be the point?!?!

Could you give an example for that please?

 

And what kind of errors are you getting? Are these errors related to (or directly after) macro usages?

Share this post


Link to post
Share on other sites

Thanks for the quick response! :-)

As far as I see, ALL errors are type-conflicts.

original code:    _unit setSkill ["spotTime",0.65];

gives:                  Expected type "Number" but got "Array"!    (the stuff in the brackets is identified as an array,isn't it.)

I change to:        _unit setSkill spotTime;  (that's the syntax "setSkill" awaits, so no error but semantik is changed now...)

 

original code:   if(r3_currentDayState == "day" OR r3_currentDayState == "") then { ... };

gives:                 Expected type "Boolean" but got "String"!   

I change to:      if( (r3_currentDayState == "day") OR (r3_currentDayState == "") ) then { ... };     //gives me no error no more!

 

Eclipse awaits another language??? Anything wrong with the settings? But I imported the project as a SQDev project!

 

Macro usage has nothing to with it, I guess. There are soooo many errors but ALWAYS type-conflicts!

 

 

Share this post


Link to post
Share on other sites

_unit setSkill ["spotTime",0.65]; is a stupid example!!! :-)

spotTime of the unit should be set to 0.65, right?

So _unit setSkill spotTime; makes no sense...

Confusion.... :-)

 

I don't have to open all the files in eclipse so the variables are globaly known??? They all are in the navigator so eclipse should have knowledge of all of them.

Share this post


Link to post
Share on other sites

Ah okay I know what's going on: Some commands have two separate BIKI pages: One with the "normal" syntax and one with the "array" syntax. During its command collection the plugin only visits the "normal" ones as most array-syntaxes have been merged into the regular pages. However setSkill seems to have been an exception to this.

 

The good news is that Lou Montana is currently refactoring the BIKI and is very eagerly performing those merges. Apparently setSkill has been merged into a single page. Therefore the solution to your problem should be to let the plugin perform a command update (Can be issued from the Misc-preference page).

Share this post


Link to post
Share on other sites
12 minutes ago, .NoName. said:

Eclipse awaits another language??? Anything wrong with the settings? But I imported the project as a SQDev project!

No it doesn't. You seem to have done everything correctly ;)

 

1 minute ago, .NoName. said:

I don't have to open all the files in eclipse so the variables are globaly known??? They all are in the navigator so eclipse should have knowledge of all of them.

No you don't have to do that. In fact the current state of the art is that the plugin doesn't even care about global variables. Every ID unknown by the plugin that is a valid variable name and does not start with an underscore is considered to be a valid global variable (The plugin just assumes that you know that it is declared somewhere) xD

Share this post


Link to post
Share on other sites

Okay wait a second. I just wanted to try whether all BIKI pages are still in the proper format for the command update and discovered that the update mechanism got broken with the last BIKI update. I will fix it and come back with instructions for you on how to solve your problem @.NoName.

Share this post


Link to post
Share on other sites

Ok,thank you!!!

 

What I did just right now:

"Updating Keywords...".
(BIKI-API: https://community.bistudio.com/wikidata/api.php
Main page name: Category:Scripting_Commands_Arma_3)
Took a very long time and then gave me a Out-of-memory error (16GB :-) ).

I closed and deletet the project, did the updating with an empty navigator again.

Same error occured...

I will check back here next week.

Happy easter! :-)

 

Share this post


Link to post
Share on other sites

Generally that is the correct approach. But with a broken system you won't get far ^^

Is the error only occurring with setSkill? If so I can give you instructions on how to work around it manually. Otherwise you'll have to wait until I have fixed the update-mechanism so that I can provide you an up-to-date command-file :)

Share this post


Link to post
Share on other sites

Okay I fixed the command update and here is the needed list with all information up-to-date: https://github.com/Krzmbrzl/SQDev/tree/parser-rewrite/plugin/Raven.SQDev.Misc/resources/sqf

You need to replace your local Keyword-file with the one I just linked. (Actually opening it and replacing the content works just the same). For how to find said file you can have a look in the manual.

 

I hope this fixes your problem :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×