# The global configuration file, accessible through
# Tools->LSP Client->Global Configuration, defines default values for various
# configuration options.
#
# When accessing the user configuration file using
# Tools->LSP Client->User Configuration, a copy of the global configuration file
# is created in user's configuration directory in which users can override
# various settings from the global configuration file.
#
# In addition, it is possible to create a project-wide configuration file used
# for a single project or shared by multiple projects whose path can be
# specified under Project->Properties->LSP Client->Configuration file. When such
# a file is defined and the project is configured to use the project
# configuration, this configuration file overrides the global configuration
# instead of the user configuration file.
#
# Each configuration file may contain the [all] section which contains settings
# common for all language servers, and several filetype-specific sections
# containing settings specific for the given filetype. The names of these
# sections are identical to the names defined in
# Tools->Configuration Files->filetype_extensions.conf; for instance [Python]
# for the Python programming language (case sensitive). Most of the options can
# appear both in the [all] section and the filetype-specific sections except for
# a few that make only sense in the filetype-specific section, like e.g. the
# 'cmd' option containing the command that starts the server. Any option defined
# in the filetype-specific section overrides identically named option defined in
# the [all] section for that particular language server.
#
# Not all LSP features are supported by all LSP servers. To learn more about
# what features are supported by the particular server you are trying to use,
# you can check the result of the initial client-server handshake by going to
# Tools->LSP Client->Server Initialize Responses (the server must be running
# to see any result).
#
# All servers are automatically restarted when any of the configuration files
# changes. Servers are started lazily after a tab is switched to a document for
# which a server is configured (this means that restart typically means shutdown
# of all servers after which they are started as needed).


[all]
# Defines whether the plugin should be enabled automatically for new or existing
# projects (that have not yet been configured to use LSP). This option
# is only valid in the [all] section
enable_by_default=false
# Defines whether the server should be used when no project is open. Servers
# may not work correctly without a project because most of them need to know
# the path to the project directory which corresponds to the path defined under
# Project->Properties->Base path. This option can be partially overridden
# by project_root_marker_patterns, see below
use_without_project=false
# Defines whether the server should be used for files whose path is not within
# the project directory. This option can be partially overridden by
# project_root_marker_patterns, see below
use_outside_project_dir=false
# A semicolon-separated list of glob patterns of files that are typically stored
# inside the root directory of the project. Language servers supporting
# changeNotifications of workspaceFolders (these two values should appear inside
# the server initialize response) can use these marker files to detect root
# project directories of open files. Starting from the open file directory,
# the plugin goes up in the directory structure and tests whether a file
# matching project_root_marker_patterns exists - if it does, such a directory
# is considered to be the root directory of the project. This allows to
# detect projects without any Geany project open and allows the plugin to work
# on multiple projects simultaneously. Typically, the pattern contains
# files/directories such as .git, configure.ac, go.mod, etc. If a pattern is
# found, use_without_project and use_outside_project_dir are ignored
project_root_marker_patterns=
# In additon to standard identifier characters a-zA-Z0-9_, this configuration
# option allows adding extra characters that can appear inside identifiers.
# For instance $- will add '$' and '-' to the above set.
extra_identifier_characters=
# Some servers require that the initialization options configuration is sent
# using workspace/didChangeConfiguration instead of the initialize request.
# This option does this right after the initialize request completes.
send_did_change_configuration=false

# The number of keybindings that can be assigned to LSP code action commands.
# This option is valid only within the [all] section and changing the value
# requires either the plugin reload or Geany restart
command_keybinding_num=5
# When the keybinding Command 1 is invoked, it checks whether the
# command_1_regex matches any of the items from the Commands submenu of the
# context menu. The first matched entry is executed. For convenience, regex
# matches are case insensitive. Up to command_keybinding_num command keybindings
# can be specified this way
command_1_regex=
# Regex specifying which of the commands present in the context menu under the
# Commands submenu will be automatically performed on save. If multiple entries
# match, all of them will be performed. For convenience, regex matches are case
# insensitive
command_on_save_regex=

# When the filetype-specific 'rpc_log' settings is defined, this option
# specifies whether the log should contain all details including method
# parameters, or just the method name and type of the communication
rpc_log_full=false
# Show server's stderr in Geany's stderr (when started from terminal)
show_server_stderr=false
# Tracing level of the server (when supported). When enabled, tracing messages
# are logged into stdout. Valid values are 'off', 'messages', 'verbose'
trace_value=off
# Enables or disables telemetry notification logging to stdout
telemetry_notifications=false

# Whether LSP should be used for autocompletion
autocomplete_enable=true
# Servers return the label that can be shown in the autocompletion popup for
# individual autocompletion entries, or it is possible to use just the text that
# gets inserted when selecting the entry. See also autocomplete_use_snippets.
autocomplete_use_label=true
# Whether snippets should be shown in the autocompletion list. Snippet support
# is only partial so things may not work as expected. When snippets are enabled,
# it is recommended to use autocomplete_use_label=true, otherwise snippet
# tab stops and other snippet information is shown in the autocompletion popup.
autocomplete_use_snippets=false
# Maximum number of autocompletion entries shown in the popup window (including
# those that will only get visible after scrolling the contents)
autocomplete_window_max_entries=20
# Maximum number of autocompletion entries shown without scrolling (defining the
# actual height of the popup)
autocomplete_window_max_displayed=8
# The maximum width of the autocompletion popup in displayed characters
autocomplete_window_max_width=60
# Whether to automatically apply additional edits defined for the autocompletion
# entry. These are typically imports of the modules where the inserted symbol is
# defined
autocomplete_apply_additional_edits=false
# Semicolon separated list of character sequences which can trigger
# autocompletion. Normally, the server defines these but this option can be used
# to further restrict the list only to some sequences if the server-provided
# value does not work well (e.g. when server's trigger chars for autocompletion
# clash with signature trigger chars - Rust server for instance uses '(' for
# both and omitting '(' in autocomplete sequences shows signature instead)
autocomplete_trigger_sequences=
# Semicolon separated list of words that make the autocompletion popup hide.
# This is useful for instance for languages like Pascal that use keywords
# 'begin' and 'end' which are typically followed by a newline where typing enter
# after these words might select some unwanted word from the autocompletion list.
autocomplete_hide_after_words=
# Whether to perform autocompletion inside strings
autocomplete_in_strings=false
# Show documentation (if available) of selected item in autocompletion popup
# in Geany status bar
autocomplete_show_documentation=true

# Whether LSP should be used to display diagnostic messages. Typically these are
# compiler errors or warnings
diagnostics_enable=true
# Semicolon-separated glob patterns specifying files for which diagnostic
# messages are not shown. Useful when the server has a problem with some files
diagnostics_disable_for=
# For the statusbar issue number indicator, consider only issues of the
# configured severity or highler. Valid values are: 1 (error), 2 (warning),
# 3 (info), 4 (hint). E.g. setting this value to 2 will show issue number
# for errors and warnings only.
diagnostics_statusbar_severity=2
# Defines the style of error diagnostics - visual style such as underline, and
# its color. Empty value means that diagnostic messages of the given severity
# are not displayed.
# The first number is the "indicator index" of Scintilla - each style should
# have a unique value from 8 to 31. Can be changed when the value clashes with
# some other plugin.
# The remaining values correspond to
# SCI_INDICSETFORE; SCI_INDICSETALPHA; SCI_INDICSETOUTLINEALPHA; SCI_INDICSETSTYLE
# - see Scintilla documentation for more information
diagnostics_error_style=13;#ff3030;70;255;1
# Defines the style of warning diagnostics
diagnostics_warning_style=14;#ee00ee;70;255;1
# Defines the style of information diagnostics
diagnostics_info_style=15;#909090;70;255;14
# Defines the style of hint diagnostics
diagnostics_hint_style=16;#909090;70;255;14

# Whether LSP should be used to show a popup with details when hovering over
# symbols.
hover_enable=false
# Maximum number of lines of the popup window
hover_popup_max_lines=20
# Maximum number of paragraphs shown in the popup window
hover_popup_max_paragraphs=1000

# Whether LSP should be used to show function parameter signatures e.g. after
# typing '('
signature_enable=true

# Whether LSP should be used for going to symbol definition/declaration
goto_enable=true

# Whether LSP should be used for displaying symbols in the sidebar (in a tab
# separate from normal Geany symbols)
document_symbols_enable=true
# The label used for the LSP symbols tab. When left empty, the tab is not
# displayed. This option is only valid in the [all] section
document_symbols_tab_label=LSP Symbols

# Whether LSP should be used for highlighting semantic tokens in the editor,
# such as types. Most servers don't support this feature so disabled by default.
semantic_tokens_enable=false
# Always perform "full" semantic token request instead of using "delta"
# requests. Can be used when servers don't support delta tokens correctly
semantic_tokens_force_full=false
# Semicolon-separated list of semantic tokens that should be highlighted as
# types. For valid values, see
# https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_semanticTokens
semantic_tokens_types=type;class;enum;interface;struct
# When not empty, Scintilla indicators are used for highlighting semantic
# token types. See diagnostics_error_style for more details about the valid
# values. Note that because of Scintilla limitations, this value cannot be bold
#semantic_tokens_type_style=17;#00007f;255;255;17
semantic_tokens_type_style=
# When not using semantic_tokens_type_style, this indicates the index in the
# Scintilla lexer used for custom keywords. This feature is supported only by
# some lexers like C/C++ and derived lexers. When using this method, the
# value can be bold but all the occurrences of the given word in the document
# is highlighted regardless of the context in which it is used
semantic_tokens_lexer_kw_index=3

# Whether LSP should be used for highlighting all other uses of a variable under
# cursor.
highlighting_enable=true
# Indicator style used for highlighting - see diagnostics_error_style
highlighting_style=18;#b0b0b0;90;255;8

# Whether LSP should be used for "code lenses" showing commands available
# for the given line. After right-clicking the line with the code lens, these
# commands are available in the Commands submenu.
code_lens_enable=true
# Defines the foreground and the background color of the code lens indicator.
code_lens_style=#000000;#ffffa0

# JSON file containing formatting options defined in
# https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#formattingOptions
# e.g. { "tabSize": 4, "insertSpaces": false }. Supported only by some language
# servers.
#formatting_options_file=/home/some_user/my_formatting_config_file.json
formatting_options_file=
# Like above but with the JSON placed directly into the value. When both
# formatting_options_file and formatting_options are specified, the JSON from
# formatting_options_file is used
formatting_options={ "tabSize": 4, "insertSpaces": false }
# Defines whether the LSP code-formatting feature should be auto-performed
# on every save
format_on_save=false

# Show progress bar for work in progress server operations. Can be disabled
# when servers do not correctly terminate progress notifications.
progress_bar_enable=true

# Enable non-standard clangd extension allowing to swap between C/C++ headers
# and sources. Only usable for clangd, it does not work with other servers.
swap_header_source_enable=false


# This is a dummy language server configuration describing the available
# language-specific options. Most of the configuration options from the [all]
# section can be used here as well.
# For an extensive list of various servers and their configurations, check
# https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md
# While the configuration options names of neovim differ from Geany, the
# general concepts are similar and applicable here.
[DummyLanguage]
# The command (including parameters and possibly also the full path) used to
# start the LSP server. Instead of starting a new server, it is also possible to
# reuse other language's server using the 'use' option - see the C++
# configuration
cmd=srvcmd
# The server can be started with additional environment variables (such as foo
# with the value bar, and foo1 with the value bar1 like in the example below).
env=foo=bar;foo1=bar1
# File containing initialization options of the server. The server is
# automatically restarted when this file is modified from within Geany
initialization_options_file=/home/some_user/init_options.json
# Like above but with the JSON placed directly into the value. When both
# initialization_options_file and formatting_options are specified, the JSON
# from initialization_options_file is used
initialization_options={"compilationDatabasePath":  "/home/some_user/"}
# When defined, performs logging to the specified file where all RPC 
# communication between the client plugin and the server will be stored (can
# also be 'stdout' or 'stderr')
rpc_log=stdout
# Files and their mappings to LSP language IDs for which the server is used
# (in addition to the implicit mapping defined by the filetype name and the
# patterns assigned to this filetype in filetype_extensions.conf). The Nth
# item in the list is always the LSP language ID and the (N+1)th item is a glob
# pattern defining files for which the language ID is used
# To find supported language IDs consult the documentation of the respective
# LSP (or source code).
lang_id_mappings=dummylanguage;*.dummy


[C]
# By default, clangd expects compile_commands.json inside the 'build' directory
# of your project. You can create it using either 'meson setup build' if your
# project uses meson or e.g. using:
#     mkdir build; bear --output build/compile_commands.json -- make
# if your project uses some other build tool (you need to install the bear tool
# first). The compile_commands.json file has to be manually regenerated when
# the build is modified in any way, such as a file is added/removed.
cmd=clangd
swap_header_source_enable=true
autocomplete_in_strings=true
autocomplete_use_label=false
semantic_tokens_enable=true
#initialization_options={"compilationDatabasePath":  "/home/some_user/my_project/my_builddir"}
formatting_options={ "tabSize": 4, "insertSpaces": false }
command_1_regex=Apply fix:.*
#rpc_log=stdout
#rpc_log_full=true
#show_server_stderr=true


[C++]
# Don't start a new server but reuse the server defined for some other language
# instead (C server used for C++ in this case)
use=C


[CSS]
cmd=vscode-css-language-server --stdio
extra_identifier_characters=-
send_did_change_configuration=true
autocomplete_use_snippets=true
use_without_project=true
use_outside_project_dir=true
#rpc_log=stdout
#rpc_log_full=true
#show_server_stderr=true


[Dart]
cmd=dart language-server --protocol=lsp
# everything except ( which conflicts with signature help
autocomplete_trigger_sequences=.;=;$;";';{;/;:
semantic_tokens_enable=true
#rpc_log=stdout
#rpc_log_full=true
#show_server_stderr=true


[Go]
cmd=gopls
autocomplete_apply_additional_edits=true
lang_id_mappings=go.mod;go.mod;go.sum;go.sum;gotmpl;*tmpl
semantic_tokens_enable=true
semantic_tokens_type_style=17;#00007f;255;255;17
format_on_save=true
command_on_save_regex=Organize Imports
progress_bar_enable=false
#rpc_log=stdout
#rpc_log_full=true
#show_server_stderr=true


[HCL]
# For HCL/Terraform/OpenTofu LSP to work, first configure the corresponding filetype in Geany,
# see https://wiki.geany.org/config/hcl-terraform for details.
cmd=terraform-ls serve
semantic_tokens_enable=true
#rpc_log=stdout
#rpc_log_full=false
#show_server_stderr=true
# See https://github.com/hashicorp/terraform-ls/blob/main/docs/USAGE.md
lang_id_mappings=terraform;*.tf;terraform-vars;*.tfvars;terraform-stack;*.tfstack.hcl;terraform-deploy;*.tfdeploy.hcl


[Haskell]
cmd=haskell-language-server-wrapper --lsp
# Full semantic tokens work but are kind of useless as Scintilla already
# highlights types
semantic_tokens_enable=false
#semantic_tokens_force_full=true
#initialization_options={"plugin": {"semanticTokens": {"config": { }, "globalOn": true}}}
#semantic_tokens_type_style=17;#00007f;255;255;17
#rpc_log=stdout
#rpc_log_full=true
#show_server_stderr=true


[HTML]
cmd=vscode-html-language-server --stdio
extra_identifier_characters=&
send_did_change_configuration=true
autocomplete_use_snippets=true
use_without_project=true
use_outside_project_dir=true
#rpc_log=stdout
#rpc_log_full=true
#show_server_stderr=true


[Java]
cmd=jdtls
autocomplete_use_label=false
#semantic_tokens_enable=true
#rpc_log=stdout
#rpc_log_full=true
#show_server_stderr=true


[JSON]
cmd=vscode-json-languageserver --stdio
#initialization_options={"provideFormatter": true, "json": { "schemas": [ { "fileMatch": [ "*.json"], "url": "file:///home/parallels/schema.json"}]}}
send_did_change_configuration=true
autocomplete_use_snippets=true
use_without_project=true
use_outside_project_dir=true
#formatting_options={ "tabSize": 4, "insertSpaces": true }
#rpc_log=stdout
#rpc_log_full=true
#show_server_stderr=true


[LaTeX]
cmd=texlab
autocomplete_use_snippets=true
extra_identifier_characters=:
use_without_project=true
use_outside_project_dir=true
#rpc_log=stdout
#rpc_log_full=true
#show_server_stderr=true


[Lua]
cmd=lua-language-server
autocomplete_use_label=false
autocomplete_hide_after_words=do;then;true;false;end;else
use_outside_project_dir=true
use_without_project=true
#rpc_log=stdout
#rpc_log_full=true
#show_server_stderr=true


[Nix]
cmd=nil
use_without_project=true
use_outside_project_dir=true
extra_identifier_characters=-'
#rpc_log=stdout
#rpc_log_full=true
#show_server_stderr=true


[PHP]
# Note: Server returns highlighting indices off by 1 and highlighting doesn't work
cmd=phpactor.phar language-server
autocomplete_trigger_sequences=:;>;$;[;@;';\;\\
extra_identifier_characters=$
#rpc_log=stdout
#rpc_log_full=true
#show_server_stderr=true


[Python]
# pip install pyright (or: pipx install pyright)
cmd=pyright-langserver --stdio
cmd=pyright-langserver --stdio
# alternatively pylsp, jedi, ruff
#cmd=pylsp
#cmd=jedi-language-server
#cmd=ruff server
use_outside_project_dir=true
use_without_project=true
#rpc_log=stdout
#rpc_log_full=true
#show_server_stderr=true


[Ruby]
cmd=solargraph stdio
#rpc_log=stdout
#rpc_log_full=true
#show_server_stderr=true


[Rust]
cmd=rust-analyzer
semantic_tokens_enable=true
autocomplete_trigger_sequences=:;.;'
#rpc_log=stdout
#rpc_log_full=true
#show_server_stderr=true


[Sh]
cmd=bash-language-server start
autocomplete_use_snippets=true
use_outside_project_dir=true
use_without_project=true
#rpc_log=stdout
#rpc_log_full=true
#show_server_stderr=true


[TypeScript]
cmd=typescript-language-server --stdio
semantic_tokens_enable=true
use_outside_project_dir=true
use_without_project=true
#rpc_log=stdout
#rpc_log_full=true
#show_server_stderr=true


[Javascript]
use=TypeScript


[XML]
cmd=lemminx
autocomplete_use_snippets=true
diagnostics_statusbar_severity=4
use_without_project=true
use_outside_project_dir=true
autocomplete_in_strings=true
# see https://github.com/eclipse/lemminx/blob/main/docs/Configuration.md
#initialization_options_file=/home/some_user/init_options.json
#formatting_options={ "tabSize": 4, "insertSpaces": true }
#rpc_log=stdout
#rpc_log_full=true
#show_server_stderr=true


[YAML]
cmd=yaml-language-server --stdio
#initialization_options={"yaml": {"schemas": { "/home/parallels/schema.json": "*"}}}
use_without_project=true
use_outside_project_dir=true
#formatting_options={ "tabSize": 4, "insertSpaces": true }
#rpc_log=stdout
#rpc_log_full=true
#show_server_stderr=true


[Zig]
cmd=zls
semantic_tokens_enable=true
#autocomplete_use_snippets=true
#rpc_log=stdout
#rpc_log_full=true
#show_server_stderr=true


# TODO: help needed! Only the above defined language servers have been tested
# (lightly). If you know some other working language server or find a problem
# with the settings above, please open an issue report or a pull request
# on Github.
