Skip to main content

Configuration

Pike LSP can be configured through VS Code settings to customize its behavior for your workflow.

VS Code Settings

Open VS Code settings (Ctrl+,) and search for "Pike" to find all available options.

Core Settings

SettingTypeDefaultDescription
pike.pikePathstring"pike"Path to the Pike executable
pike.trace.serverstring"off"LSP trace level: "off", "messages", or "verbose"
pike.enablebooleantrueEnable/disable the LSP server

Formatting Profiles

Pike LSP supports configurable formatting profiles to match your coding style preferences:

ProfileDescription
pike.formatting.profileSelect a predefined profile: compact, standard, relaxed, allman, or custom
pike.formatting.maxLineLengthMaximum line length: 0 (disabled), 80, 100, or 120
pike.formatting.braceStyleBrace placement: same-line (K&R) or new-line (Allman)
pike.formatting.spaceAroundOperatorsInsert spaces around operators (e.g., a + b vs a+b)
pike.formatting.blankLinesBetweenFunctionsNumber of blank lines between top-level functions

Predefined Profiles

ProfileLine LengthBrace StyleOperatorsDescription
compact80 charsK&RSpacedCompact style for smaller screens
standard100 charsK&RSpacedBalanced default profile
relaxed120 charsK&RSpacedRelaxed style for wide displays
allman100 charsAllmanSpacedAllman brace style
customUser-definedUser-definedUser-definedUse individual settings

Example Configuration

{
"pike.pikePath": "/usr/local/bin/pike",
"pike.trace.server": "off",
"pike.formatting.profile": "standard",
"pike.formatting.maxLineLength": 100,
"pike.formatting.braceStyle": "same-line",
"pike.formatting.spaceAroundOperators": true,
"pike.formatting.blankLinesBetweenFunctions": 1
}

K&R vs Allman Brace Style

K&R Style (same-line):

void foo() {
if (x > 0) {
return x;
}
}

Allman Style (new-line):

void foo()
{
if (x > 0)
{
return x;
}
}

File Associations

By default, Pike LSP activates for .pike and .pmod files. To enable it for additional file types:

{
"files.associations": {
"*.rjs": "pike",
"*.inc": "pike",
"*.pike.in": "pike"
}
}

Environment Variables

Pike LSP respects the following environment variables:

VariableDescription
PIKE_PATHPike module search path
PIKE_INCLUDE_PATHPike include path
PIKE_MODULE_PATHPike module path
PIKE_SRCPike source directory (for development)
ROXEN_SRCRoxen source directory (for development)

Pike Path Resolution

Pike LSP uses the following order to find the Pike executable:

  1. pike.pikePath setting (if configured)
  2. PIKE_PATH environment variable
  3. System PATH

Troubleshooting Configuration

Verify Pike Path

which pike
# or
whereis pike

Test Pike Execution

pike --version

Enable Verbose Logging

For debugging issues:

{
"pike.trace.server": "verbose"
}

View logs in VS Code: Output panel → Select "Pike Language Server" from dropdown

Workspace-Specific Configuration

You can configure Pike LSP per workspace by creating .vscode/settings.json:

{
"pike.pikePath": "/path/to/project-specific/pike",
"files.associations": {
"*.module": "pike"
}
}

Roxen Configuration

For Roxen module development, additional settings may be needed:

{
"pike.roxenPath": "/path/to/roxen",
"files.associations": {
"*.rjs": "pike"
}
}

Keyboard Shortcuts

Default VS Code shortcuts for LSP features:

FeatureShortcut
Go to DefinitionF12
Find ReferencesShift+F12
Rename SymbolF2
Trigger CompletionCtrl+Space
Signature HelpCtrl+Shift+Space
Go to SymbolCtrl+Shift+O
Workspace SymbolCtrl+T
Show HoverCtrl+K Ctrl+I
Code ActionsCtrl+.
Format DocumentShift+Alt+F

You can customize these in VS Code Keyboard Shortcuts settings.