Skip to content

Commit

Permalink
Sync to latest version from geany-lsp
Browse files Browse the repository at this point in the history
  • Loading branch information
techee committed Nov 27, 2024
1 parent 7b745c1 commit cbb4bf8
Show file tree
Hide file tree
Showing 17 changed files with 1,184 additions and 284 deletions.
22 changes: 21 additions & 1 deletion lsp/README
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@ When you click on a symbol in the document, this feature highlights all its
occurrences in the document. You can customize the highlighting style to your
preference by configuring it in the configuration file.

Smart selection expanding/shrinking
-----------------------------------

This feature allows to expand the current text selection to contain the next
upper syntactic element such as a parent block in programming languages or a
parent tag in XML. Selection shrinking works in the opposite direction.

Document symbol renaming
------------------------

Expand All @@ -224,7 +231,20 @@ servers may not be completely reliable when performing the rename so be very
cautious when using it. The plugin does not perform any additional
checks and does not show any preview of the changes so it is best to use this
feature only after committing all modified files so you can
easily revert to a working state if needed.
easily revert to a working state if needed. Since this is potentially a
dangerous operation, to prevent accidental renames, the "Rename" button in the
dialog is not selected by defalut and simply pressing enter just cancels the
dialog.

Limitations
===========

By design, the plugin communicates over stdin/stdout only, is responsible
for launching and terminating the language server process, and supports only
a single language server per file type.

All of these limitations are addressed by the LSP proxy project available at
https://github.com/techee/lsp-proxy and related issues should be directed there.

License
=======
Expand Down
62 changes: 60 additions & 2 deletions lsp/data/lsp.conf
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ autocomplete_trigger_sequences=
# '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
Expand Down Expand Up @@ -237,12 +242,16 @@ format_on_save=false
# 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/server_configurations.md
# 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]
Expand Down Expand Up @@ -281,6 +290,8 @@ lang_id_mappings=dummylanguage;*.dummy
# 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"}
Expand All @@ -297,6 +308,28 @@ command_1_regex=Apply fix:.*
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
Expand Down Expand Up @@ -324,6 +357,18 @@ semantic_tokens_enable=false
#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
Expand Down Expand Up @@ -391,8 +436,11 @@ extra_identifier_characters=$
[Python]
# pip install pyright (or: pipx install pyright)
cmd=pyright-langserver --stdio
# alternatively pylsp
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
Expand Down Expand Up @@ -446,6 +494,7 @@ 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 }
Expand All @@ -465,6 +514,15 @@ use_outside_project_dir=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
Expand Down
2 changes: 2 additions & 0 deletions lsp/src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ lsp_la_SOURCES = \
lsp-rpc.h \
lsp-semtokens.c \
lsp-semtokens.h \
lsp-selection-range.c \
lsp-selection-range.h \
lsp-server.c \
lsp-server.h \
lsp-signature.c \
Expand Down
Loading

0 comments on commit cbb4bf8

Please sign in to comment.