-
-
Notifications
You must be signed in to change notification settings - Fork 23
Settings
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
"sourcepawn.SourcemodHome": ""
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
"sourcepawn.SpcompPath": ""
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
.
"sourcepawn.MainPath": ""
This is the plugin's author's name. When set, it will be inserted automatically when you generate a new project.
"sourcepawn.AuthorName": ""
This is the plugin's author's GitHub username. When set, it will be inserted automatically in the Readme of your project.
"sourcepawn.GithubName": ""
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.
"sourcepawn.MainPathCompilation": true
This setting hides or shows the green
- When set to true, the icon will appear.
- When set to false, it won't.
"sourcepawn.showCompileIconInEditorTitleMenu": true
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!
"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
}
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.
"sourcepawn.uploadAfterSuccessfulCompile": false
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!
"sourcepawn.SourceServerOptions": {
"host": "",
"port": 27015,
"encoding": "ascii",
"timeout": 1000,
"password": ""
}
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.
"sourcepawn.refreshAfterSuccessfulUpload": false
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.
"sourcepawn.enableLinter": true
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"
]
"sourcepawn.optionalIncludeDirsPaths": []
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"
],
"sourcepawn.compilerOptions": [
"-O2",
"-v2"
],
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"
],
"sourcepawn.linterCompilerOptions": []
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 /
.
"sourcepawn.outputDirectoryPath": ""
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.
"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}'"
]
Toggle on or off the debugging messages of the extension.
"sourcepawn.trace.server": "off"