An VSCode extension made for P2CE VScript support, based on https://github.com/ocet247/tf2-vscript-support (TF2 VScript Support) extension for the language server and logic of the extension itself.
(THIS EXTENSION IS IN A VERY VERY VERY EXPERIMENTAL STATE, SO DON'T EXPECT NO BUGS OR NO CRASHES)
- Completions
- Keywords
- Symbols
- String literals (like script names, functions, auto-complete, etc)
- Members of builtin types
- Completions for documentation comments
- Autogenerated comment for variables and functions
- Tags
- Types
- Parameter names (for @param)
- Hover
- Go to definition
- Go to type definition
- Find references
- Rename
- Semantic tokens
- Inlay hints
- Signature help
- Document symbols
- Document link for imports
- Workspace symbol
- Selection range
- Syntax checking
- Type checking for operations and function call arguments
- Unused local variables
- Unreachable code
- String literal name resolution
- Type inference for both variables and functions
- Documentation comments with simple types
- Import resolution from
IncludeScript - Standard library symbols included from both Squirrel and VScript
- Implement custom entities (AngelScript) in the string literals
- Custom ConVars & ConCommands in string literal
- Game Events signatures (like 'OnPlayerUse')
- Formatting
- Completions and validation for models/sounds/assets
- Entities input and outputs
- Amplify and upgrade the database
You can generate your own definitions and modify the existing ones by modifying the 'vscript.nut' in the extension files, without needing to recompile the language server
To generate your own 'vscript.nut' file you need the docs definitions generated by the game, using the sv_script_dump_docs command in-game or by getting the dumps from here.
Then put all files in the 'gen' folder and use the 'dataparser.py' to generate the 'vscript.nut' file.
(You can use the same method to generate your own classnames definitions but you will need to recompile the server for updating the classnames)
- TF2 VScript Support Language Server Extension https://github.com/ocet247/tf2-vscript-support (VisualStudio Marketplace)
- Valve Development Community for VScript function signatures and documentation https://developer.valvesoftware.com/wiki/VScript
- Parts of LSP handling from rust-analyzer and auto-lsp