### Install and Install Git Hook for Pre-commit Source: https://github.com/sublimelsp/lsp/blob/main/CONTRIBUTING.md One-time setup to install the pre-commit tool and its git hook for automated linting and type-checking before commits. ```sh # Install pre-commit (uv, pipx, or pip) uv tool install pre-commit # Install the git hook pre-commit install ``` -------------------------------- ### Install F# Language Server (FsAutoComplete) Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Install FsAutoComplete globally using the .NET CLI. Ensure the .NET SDK is installed and the tools directory is on your PATH. ```bash dotnet tool install --global fsautocomplete ``` -------------------------------- ### Consolidate Server Setup: After Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/migrating_to_lsp_plugin.md Demonstrates the consolidated server setup using the on_pre_start_async hook. ```python from LSP.plugin import OnPreStartContext from LSP.plugin import PluginStartError @classmethod def on_pre_start_async(cls, context: OnPreStartContext) -> None: if not server_binary().exists(): download_server(server_binary()) if not server_binary().exists(): raise PluginStartError("Server binary missing after installation attempt") context.configuration.command = [str(server_binary()), "--stdio"] context.working_directory = context.workspace_folders[0].path if context.workspace_folders else None context.variables["server_version"] = SERVER_VERSION ``` -------------------------------- ### Consolidate Server Setup: Before Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/migrating_to_lsp_plugin.md Presents the multiple methods previously used for server setup and configuration. ```python @classmethod def needs_update_or_installation(cls) -> bool: return not server_binary().exists() @classmethod def install_or_update(cls) -> None: download_server(server_binary()) @classmethod def can_start(cls, window, initiating_view, workspace_folders, configuration) -> str | None: if not server_binary().exists(): return "Server binary missing" return None @classmethod def on_pre_start(cls, window, initiating_view, workspace_folders, configuration) -> str | None: configuration.command = [str(server_binary()), "--stdio"] return str(workspace_folders[0].path) if workspace_folders else None @classmethod def additional_variables(cls) -> dict[str, str] | None: return {"server_version": SERVER_VERSION} ``` -------------------------------- ### Install Sorbet gem Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Install the sorbet and sorbet-runtime gems. If using a Gemfile, add them and run bundle install. ```sh gem install sorbet gem install sorbet-runtime ``` ```sh bundle install ``` -------------------------------- ### Install Stimulus Language Server Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Install the stimulus-language-server globally using npm. ```sh npm install -g stimulus-language-server ``` -------------------------------- ### One-time setup after initialization Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/migrating_to_lsp_plugin.md For one-time setup logic that was previously in `on_settings_changed`, use `on_initialized_async`. This method is called after the `initialized` notification is received. ```python # After — one-time setup def on_initialized_async(self) -> None: if session := self.weaksession(): session.config.settings.set('foo', 'bar') ``` -------------------------------- ### Install wikitext-lsp Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Install the wikitext-lsp package globally using npm. This command is used for the MediaWiki language server. ```sh npm install -g wikitext-lsp ``` -------------------------------- ### Install Zensical Source: https://github.com/sublimelsp/lsp/blob/main/docs/README.md Install the Zensical package using pip. ```sh pip install zensical ``` -------------------------------- ### Install asm-lsp using Cargo Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Use this command to install the asm-lsp language server implementation via Cargo. Ensure you have Rust and Cargo installed. ```sh cargo install asm-lsp ``` -------------------------------- ### Replace on_post_start with __init__ Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/migrating_to_lsp_plugin.md Migrate setup logic from `on_post_start` to the `__init__` method in LspPlugin. Ensure `super().__init__(weaksession)` is called first. ```python # Before @classmethod def on_post_start(cls, window, initiating_view, workspace_folders, configuration) -> None: log_start(window, configuration) ``` ```python # After def __init__(self, weaksession: ref[Session]) -> None: super().__init__(weaksession) if session := self.weaksession(): log_start(session.window, session.config) ``` -------------------------------- ### Configure Racket Language Server Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add this configuration to enable the Racket language server. Ensure the Racket package is installed for syntax highlighting. ```json { "racket-langserver": { "enabled": true, "command": ["racket", "-l", "racket-langserver"], "selector": "source.racket" } } ``` -------------------------------- ### Configure Fortran Language Server (fortls) Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Enable the fortls language server for Fortran development. Ensure the fortls executable is installed and accessible. ```json { "fortls": { "enabled": true, "command": ["fortls", "--notify_init"], "selector": "source.fortran | source.modern-fortran | source.fixedform-fortran" } } ``` -------------------------------- ### Install diagnostic-languageserver via NPM or Yarn Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Install the diagnostic-languageserver globally using either NPM or Yarn. This server provides language diagnostics for various languages. ```sh # with NPM npm i -g diagnostic-languageserver ``` ```sh # or with Yarn yarn global add diagnostic-languageserver ``` -------------------------------- ### Configure SystemVerilog Language Server (Verible) Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add this configuration to enable the Verible language server for SystemVerilog files. Ensure Verible is installed and its executable path is correctly specified. ```json { "verible": { "enabled": true, "command": [ "/PATH/TO/verible-verilog-ls" ], "selector": "source.systemverilog" } } ``` -------------------------------- ### Configure a Custom Language Server Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/client_configuration.md Example configuration for the 'phpactor' language server. Use this to enable a server, specify its command, and define the file types it should apply to. ```jsonc { "phpactor": { // enable this configuration "enabled": true, // the startup command -- what you would type in a terminal "command": ["PATH/TO/phpactor", "language-server"], // the selector that selects which type of buffers this language server attaches to "selector": "source.php" } } ``` -------------------------------- ### Configure D Language Server (serve-d) Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Configure serve-d for D language support. Update paths for the server and its components to match your installation. ```json { "serve-d": { "enabled": true, "command": ["C:/Users/MY_NAME_HERE/AppData/Roaming/code-d/bin/serve-d.exe"], "selector": "source.d", "settings": { "d.dcdServerPath": "C:/Users/MY_NAME_HERE/AppData/Roaming/code-d/bin/dcd-server.exe", "d.dcdClientPath": "C:/Users/MY_NAME_HERE/AppData/Roaming/code-d/bin/dcd-client.exe" } } } ``` -------------------------------- ### Mouse Binding for Goto Definition Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/keyboard_shortcuts.md Example of a mouse binding to trigger the 'Goto Definition' command using Ctrl+left click. This configuration is added to the user's mousemap file. ```jsonc [ { "button": "button1", "count": 1, "modifiers": ["ctrl"], "press_command": "drag_select", "command": "lsp_symbol_definition" } ] ``` -------------------------------- ### Configure quick-lint-js Language Server Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add this configuration to your LSP settings to enable the quick-lint-js language server for JavaScript files. Ensure the quick-lint-js LSP server is installed separately. ```jsonc { "quick-lint-js": { "command": ["quick-lint-js", "--lsp-server"], "enabled": true, "selector": "source.js" } } ``` -------------------------------- ### Configure Haskell Language Server Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add this configuration to enable the Haskell language server. Ensure haskell-language-server is installed. ```json { "haskell-language-server": { "enabled": true, "command": ["haskell-language-server-wrapper", "--lsp"], "selector": "source.haskell" } } ``` -------------------------------- ### Install JETLS Language Server for Julia Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Use this command to install or update the JETLS executable for Julia. This command requires Julia 1.12 or higher and ensures the JETLS app is available. ```sh julia -e 'using Pkg; Pkg.Apps.add(; url="https://github.com/aviatesk/JETLS.jl", rev="release")' ``` -------------------------------- ### Configure MediaWiki Language Server Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add the MediaWiki language server configuration to Sublime LSP. Ensure the command path points to your node executable and the globally installed wikitext-lsp. ```jsonc { "mediawiki": { "enabled": true, "command": [ "/path/to/your/node", "/path/to/your/globally/installed/wikitext-lsp", "--stdio" ], "selector": "text.html.mediawiki", "settings": { // Please refer to https://www.npmjs.com/package/wikitext-lsp#configuration } } } ``` -------------------------------- ### Configure Steep for Ruby Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add this configuration to enable Steep for Ruby static analysis. Ensure the steep gem is installed. ```json { "steep": { "enabled": true, "command": ["steep", "langserver"], "selector": "source.ruby" } } ``` -------------------------------- ### Configure Vala Language Server Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add the Vala language server configuration to your LSP settings. Ensure the command path points to your installed Vala language server executable. ```json { "vala-language-server": { "enabled": true, "command": [ "/path/to/vala-language-server" ], "selector": "source.vala | source.genie" } } ``` -------------------------------- ### Configure Kotlin Language Server Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add this configuration to 'Preferences > Package Settings > LSP > Server Configurations' to enable the Kotlin language server. Ensure the command path points to your installed server. ```json { "kotlinls": { "enabled": true, "command": ["PATH/TO/KotlinLanguageServer/build/install/kotlin-language-server/bin/kotlin-language-server.bat"], // Update the PATH "selector": "source.Kotlin", "settings": { "kotlin": { // put your server settings here } } } } ``` -------------------------------- ### Configure Stimulus LSP Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add this configuration to enable Stimulus LSP for Stimulus.js projects. Ensure the stimulus-language-server is installed globally. ```json { "stimulus": { "enabled": true, "command": ["stimulus-language-server", "--stdio"], "selector": "text.html.rails" } } ``` -------------------------------- ### Configure TOML Language Server (Tombi) Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add this configuration to enable the Tombi language server for TOML files. Ensure Tombi is installed and accessible via the command line. ```json { "tombi": { "enabled": true, "command": ["tombi", "lsp"], "selector": "source.toml" } } ``` -------------------------------- ### Configure Toit Language Server (Jaguar) Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add this configuration to enable the Jaguar language server for Toit files. Ensure Jaguar is installed and accessible via the command line. ```json { "jag": { "enabled": true, "command": ["jag", "lsp"], "selector": "source.toit" } } ``` -------------------------------- ### Configure Sorbet for Ruby Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add this configuration to enable Sorbet for Ruby static type checking. Ensure Sorbet is installed as a gem. ```json { "sorbet": { "enabled": true, "command": ["srb", "tc", "--typed", "true", "--enable-all-experimental-lsp-features", "--lsp", "--disable-watchman", "."], "selector": "source.ruby" } } ``` -------------------------------- ### Configure cc-lsp for Lisp Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add this configuration to enable cc-lsp for Lisp files. Ensure cc-lsp is installed via Roswell. ```json { "cc-lsp": { "enabled": true, "command": ["cl-lsp", "stdio"], "selector": "source.lisp" } } ``` -------------------------------- ### Custom Semantic Token Configuration Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/features.md Example of a server configuration file defining custom semantic token types and their fallback scopes. This allows for fine-grained control over highlighting for non-standard token types or disabling highlighting for specific types. ```json { "semantic_tokens": { "type.defaultLibrary": "storage.type.builtin", // override the fallback scope for `type` with modifier `defaultLibrary` "string": "", // disable semantic highlighting for the `string` token type "magicFunction": "support.function.builtin", // define fallback scope for a custom token type `magicFunction` } } ``` -------------------------------- ### Configure Digestif for LaTeX Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add this configuration to 'Preferences > Package Settings > LSP > Server Configurations' to enable the Digestif language server for LaTeX. It requires the Digestif server to be installed and available in your PATH. ```json { "digestif": { "enabled": true, "command": ["digestif"], "selector": "text.tex.latex" } } ``` -------------------------------- ### Configure Perl Navigator Language Server Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add this configuration to your LSP Server Configurations to enable the perlnavigator language server. Ensure the command path points to your globally installed perlnavigator and node executables. ```json { "perlnavigator": { "enabled": true, "command": [ "/path/to/your/node", "/path/to/your/globally/installed/perlnavigator", "--stdio" ], "selector": "source.perl", "settings": { // "perlnavigator.perltidyProfile": "~/.perltidyrc", // "perlnavigator.perlcriticProfile": "~/.perlcriticrc", // "perlnavigator.perlEnvAdd": true, // "perlnavigator.perlEnv": { // "KOHA_CONF": "/home/user/git/KohaCommunity/t/data/koha-conf.xml", // }, // "perlnavigator.perlPath": "~/perl5/perlbrew/perls/perl-5.38.2/bin", // "perlnavigator.perlcriticSeverity": 1, // "perlnavigator.perlcriticEnabled": true, // "perlnavigator.enableWarnings": true, "perlnavigator.includePaths": [ // Used for syntax checking, typically local project roots. // NOT used for finding installed modules such as perlcritic/perltidy/perlimports. // Supports "$workspaceFolder", no need to include "$workspaceFolder/lib/". ], "perlnavigator.perlParams": [ // This is a list of arguments always passed to Perl. // Does not support $workspaceFolder. // Useful for finding perlcritic/perltidy/perlimports. // "-I/path/to/local/perl5/bin" ] } } } ``` -------------------------------- ### Configure rumdl for Markdown Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add this configuration to enable rumdl as an LSP server for Markdown files. Follow rumdl's installation and LSP configuration guides. ```json { "rumdl": { "enabled": true, "command": ["rumdl", "server"], "selector": "text.html.markdown" } } ``` -------------------------------- ### Configure F# Language Server (FsAutoComplete) Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add the 'fsautocomplete' configuration to Sublime LSP. This includes enabling automatic workspace initialization. ```json { "fsautocomplete": { "enabled": true, "command": ["fsautocomplete"], "selector": "source.fsharp", "initialization_options": { "AutomaticWorkspaceInit": true } } } ``` -------------------------------- ### Configure Solargraph for Ruby Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add this configuration to enable Solargraph for Ruby development. Ensure Solargraph is installed. ```json { "ruby": { "enabled": true, "command": ["solargraph", "stdio"], "selector": "source.ruby", "initialization_options": { "diagnostics": true } } } ``` -------------------------------- ### Update Storage Path: After (using ST_STORAGE_PATH) Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/migrating_to_lsp_plugin.md Demonstrates using the ST_STORAGE_PATH constant and manually appending the package name. ```python from LSP.plugin import ST_STORAGE_PATH server_dir = os.path.join(ST_STORAGE_PATH, "LSP-foo", "server") ``` -------------------------------- ### Register/Unregister Plugin: Before Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/migrating_to_lsp_plugin.md Demonstrates the older method of importing and calling register_plugin and unregister_plugin. ```python from LSP.plugin import AbstractPlugin from LSP.plugin import register_plugin from LSP.plugin import unregister_plugin class LspFoo(AbstractPlugin): ... def plugin_loaded() -> None: register_plugin(LspFoo) def plugin_unloaded() -> None: unregister_plugin(LspFoo) ``` -------------------------------- ### Configure Solidity Language Server Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Enable and configure the Solidity language server by specifying its command and selector. ```json { "solidity": { "enabled": true, "command": ["nomicfoundation-solidity-language-server", "--stdio"], "selector": "source.solidity" } } ``` -------------------------------- ### Get Commit Log for Release Source: https://github.com/sublimelsp/lsp/blob/main/CONTRIBUTING.md Generate a log of commits made since the last released tag, formatted for release notes. ```sh git log --format="- %s (%an)" ..main ``` -------------------------------- ### Goto Implementation Command Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/keyboard_shortcuts.md Command to navigate to the implementation of a symbol. Currently unbound by default. ```json "lsp_symbol_implementation" ``` -------------------------------- ### Configure Phpactor Language Server Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add this JSON configuration to your LSP Server Configurations to enable Phpactor. Ensure Phpactor is installed globally. ```json { "phpactor": { "enabled": true, "command": ["PATH/TO/phpactor", "language-server"], "selector": "embedding.php", "priority_selector": "source.php" } } ``` -------------------------------- ### Configure Pyrefly Language Server Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add this JSON configuration to your LSP Server Configurations to enable Pyrefly. Ensure the pyrefly command-line tool is installed. ```json { "pyrefly": { "enabled": true, "command": ["pyrefly", "lsp"], "selector": "source.python" } } ``` -------------------------------- ### Configure PostgreSQL Language Server Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Enable and configure the PostgreSQL language server with its command and selector. ```json { "postgres-language-server": { "enabled": true, "command": ["/path/to/postgres-language-server", "lsp-proxy"], "selector": "source.sql.psql" } } ``` -------------------------------- ### Build New LSP Release Source: https://github.com/sublimelsp/lsp/wiki/How-to-maintain-LSP Use this script to build a new release, which creates a new commit and tag. Ensure you push both the changes and the tag afterwards. ```bash ./LSP/scripts/release.py build ``` -------------------------------- ### Configure Clojure LSP Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add this configuration to enable clojure-lsp. Ensure the command path points to your clojure-lsp executable. ```json { "clojure-lsp": { "enabled": true, "command": ["/PATH/TO/clojure-lsp"], // Update the PATH "selector": "source.clojure", "initialization_options": {} } } ``` -------------------------------- ### Configure Auto-Completion Selector for LaTeX Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Adjust Sublime's 'auto_complete_selector' setting to enable auto-completions for specific LaTeX elements. This example targets citations, references, and function parameters. ```json { "auto_complete_selector": "meta.tag, source - comment - string.quoted.double.block - string.quoted.single.block - string.unquoted.heredoc, text.tex constant.other.citation, text.tex constant.other.reference, text.tex support.function, text.tex variable.parameter.function", } ``` -------------------------------- ### Configure Reason Language Server Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add the Reason language server configuration to Sublime LSP. Update the PATH to the reason-language-server executable. ```jsonc { "reason": { "enabled": true, "command": ["PATH/TO/reason-language-server.exe"], // Update the PATH "selector": "source.ocaml | source.reason" } } ``` -------------------------------- ### Build New Release Version Source: https://github.com/sublimelsp/lsp/blob/main/CONTRIBUTING.md Run the release script to build a new version, bumping the version number and creating a commit with updated messages. ```sh ./scripts/release.py build ``` -------------------------------- ### Zensical Commands Source: https://github.com/sublimelsp/lsp/blob/main/docs/README.md Common Zensical commands for serving, building, and help. ```sh zensical serve - Start the live-reloading docs server. ``` ```sh zensical build - Build the documentation site. ``` ```sh zensical --help - Print help message and exit. ``` -------------------------------- ### Goto Definition Command Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/keyboard_shortcuts.md Command to navigate to the definition of a symbol. Suggested shortcut is F12. Currently unbound by default. ```json "lsp_symbol_definition" ``` -------------------------------- ### Toggle Inlay Hints Command with Enable Argument Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/keyboard_shortcuts.md Command to toggle inlay hints. Supports an optional 'enable' argument to explicitly turn them on or off. ```json "lsp_toggle_inlay_hints" ``` -------------------------------- ### Configure asm-lsp Server Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add this JSON configuration to your LSP server settings to enable and configure the 'asm-lsp' server. This specifies the command to run and the file types it should apply to. ```jsonc { "asm-lsp": { "enabled": true, "command": ["asm-lsp"], "selector": "source.asm | source.assembly" } } ``` -------------------------------- ### Register/Unregister Plugin: After Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/migrating_to_lsp_plugin.md Shows the new approach using classmethods register() and unregister() on the plugin class. ```python from LSP.plugin import LspPlugin class LspFoo(LspPlugin): ... def plugin_loaded() -> None: LspFoo.register() def plugin_unloaded() -> None: LspFoo.unregister() ``` -------------------------------- ### Configure markmark for Markdown Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add this configuration to enable markmark, a language server for Markdown. Requires Node.js version 16 or higher. ```json { "markmark": { "enabled": true, "command": ["markmark-lsp", "--stdio"], "selector": "text.html.markdown" } } ``` -------------------------------- ### Signature Help Command Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/keyboard_shortcuts.md Command to show signature help for functions or methods. Triggered by Ctrl+Alt+Space. ```json "lsp_signature_help_show" ``` -------------------------------- ### Configure LSP-Ruff for Auto-Fix on Save Source: https://github.com/sublimelsp/lsp/blob/main/CONTRIBUTING.md Enable auto-fix on save for linting violations and import ordering in your LSP settings. ```json { "lsp_code_actions_on_save": { "source.fixAll.ruff": true, "source.organizeImports.ruff": true, } } ``` -------------------------------- ### Override or Add LSP Client Configurations Per Project Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/client_configuration.md This snippet demonstrates how to override or add LSP client configurations per project. The 'LSP' object within 'settings' allows you to modify existing client settings or introduce new ones, such as disabling a specific language server or adjusting client-specific options. ```jsonc { "folders": [ { "path": "." } ], "settings": { "LSP": { "jsts": { "enabled": false, }, "LSP-eslint": { "settings": { "eslint.autoFixOnSave": true // This property will be merged with original settings for // this client (potentially overriding original value). } } } } } ``` -------------------------------- ### Configure Ruby LSP Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/language_servers.md Add this configuration to enable the Ruby LSP gem. This configuration enables diagnostics and experimental features. ```json { "ruby-lsp": { "enabled": true, "command": ["ruby-lsp"], "selector": "source.ruby | text.html.rails", "initialization_options": { "enabledFeatures": { "diagnostics": true }, "experimentalFeaturesEnabled": true } } } ``` -------------------------------- ### Format File Command Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/keyboard_shortcuts.md Command to format the entire document. Currently unbound by default. ```json "lsp_format_document" ``` -------------------------------- ### React to client setting changes Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/migrating_to_lsp_plugin.md To react to user-initiated client setting changes, intercept the `workspace/didChangeConfiguration` notification by overriding `on_pre_send_notification_async`. ```python def on_pre_send_notification_async(self, notification: ClientNotification) -> None: if notification['method'] == 'workspace/didChangeConfiguration': doSomeWork() ``` -------------------------------- ### Change Base Class: Before Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/migrating_to_lsp_plugin.md Illustrates the original plugin class inheriting from AbstractPlugin. ```python from LSP.plugin import AbstractPlugin class LspFoo(AbstractPlugin): ... ``` -------------------------------- ### Save All Command with Optional Argument Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/keyboard_shortcuts.md Command to save all open files. Supports an optional 'only_files' argument to control whether to ignore buffers without associated files. ```json "lsp_save_all" ``` -------------------------------- ### Format Selection Command Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/keyboard_shortcuts.md Command to format the selected text. Currently unbound by default. ```json "lsp_format_document_range" ``` -------------------------------- ### Update Storage Path: Before Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/migrating_to_lsp_plugin.md Shows the old method of using storage_path() to determine server directory. ```python server_dir = os.path.join(cls.storage_path(), cls.name(), "server") ``` -------------------------------- ### Follow Link Command Source: https://github.com/sublimelsp/lsp/blob/main/docs/src/keyboard_shortcuts.md Command to follow a link. Currently unbound by default. ```json "lsp_open_link" ```