Visual Studio Code: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
m (Fix link to VScript tutorial)
 
(14 intermediate revisions by 7 users not shown)
Line 1: Line 1:
This page describes how to set-up Visual Studio Code (VSCode) for [[VScript]] purposes.
[[File:vscode-logo.png|right|450px|Visual Studio Code's logo]]
{{Industry tool|{{w|Visual Studio Code}}}}
{{for|about=the rich text editor commonly used with scripts|the IDE recommended for use with the Source engine's C++ code|[[Visual Studio]]}}
{{vscode|4}} (also known shorthand as {{vscode|3.1|nt=0}}) is a rich text editor developed and maintained by Microsoft. Its extension marketplace contains many community-driven extensions catering to scripting formats used in Source, making it a frequently recommended tool among modders who work with scripts. Visual Studio Code should not be confused with Visual Studio, which is a more complicated and heavy-handed application used for Source's C++ source code.


== Usage ==
Visual Studio Code is particularly useful for [[VScript]] due to its versatility with high-level programming languages. For more information on how to set up Visual Studio Code with VScript, see [[Visual Studio Code/Setting up Visual Studio Code for VScript|Setting up Visual Studio Code for VScript]].
 
=== {{sq}} Squirrel ===
Click on the Extensions button in VSCode. This is represented as a icon of building blocks, usually on the left side of the window.
 
Search for "Squirrel" in the search bar. Install the following extensions:
* Squirrel Language Supports (by marcinbar)
* Squirrel Language Linter (by marcinbar)
 
Restart VSCode. Now the language is ready for use in the editor!
 
==== Autocomplete ====
For {{tf2|2}}, auto-completion of the game's built-in [[Team Fortress 2/Scripting/Script Functions|script functions and constants]] is also available.
 
To install, press Ctrl + Shift + P in VSCode.
 
Search for "Configure User Snippets" and click on the command, then search for "squirrel" and click on it.
You should have a "squirrel.json" window open at this point.
 
Replace the contents of this window with [https://github.com/ZacharyTalis/tf2-vscript-snippets/blob/main/squirrel.json the text here].
{{tip|Press the Raw button on the Github page and then press Ctrl + A to select all of the text and Ctrl + C to copy everything. You can now paste this directly into the VSCode document.}}
 
Save the file, and now VSCode will provide autocomplete for your scripts!
 
== See Also ==
* Original thread for {{tf2}} script auto-complete: https://tf2maps.net/threads/autocompleting-tf2-vscript-in-vscode.48453/
* [[VScript]]
* {{sq}} [[Squirrel]]


== External links ==
== External links ==
* [https://code.visualstudio.com/ Visual Studio Code]
* [https://code.visualstudio.com/ Visual Studio Code]
* [https://marketplace.visualstudio.com/items?itemName=stefan-h-at.source-engine-support "Source Engine Support" extension by Stefan Heinz] ''(syntax highlighting and tooling for [[QC]], [[VMT]], and more)''


[[Category:Visual Studio Code]]
[[Category:Visual Studio Code]]
[[Category:VScript]]

Latest revision as of 14:48, 21 July 2024

Visual Studio Code's logo
Info.png
This article or section is about an external tool that is not directly related to Valve's engines. It is not an exhaustive source of information and may only exist on this wiki for reference purposes.
Please see Wikipedia icon Visual Studio Code for more information on the tool itself.
This article is about the rich text editor commonly used with scripts. For the IDE recommended for use with the Source engine's C++ code, see Visual Studio.

Visual Studio Code Visual Studio Code (also known shorthand as VSCode) is a rich text editor developed and maintained by Microsoft. Its extension marketplace contains many community-driven extensions catering to scripting formats used in Source, making it a frequently recommended tool among modders who work with scripts. Visual Studio Code should not be confused with Visual Studio, which is a more complicated and heavy-handed application used for Source's C++ source code.

Visual Studio Code is particularly useful for VScript due to its versatility with high-level programming languages. For more information on how to set up Visual Studio Code with VScript, see Setting up Visual Studio Code for VScript.

External links