Skip to content

Commit

Permalink
Version 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eyza-cod2 committed Oct 1, 2024
1 parent 41eea61 commit 8e047bb
Show file tree
Hide file tree
Showing 9 changed files with 178 additions and 79 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ All notable changes to the "gsc" extension will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)

## [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 - 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 -> { }


## [0.1.10] - 2024-09-22

- Added support for "foreach"
Expand Down
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ This extension adds language support for the GSC scripts used in Call of Duty ga
<td rowspan="2">IW4</td>
<td>original</td>
<td>❗ Tested, errors</td>
<td>foreach, global variables, childthread, call</td>
<td>childthread, call</td>
</tr>
<tr>
<td>Alterware IW4x</td>
Expand All @@ -78,7 +78,7 @@ This extension adds language support for the GSC scripts used in Call of Duty ga
<td rowspan="3">IW5</td>
<td>original</td>
<td>❗ Tested, errors</td>
<td>foreach, global variables, childthread, call</td>
<td>childthread, call</td>
</tr>
<tr>
<td>Plutonium IW5</td>
Expand All @@ -95,12 +95,12 @@ This extension adds language support for the GSC scripts used in Call of Duty ga
<td rowspan="2">T6</td>
<td>original</td>
<td>❗ Tested, errors</td>
<td>#insert, #define, autoexec, do while, const, %xxx::yyy, /@ comments @/</td>
<td>#insert, #define, param default value, autoexec, const, %xxx::yyy, /@ comments @/</td>
</tr>
<tr>
<td>Plutonium T6</td>
<td>❗ Tested, errors</td>
<td>foreach</td>
<td>order of file references</td>
</tr>
<tr>
<td rowspan="2">Ghosts</td>
Expand All @@ -119,7 +119,7 @@ This extension adds language support for the GSC scripts used in Call of Duty ga
<td rowspan="2">S1</td>
<td>original</td>
<td>❗ Tested, errors</td>
<td>foreach, global variables, array initializator, childthread, call</td>
<td>childthread, call</td>
</tr>
<tr>
<td>Alterware S1-Mod</td>
Expand Down Expand Up @@ -155,7 +155,7 @@ This extension adds language support for the GSC scripts used in Call of Duty ga
<tr>
<td>Aurora H1-mod</td>
<td>❗ Tested, errors</td>
<td>foreach, param default value, ternary operator</td>
<td>param default value, call, childthread</td>
</tr>
<tr>
<td>WWII</td>
Expand Down Expand Up @@ -266,6 +266,10 @@ Diagnostics - invalid file for #include

![Completion](images/vscode-diagnostics-include.png)

Diagnostics - possible missing semicolon indication

![Completion](images/vscode-diagnostics-single-line.png)



Function definition
Expand Down Expand Up @@ -316,9 +320,10 @@ Status bar
- Comments (`/*...*/`, `//...`)
- Developer blocks (`/# ... #/`)
- Preprocessor (`#include`, `#using_animtree`, `#animtree`)
- Keywords (`return`, `if`, `else`, `for`, `while`, `switch`, `continue`, `break`, `case`, `default`, `thread`, `wait`, `waittillframeend`, `waittill`, `waittillmatch`, `endon`, `notify`, `breakpoint`)
- Keywords (`return`, `if`, `else`, `for`, `foreach`, `while`, `do-while`, `switch`, `continue`, `break`, `case`, `default`, `thread`, `wait`, `waittillframeend`, `waittill`, `waittillmatch`, `endon`, `notify`, `breakpoint`)
- Operators (`=`, `+=`, `-=`, `*=`, `/=`, `%=`, `|=`, `&=`, `^=`, `++`, `--`, `+`, `-`, `*`, `/`, `%`, `|`, `&`, `^`, `<<`, `>>`, `==`, `!=`, `<`, `>`, `<=`, `>=`, `&&`, `||`, `!`, `~`)
- Strings (`"default"`, `&"STRING_LOCALIZED"`, `#"sv_cvar_string"`)
- Ternary conditional operators (`true ? "yes" : "no"`)
- Anim string (`%xanim_file_name`)
- Path (eg. `maps\mp\gametypes\sd`)
- Detection of explicitly typed types of variables (string, localized string, cvar string, vector, integer, float, structure, array, function, entity, bool, xanim)
Expand All @@ -335,6 +340,7 @@ Status bar
- Extra semicolons
- Invalid function parameters
- Missing files
- Invalid numbers of function parameters
- Semantics token provider
- Proper colorization of tokens
- Definition provider
Expand All @@ -350,7 +356,6 @@ Status bar


## TODO
- foreach, ternary operator, do while, array initializer
- Add .csc files (client side scripts)
- Parser for .menu files
- Integrate list of built-in functions for CoD4
Expand Down
Binary file added images/vscode-diagnostics-single-line.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/vscode-update-news-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/vscode-update-news-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/vscode-update-news-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8e047bb

Please sign in to comment.