Skip to content

Commit

Permalink
Format code fragments appropriately (#547)
Browse files Browse the repository at this point in the history
  • Loading branch information
bazrafshan1707 authored Sep 10, 2024
1 parent c73b8c8 commit 8a67f5a
Showing 1 changed file with 54 additions and 54 deletions.
108 changes: 54 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The following language server protocol (LSP) features are supported:

To use the plugin features with a particular file type(s), you need to first register a LSP server for that file type(s).

The LSP servers are registered using the LspAddServer() function. This function accepts a list of LSP servers.
The LSP servers are registered using the `LspAddServer()` function. This function accepts a list of LSP servers.

To register a LSP server, add the following lines to your .vimrc file (use only the LSP servers that you need from the below list). If you used [vim-plug](https://github.com/junegunn/vim-plug) to install the LSP plugin, the steps are described later in this section.
```viml
Expand Down Expand Up @@ -98,17 +98,17 @@ To register a LSP server, the following information is needed:

Field|Description
-----|-----------
filetype|One or more file types supported by the LSP server. This can be a String or a List. To specify multiple multiple file types, use a List.
path|complete path to the LSP server executable (without any arguments).
args|a list of command-line arguments passed to the LSP server. Each argument is a separate List item.
initializationOptions|User provided initialization options. May be of any type. For example the *intelephense* PHP language server accept several options here with the License Key among others.
customNotificationHandlers|A dictionary of notifications and functions that can be specified to add support for custom language server notifications.
customRequestHandlers|A dictionary of request handlers and functions that can be specified to add support for custom language server requests replies.
features|A dictionary of booleans that can be specified to toggle what things a given LSP is providing (folding, goto definition, etc) This is useful when running multiple servers in one buffer.
`filetype`|One or more file types supported by the LSP server. This can be a String or a List. To specify multiple multiple file types, use a List.
`path`|complete path to the LSP server executable (without any arguments).
`args`|a list of command-line arguments passed to the LSP server. Each argument is a separate List item.
`initializationOptions`|User provided initialization options. May be of any type. For example the *intelephense* PHP language server accept several options here with the License Key among others.
`customNotificationHandlers`|A dictionary of notifications and functions that can be specified to add support for custom language server notifications.
`customRequestHandlers`|A dictionary of request handlers and functions that can be specified to add support for custom language server requests replies.
`features`|A dictionary of booleans that can be specified to toggle what things a given LSP is providing (folding, goto definition, etc) This is useful when running multiple servers in one buffer.

The LspAddServer() function accepts a list of LSP servers with the above information.
The `LspAddServer()` function accepts a list of LSP servers with the above information.

Some of the LSP plugin features can be enabled or disabled by using the LspOptionsSet() function, detailed in `:help lsp-options`.
Some of the LSP plugin features can be enabled or disabled by using the `LspOptionsSet()` function, detailed in `:help lsp-options`.
Here is an example of configuration with default values:
```viml
call LspOptionsSet(#{
Expand Down Expand Up @@ -178,50 +178,50 @@ The following commands are provided to use the LSP features.

Command|Description
-------|-----------
:LspCodeAction|Apply the code action supplied by the language server to the diagnostic in the current line.
:LspCodeLens|Display a list of code lens commands and apply a selected code lens command to the current file.
:LspDiag current|Display the diagnostic message for the current line.
:LspDiag first|Jump to the first diagnostic message for the current buffer.
:LspDiag here|Jump to the next diagnostic message in the current line.
:LspDiag highlight disable|Disable diagnostic message highlights.
:LspDiag highlight enable|Enable diagnostic message highlights.
:LspDiag next|Jump to the next diagnostic message after the current position.
:LspDiag nextWrap|Jump to the next diagnostic message after the current position, wrapping to the first message when the last message is reached.
:LspDiag prev|Jump to the previous diagnostic message before the current position.
:LspDiag prevWrap|Jump to the previous diagnostic message before the current position, wrapping to the last message when the first message is reached.
:LspDiag show|Display the diagnostics messages from the language server for the current buffer in a new location list.
:LspDocumentSymbol|Display the symbols in the current file in a popup menu and jump to the selected symbol.
:LspFold|Fold the current file.
:LspFormat|Format a range of lines in the current file using the language server. The **shiftwidth** and **expandtab** values set for the current buffer are used when format is applied. The default range is the entire file.
:LspGotoDeclaration|Go to the declaration of the keyword under cursor.
:LspGotoDefinition|Go to the definition of the keyword under cursor.
:LspGotoImpl|Go to the implementation of the keyword under cursor.
:LspGotoTypeDef|Go to the type definition of the keyword under cursor.
:LspHighlight|Highlight all the matches for the keyword under cursor.
:LspHighlightClear|Clear all the matches highlighted by :LspHighlight.
:LspHover|Show the documentation for the symbol under the cursor in a popup window.
:LspIncomingCalls|Display the list of symbols calling the current symbol.
:LspOutgoingCalls|Display the list of symbols called by the current symbol.
:LspOutline|Show the list of symbols defined in the current file in a separate window.
:LspPeekDeclaration|Open the declaration of the symbol under cursor in the preview window.
:LspPeekDefinition|Open the definition of the symbol under cursor in the preview window.
:LspPeekImpl|Open the implementation of the symbol under cursor in the preview window.
:LspPeekReferences|Display the list of references to the keyword under cursor in a location list associated with the preview window.
:LspPeekTypeDef|Open the type definition of the symbol under cursor in the preview window.
:LspRename|Rename the current symbol.
:LspSelectionExpand|Expand the current symbol range visual selection.
:LspSelectionShrink|Shrink the current symbol range visual selection.
:LspShowAllServers|Display information about all the registered language servers.
:LspServer|Display the capabilities or messages or status of the language server for the current buffer or restart the server.
:LspShowReferences|Display the list of references to the keyword under cursor in a new location list.
:LspShowSignature|Display the signature of the keyword under cursor.
:LspSubTypeHierarchy|Display the sub type hierarchy in a popup window.
:LspSuperTypeHierarchy|Display the super type hierarchy in a popup window.
:LspSwitchSourceHeader|Switch between a source and a header file.
:LspSymbolSearch|Perform a workspace wide search for a symbol.
:LspWorkspaceAddFolder `{folder}`| Add a folder to the workspace.
:LspWorkspaceListFolders|Show the list of folders in the workspace.
:LspWorkspaceRemoveFolder `{folder}`|Remove a folder from the workspace.
`:LspCodeAction`|Apply the code action supplied by the language server to the diagnostic in the current line.
`:LspCodeLens`|Display a list of code lens commands and apply a selected code lens command to the current file.
`:LspDiag current`|Display the diagnostic message for the current line.
`:LspDiag first`|Jump to the first diagnostic message for the current buffer.
`:LspDiag here`|Jump to the next diagnostic message in the current line.
`:LspDiag highlight disable`|Disable diagnostic message highlights.
`:LspDiag highlight enable`|Enable diagnostic message highlights.
`:LspDiag next`|Jump to the next diagnostic message after the current position.
`:LspDiag nextWrap`|Jump to the next diagnostic message after the current position, wrapping to the first message when the last message is reached.
`:LspDiag prev`|Jump to the previous diagnostic message before the current position.
`:LspDiag prevWrap`|Jump to the previous diagnostic message before the current position, wrapping to the last message when the first message is reached.
`:LspDiag show`|Display the diagnostics messages from the language server for the current buffer in a new location list.
`:LspDocumentSymbol`|Display the symbols in the current file in a popup menu and jump to the selected symbol.
`:LspFold`|Fold the current file.
`:LspFormat`|Format a range of lines in the current file using the language server. The **shiftwidth** and **expandtab** values set for the current buffer are used when format is applied. The default range is the entire file.
`:LspGotoDeclaration`|Go to the declaration of the keyword under cursor.
`:LspGotoDefinition`|Go to the definition of the keyword under cursor.
`:LspGotoImpl`|Go to the implementation of the keyword under cursor.
`:LspGotoTypeDef`|Go to the type definition of the keyword under cursor.
`:LspHighlight`|Highlight all the matches for the keyword under cursor.
`:LspHighlightClear`|Clear all the matches highlighted by :LspHighlight.
`:LspHover`|Show the documentation for the symbol under the cursor in a popup window.
`:LspIncomingCalls`|Display the list of symbols calling the current symbol.
`:LspOutgoingCalls`|Display the list of symbols called by the current symbol.
`:LspOutline`|Show the list of symbols defined in the current file in a separate window.
`:LspPeekDeclaration`|Open the declaration of the symbol under cursor in the preview window.
`:LspPeekDefinition`|Open the definition of the symbol under cursor in the preview window.
`:LspPeekImpl`|Open the implementation of the symbol under cursor in the preview window.
`:LspPeekReferences`|Display the list of references to the keyword under cursor in a location list associated with the preview window.
`:LspPeekTypeDef`|Open the type definition of the symbol under cursor in the preview window.
`:LspRename`|Rename the current symbol.
`:LspSelectionExpand`|Expand the current symbol range visual selection.
`:LspSelectionShrink`|Shrink the current symbol range visual selection.
`:LspShowAllServers`|Display information about all the registered language servers.
`:LspServer`|Display the capabilities or messages or status of the language server for the current buffer or restart the server.
`:LspShowReferences`|Display the list of references to the keyword under cursor in a new location list.
`:LspShowSignature`|Display the signature of the keyword under cursor.
`:LspSubTypeHierarchy`|Display the sub type hierarchy in a popup window.
`:LspSuperTypeHierarchy`|Display the super type hierarchy in a popup window.
`:LspSwitchSourceHeader`|Switch between a source and a header file.
`:LspSymbolSearch`|Perform a workspace wide search for a symbol.
`:LspWorkspaceAddFolder {folder}`| Add a folder to the workspace.
`:LspWorkspaceListFolders`|Show the list of folders in the workspace.
`:LspWorkspaceRemoveFolder {folder}`|Remove a folder from the workspace.

## Similar Vim LSP Plugins

Expand Down

0 comments on commit 8a67f5a

Please sign in to comment.