Releases: eyza-cod2/vscode-cod-gsc
Version 0.3.0
Version [0.3.0] - 2024-11-08
This update focuses on the user experience with GSC files and functions.
Hover provider for GSC paths
Hover over a path (e.g. "maps\mp\gametypes\script") will show the paths used for searching the file.
When multi-root workspace is used, the paths are shown for each workspace folder.
Reference provider for GSC function definitions
Now its possible to show references of a function via right-click on the function name and selecting "Go to References" or "Find all References" in the context menu.
Visualization of replaced (unreachable) files
When GSC file is replaced by another GSC file in multi-root workspace because of the same game path, the code in text editor is shown as semi-transparent (unreachable code)
Example:
Rename provider
Function names can be renamed across all GSC files.
Side panel
GSC side panel with "Workspace", "File" and "Other" views.
It shows information about workspace setup, parsed GSC files and available commands to run.
In future version it will allow to change settings more interactively.
All changes:
- Added definition provider and hover provider for GSC paths
- Added reference provider for GSC function definitions
- Added: When GSC file is replaced by another GSC file in multi-root workspace because of the same game path (e.g. maps\mp\gametypes\script), the code in text editor is shown as semi-transparent (unreachablecode)
- Added rename provider that supports GSC function rename
- Added GSC side panel with "Workspace", "File" and "Other" views. It shows information about workspace setup, parsed GSC files and available commands to run.
- Added new Output window "GSC File Logs" to diagnose changes to file system.
- Improved detection of GSC file and folder changes, moving, renaming, etc...
- Improved Issues, cached exception now appears in status bar, source code is included into report
- Improved GSC file references when two or more workspace folders are referenced for each other. When there are 2 workspaces where in each there is one file with the same "game" path (e.q.maps\mp\gametypes\script.gsc), only the last file is used (according to the workspace folder order in explorer). It applies for function and variable definitions in hover provider, auto-completion etc.
- Changed function precedence for universal game to prioritize local functions, then included functions, then built-in functions; if a function is defined multiple times, the first one found is used and othersare ignored without error - unlike CoD2, where duplicate function names in local or included files cause an error.
- Change: the extension activate function now does not wait for all GSC files to be parsed
- Fixed error "'range' cannot span multiple lines" - when typing file path in GSC file.
- Fixed a bug where the status bar item was not displayed when parsing all files again
- Fixed LoggerOutput to show local time in logs instead of ISO time
- Fixed diagnostic errors for GSC file references on Linux systems
- Fixed hover and go to definition not working when cursor is right at start of the function name / keyword
- Fixed CoD2 function 'getBrushModelCenter(entity)' - missing argument
Version 0.2.0
Version [0.2.0] - 2024-10-01
Added support for global variable definitions (CONST_VAR1 = 1;)
Added support for array initializers, like "arr = [10, 20, 30]"
Added support for conditional ternary operators (var = a ? b : c)
Added support for do {} while ();
Added list of supported GSC features for each game.
Universal game supports everything.
For example CoD2 does not support foreach, do-while, array initializer, global variables, ternary, recursive developer blocks, etc. When not supported, error diagnostics is shown.
Improved missing semicolon error indication
The red underline is visible only at the end of the statement where the semicolon should be placed
Improved missing semicolon detection
By verifying if (object + function call) and (variable + structure accessor) are on single line
All changes:
- Added support for global variable definitions (CONST_VAR1 = 1;)
- Added support for array initializers, like "arr = [10, 20, 30]"
- Added support for conditional ternary operators (var = a ? b : c)
- Added support for do {} while ();
- Added list of supported GSC features for each game. Universal game supports everything. For example CoD2 does not support foreach, do-while, array initializer, global variables, ternary, recursive developer blocks, etc. When not supported, error diagnostics is shown.
- Improved missing semicolon error indication - now the red underline is visible only at the end of the statement where the semicolon should be placed
- Improved missing semicolon detection by verifying if variable + structure accessor, object + function call are on single line
- Improved error diagnostics for 'if', 'else', 'for', 'while', 'do' when inline statement is used instead of scope (single-line scope) and there is some error in that inline statement. (for example "if (true) some error here;" would no longer consider "if (true)" as bad syntax)
- Improved exception messages when parsing GSC files.
- Fixed correct update of currently selected game in status bar when manually changed
- Fixed foreach with function call in array parameter -> "foreach(v in getArray())" -> 'in' keyword was recognized as variable name
- Fixed 'for' with function call in condition statement -> "for (i = 1; self isOk(); i++)"
- Fixed double negations -> "var1 = !!true;"
- Fixed no error detected when foreach expression is empty -> foreach() {}
- Fixed error for unclosed scope bracket -> { }