Skip to content

Settings

Charles edited this page Oct 15, 2021 · 8 revisions

Extension's settings

Sourcemod Home

This is the path to the SourceMod include's folder. It should be set properly for the extension to work correctly.

It can be automatically completed for you when you start the extension for the first time, but it is recommended that you download the latest SourceMod includes from here and configure this setting accordingly.

A working example would be C:\Users\Sarrus\Dev\sourcemod\scripting\include

Default

"sourcepawn.SourcemodHome": ""

SPComp Path

This is the path to spcomp.exe. This is required for the extension to work properly.

It can be automatically completed for you when you start the extension for the first time, but it is recommended that you download the latest SourceMod files from here and configure this setting accordingly.

A working example would be C:\Users\Sarrus\Dev\sourcemod\scripting\spcomp.exe

Default

"sourcepawn.SpcompPath": ""

Main Path

This settings points to the entry-point for the compiler to your plugin. It is required if you are working on a project that has multiple .sp files.

To configure this properly, it is recommended that you right click on your main file, and click on SM Set Current File as Main.

Default

"sourcepawn.MainPath": ""

Author's Name

This is the plugin's author's name. When set, it will be inserted automatically when you generate a new project.

Default

"sourcepawn.AuthorName": ""

Github Name

This is the plugin's author's GitHub username. When set, it will be inserted automatically in the Readme of your project.

Default

"sourcepawn.GithubName": ""

Main Path Compilation

This setting controls whether the extension will always try to compile the MainPath file or the current active file in the text editor.

  • When set to true, the main.sp file will be compiled if it exists, otherwise the current active file will be compiled.
  • When set to false, the current active file will always be compiled.

Default

"sourcepawn.MainPathCompilation": true

Show Compile Icon In Editor Title Menu

This setting hides or shows the green ▶️ icon in the editor's menu.

  • When set to true, the icon will appear.
  • When set to false, it won't.

Default

"sourcepawn.showCompileIconInEditorTitleMenu": true

Upload Options

This setting contains the parameters for the upload feature of the extension. You can find the full documentation of those options here. Regarding the path patterns (include and exclude), they are an array of glob patterns relative to your workspace. See here for an example of how they work. The include array will compute all paths matching the glob patterns given and include them in the upload. The exclude array will do the same but exclude the matching paths.

  • deleteRemote will delete ALL existing files at destination before uploading, if true.
  • forcePasv toggles forced Passive mode (EPSV command is not sent). When true, it's a blank run, the files won't actually be transferred.

IMPORTANT

  • Make sure to not leave your password in plain text for long.
  • If you are using workspace settings (which you should for this), add .vscode/settings.json to your .gitignore or your password might be made public!

Default

"sourcepawn.UploadOptions": {
		"user": "",
		"password": "",
		"host": "",
		"port": 21,
		"localRoot": "",
		"remoteRoot": "/public_html/remote-folder/",
		"include": [
			"**"
		],
		"exclude": [
			"scripting/**/",
			".vscode/**/",
			".github/**/",
			".gitignore",
			"*.md",
			".git"
		],
		"deleteRemote": false,
		"forcePasv": true,
		"sftp": false
	}

Upload After Successful Compile

This setting controls whether the command SM Upload to Server should be run once the plugin has been successfuly compiled.

  • When set to true, SM Upload to Server will be run automatically.
  • When set to false, it won't.

Default

"sourcepawn.uploadAfterSuccessfulCompile": false

Source Server Options

This setting contains the parameters for the rcon feature of the extension. You can find the full documentation of those options here.

IMPORTANT

  • Make sure to not leave your password in plain text for long.
  • If you are using workspace settings (which you should for this), add .vscode/settings.json to your .gitignore or your password might be made public!

Default

"sourcepawn.SourceServerOptions": {
		"host": "",
		"port": 27015,
		"encoding": "ascii",
		"timeout": 1000,
		"password": ""
}

Refresh After Successful Upload

This setting controls whether the command sm plugins refresh should be run on the remote server once an FTP/SFTP upload has been successfully executed.

  • When set to true, sm plugins refresh will be run automatically.
  • When set to false, it won't.

Default

"sourcepawn.refreshAfterSuccessfulUpload": false

Enable Linter

This setting controls whether the to enable the linter or not.

  • When set to true, the linter is enabled.
  • When set to false, the linter is disabled.

Source

"sourcepawn.enableLinter": true

Optional Include Directories Paths

This setting adds a list of include directories to the extension.

It can be used when you have a special file structure and need to point the extension to the correct include folder, or if you are using multiple include folders.

A working example would be:

"sourcepawn.optionalIncludeDirsPaths": [
	"C:/Users/Sarrus/Dev/sourcemod2/scripting/include",
	"C:/Users/Sarrus/Dev/sourcemod3/scripting/include",
	"C:/Users/Sarrus/Dev/sourcemod4/scripting/include"
]

Default

"sourcepawn.optionalIncludeDirsPaths": []

Compiler's Options

This setting controls the SourcePawn's compiler options. You can find a list of those options here.

IMPORTANT Don't add hardcoded paths here.

A working example would be:

"sourcepawn.compilerOptions": [
	"-O2",
	"-v2",
	"-E"
	],

Default

"sourcepawn.compilerOptions": [
	"-O2",
	"-v2"
	],

Linter Compiler's Options

This setting controls the SourcePawn's compiler options for the linter. You can find a list of those options here.

IMPORTANT Don't add hardcoded paths here.

A working example would be:

"sourcepawn.linterCompilerOptions": [
	"-O2",
	"-v2",
	"-E"
	],

Default

"sourcepawn.linterCompilerOptions": []

Output Directory's Path

This settings is the path to the desired output directory of the compiled plugin. If blank, the compiled plugin will be outputed in a compiled folder at the same level of the parent directory of the entry-point of the plugin.

IMPORTANT This should end with a /.

Source

"sourcepawn.outputDirectoryPath": ""

Formatter's Settings

This setting controls the behaviour of the formatter. The formatter used by the extension is Clang Format, so you can use any settings you wish that is supported by Clang Format. You can test those settings here.

Keep in mind that Clang Format is not made for the SourcePawn syntax but for C and C++, therefore, some things are hardcoded in the extension to emulate SourcePawn support. Check This function for a list of all the hardcoded formatting.

Note You can use ${UseTab} and ${TabSize} in this config to sync the tab size and the use of tabs with your VSCode configuration.

Source

"sourcepawn.formatterSettings": [
		"AlignOperands: 'true'",
		"AlignTrailingComments: 'true'",
		"AllowAllArgumentsOnNextLine: 'false'",
		"AllowAllConstructorInitializersOnNextLine: 'false'",
		"AllowAllParametersOfDeclarationOnNextLine: 'false'",
		"AllowShortBlocksOnASingleLine: 'true'",
		"AllowShortCaseLabelsOnASingleLine: 'true'",
		"AlwaysBreakAfterDefinitionReturnType: None",
		"AlwaysBreakAfterReturnType: None",
		"AlwaysBreakBeforeMultilineStrings: 'false'",
		"BinPackArguments: 'false'",
		"BinPackParameters: 'false'",
		"BreakBeforeBraces: Allman",
		"BreakBeforeTernaryOperators: 'false'",
		"BreakStringLiterals: 'false'",
		"ColumnLimit: '0'",
		"ContinuationIndentWidth: '2'",
		"IndentWidth: '${TabSize}'",
		"MaxEmptyLinesToKeep: '2'",
		"MaxEmptyLinesToKeep: '2'",
		"SpaceAfterLogicalNot: 'false'",
		"SpaceBeforeParens: Never",
		"SpaceBeforeRangeBasedForLoopColon: 'false'",
		"SpaceInEmptyParentheses: 'false'",
		"TabWidth: '2'",
		"UseTab: '${UseTab}'"
	]

trace.server

Toggle on or off the debugging messages of the extension.

Source

"sourcepawn.trace.server": "off"