Visual Studio Code SQF Extensions: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(→‎Extensions: sqf debugger)
m (Fix)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{TOC|side}}
{{TOC|side}}
This page cointains information about [https://code.visualstudio.com/ Microsoft's Visual Studio Code editor] and how it can be used for content creation in Arma.
This page contains information about {{Link|https://code.visualstudio.com/|Microsoft's Visual Studio Code editor}} and how it can be used for content creation in {{arma}}.


= Extensions =
[https://code.visualstudio.com/docs/editor/extension-marketplace Microsoft Article]


The following is a list of recommended extensions. Note that it might be incomplete or out of date. You can search the marketplace for "sqf" to find new or better extensions in that case.
== Extensions ==
 
{{Feature|informative|See the {{Link|https://code.visualstudio.com/docs/editor/extension-marketplace|Microsoft article}}.}}
 
The following is a list of recommended extensions. Note that it might be incomplete or out of date.<br>
{{Link|https://marketplace.visualstudio.com/search?term{{=}}SQF&target{{=}}VSCode&category{{=}}All%20categories&sortBy{{=}}Relevance|Search "SQF" on the marketplace}} to find new or better extensions in that case.
 
{| class="wikitable"
{| class="wikitable"
! Extension
! Author
! Remark
|-
|-
! Extension !! Author !! Remark
| {{Link|https://marketplace.visualstudio.com/items?itemName{{=}}Armitxes.sqf|SQF Language}}
| Armitxes
| Syntax highlighter.
|-
|-
| [https://marketplace.visualstudio.com/items?itemName=Armitxes.sqf SQF Language] || Armitxes || Syntax highlighter.
| {{Link|https://marketplace.visualstudio.com/items?itemName{{=}}SQF-VM.sqf-vm-language-server|SQF-VM Language Server}}
| {{User|X39}} et al.
| Language server for sqf (checks code for errors).
|-
|-
| [https://marketplace.visualstudio.com/items?itemName=SQF-VM.sqf-vm-language-server&ssr=false#overview SQF-VM Language Server] || {{User|X39}} et al. || Language server for sqf (checks your code for errors).
| {{Link|https://marketplace.visualstudio.com/items?itemName{{=}}billw2011.sqf-debugger|SQF Debugger}}
| billw2011
| Debug sqf scripts (callstack, variables, breakpoints, ...)
|-
|-
| [https://marketplace.visualstudio.com/items?itemName=EelisLynne.sqf-wiki SQF Wiki] || Eelis Lynne || Shortcut to go to the Biki page of the selected command/function.
| {{Link|https://marketplace.visualstudio.com/items?itemName{{=}}EelisLynne.sqf-wiki|SQF Wiki}}
|-
| Eelis Lynne
| [https://marketplace.visualstudio.com/items?itemName=billw2011.sqf-debugger SQF Debugger] || billw2011 || Debug sqf scripts (callstack, variables, breakpoints, ...)
| Shortcut to go to the Biki page of the selected command/function.
|}
|}


= Tasks =
 
== Tasks ==
 
To add tasks to your project follow these steps:
To add tasks to your project follow these steps:
# Open the folder you are working in with VSCode
# Open the folder you are working in with VSCode
# Create a new directory at the root of it called {{ic|.vscode}}
# Create a new directory at the root of it called {{hl|.vscode}}
# Create a file called {{ic|tasks.json}} inside of that direcotry
# Create a file called {{hl|tasks.json}} inside of that directory
# Add the following content to it:
# Add the following content to it: <syntaxhighlight lang="cpp">
<syntaxhighlight lang=json>
{
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// See https://go.microsoft.com/fwlink/?LinkId=733558
Line 35: Line 49:
}
}
</syntaxhighlight>
</syntaxhighlight>
The following snippets will be listed under the {{ic|"tasks"}} tag. Tasks are seperated by a comma.


== Start Arma 3 (Mission Editing) ==
The following snippets will be listed under the {{hl|"tasks"}} tag. Tasks are separated by a comma.
This task launches Arma 3 and opens a mission that is located inside of your working folder directly in Eden.
 
<syntaxhighlight lang=json>
=== Start {{arma3}} (Mission Editing) ===
 
This task launches {{arma3}} and opens a mission that is located inside of your working folder directly in Eden.
<syntaxhighlight lang="cpp">
{
{
"label": "Start Arma 3 (Mission Editing)",
"label": "Start Arma 3 (Mission Editing)",
Line 49: Line 65:
"args": [
"args": [
"${workspaceFolder}\\mission.sqm", // Loads directly into editor if you have a mission folder open in VSCode
"${workspaceFolder}\\mission.sqm", // Loads directly into editor if you have a mission folder open in VSCode
"-mod=!Workshop\\@CBA_A3;!Workshop\\@My Other Mod", // Add mods seperated by ";", absolute paths work as well
"-mod=!Workshop\\@CBA_A3;!Workshop\\@My Other Mod", // Add mods separated by ";", absolute paths work as well
"-debug",
"-debug",
"-skipIntro",
"-skipIntro",
Line 64: Line 80:
</syntaxhighlight>
</syntaxhighlight>


== Stop Arma 3 ==
=== Stop {{arma3}} ===
''Immediatly'' closes Arma 3. Closing the game via the X button or Alt+F4 would normally take some time. The name of the exe you are using can be found like this:
 
''Immediately'' closes {{arma3}}. Closing the game via the X button or {{Controls|Alt|F4}} would normally take some time. The name of the exe you are using can be found like this:
# Open task manager
# Open task manager
# Select the "Processes" tab
# Select the "Processes" tab
# Find Arma 3
# Find {{arma3}}
# Expand the entry
# Expand the entry
# Right click on the first sub entry
# Right click on the first sub-entry
# Select "Go to details"
# Select "Go to details"
# The "Name" column (by default the first one) contains the exe name
# The "Name" column (by default the first one) contains the exe name
<syntaxhighlight lang=json>
<syntaxhighlight lang="cpp">
{
{
"label": "Stop Arma 3 Diag",
"label": "Stop Arma 3 Diag",
Line 87: Line 104:
</syntaxhighlight>
</syntaxhighlight>


== Track RPT ==
=== Track RPT ===
Changes to the [[RPT]] will be written to the Terminal window. You might need to adjust the path {{ic|$env:USERPROFILE\\AppData\\Local\\Arma` 3}} to your needs if you are using the [[Arma_3:_Startup_Parameters#-profiles|-profiles startup parameter]].
 
<syntaxhighlight lang=json>
Changes to the [[Crash Files|RPT files]] will be written to the Terminal window.
You might need to adjust the path {{hl|$env:USERPROFILE\\AppData\\Local\\Arma` 3}} ({{hl|`}} is required before a space) to your needs if you are using the {{Link|Arma 3: Startup Parameters#-profiles|-profiles startup parameter}}.
<syntaxhighlight lang="json">
{
{
"label": "RPT Watcher",
"label": "RPT Watcher",
"type": "shell",
"type": "shell",
"command": "powershell -command \"Get-ChildItem -Path $env:USERPROFILE\\AppData\\Local\\Arma` 3 -Filter *.rpt | Sort-Object LastAccessTime -Descending | Select-Object -First 1 | Get-Content -Tail 1 -Wait -Encoding utf8\"",
"command": "powershell",
"args": [
"-command",
"Get-ChildItem -Path $env:USERPROFILE\\AppData\\Local\\Arma` 3 -Filter *.rpt | Sort-Object LastAccessTime -Descending | Select-Object -First 1 | Get-Content -Tail 1 -Wait -Encoding utf8"
],
"problemMatcher": []
"problemMatcher": []
}
}
</syntaxhighlight>
</syntaxhighlight>


[[Category:Arma_3:_Editing]] [[Category:Arma_3:_Tutorials]] [[Category:Mission_Editing]] [[Category:Community_Tools]]
 
{{GameCategory|arma3|Editing}}
{{GameCategory|arma3|Tutorials}}
[[Category:Community Tools]]

Latest revision as of 23:48, 11 September 2024

This page contains information about Microsoft's Visual Studio Code editor and how it can be used for content creation in Arma.


Extensions

The following is a list of recommended extensions. Note that it might be incomplete or out of date.
Search "SQF" on the marketplace to find new or better extensions in that case.

Extension Author Remark
SQF Language Armitxes Syntax highlighter.
SQF-VM Language Server X39 et al. Language server for sqf (checks code for errors).
SQF Debugger billw2011 Debug sqf scripts (callstack, variables, breakpoints, ...)
SQF Wiki Eelis Lynne Shortcut to go to the Biki page of the selected command/function.


Tasks

To add tasks to your project follow these steps:

  1. Open the folder you are working in with VSCode
  2. Create a new directory at the root of it called .vscode
  3. Create a file called tasks.json inside of that directory
  4. Add the following content to it:
    {
    	// See https://go.microsoft.com/fwlink/?LinkId=733558
    	// for the documentation about the tasks.json format
    	"version": "2.0.0",
    	"tasks": [
    		// -> Tasks go here <-
    	]
    }
    

The following snippets will be listed under the "tasks" tag. Tasks are separated by a comma.

Start Arma 3 (Mission Editing)

This task launches Arma 3 and opens a mission that is located inside of your working folder directly in Eden.

{
	"label": "Start Arma 3 (Mission Editing)",
	"type": "process",
	"options": {
		"cwd": "C:\\Program Files (x86)\\Steam\\steamapps\\common\\Arma 3" // Change to your Arma 3 installation path
	},
	"command": "arma3_x64", // Also possible, if available: arma3profiling_x64, arma3diag_x64
	"args": [
		"${workspaceFolder}\\mission.sqm", // Loads directly into editor if you have a mission folder open in VSCode
		"-mod=!Workshop\\@CBA_A3;!Workshop\\@My Other Mod", // Add mods separated by ";", absolute paths work as well
		"-debug",
		"-skipIntro",
		"-filePatching",
		"-noSplash",
		"-showScriptErrors"
	],
	// Enable launching via shortcut "Tasks: Run Test Task"
	"group": {
		"kind": "test",
		"isDefault": true
	}
}

Stop Arma 3

Immediately closes Arma 3. Closing the game via the X button or Alt + F4 would normally take some time. The name of the exe you are using can be found like this:

  1. Open task manager
  2. Select the "Processes" tab
  3. Find Arma 3
  4. Expand the entry
  5. Right click on the first sub-entry
  6. Select "Go to details"
  7. The "Name" column (by default the first one) contains the exe name
{
	"label": "Stop Arma 3 Diag",
	"type": "shell",
	"command": "taskkill",
	"args": [
		"/F",
		"/IM",
		"arma3_x64.exe" // Other values: arma3diag_x64.exe, arma3profiling_x64.exe
	],
	"problemMatcher": []
}

Track RPT

Changes to the RPT files will be written to the Terminal window. You might need to adjust the path $env:USERPROFILE\\AppData\\Local\\Arma` 3 (` is required before a space) to your needs if you are using the -profiles startup parameter.

{
	"label": "RPT Watcher",
	"type": "shell",
	"command": "powershell",
	"args": [
		"-command",
		"Get-ChildItem -Path $env:USERPROFILE\\AppData\\Local\\Arma` 3 -Filter *.rpt | Sort-Object LastAccessTime -Descending | Select-Object -First 1 | Get-Content -Tail 1 -Wait -Encoding utf8"
	],
	"problemMatcher": []
}