You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* doc: Registering a server
I was originally planning to fix a few grammar problems but ended up making a
bit more extensive changes.
* grammar stuff
* Tried to make the reason for the indirection from major mode to language name
to server a bit clearer, since I struggled with this a bit myself.
* Added permalink pointer to the `lsp-client` defstruct which has a lot of good
docs in its comments.
* Indented the elisp code using standard Emacs indentation.
* `lsp-restart-workspace` (deprecated) -> `lsp-workspace-restart`
* doc: File watchers - grammar and linking
* fixed some grammar
* link to PRs and issues
**Note:** This example assumes that you've already set up a major mode of your own either by [deriving it](https://www.gnu.org/software/emacs/manual/html_node/elisp/Derived-Modes.html) from `web-mode` or perhaps by writing it yourself.
60
78
61
79
If the language server supports environment variables to control
62
80
additional behavior, you can register that by using the
63
-
`:environment-fn`function, like the Bash language client does:
81
+
`:environment-fn`option, like the Bash language client does:
64
82
65
83
```elisp
66
84
(lsp-register-client
@@ -76,12 +94,12 @@ additional behavior, you can register that by using the
76
94
`lsp-bash-explainshell-endpoint` and `lsp-bash-highlight-parsing-errors`
77
95
are language client `defcustom` that expose supported server environment
78
96
settings in a type-safe way. If you change any of those variables,
79
-
restart the language server with `lsp-restart-workspace` for the changes
97
+
restart the language server with `lsp-workspace-restart` for the changes
80
98
to be applied.
81
99
82
-
Also, if new client support customizing language server path. It's recommended
100
+
Also, if your client supports customizing the language server path it's recommended
83
101
to make a wrapper function so the user can customize the value even after the
84
-
client has been loaded.
102
+
client has been loaded. For example:
85
103
86
104
```elisp
87
105
(defcustom lsp-tex-executable "digestif"
@@ -102,9 +120,9 @@ client has been loaded.
102
120
## Sections
103
121
104
122
`lsp-mode` provides tools to bridge emacs `defcustom` as a language
workspace/configuration](https://microsoft.github.io/language-server-protocol/specification#workspace_configuration)). In addition you may use `lsp-generate-settings`
107
-
from [Generate Settings script](https://github.com/emacs-lsp/lsp-mode/blob/master/scripts/lsp-generate-settings.el) to generate `lsp-defcustom` from `package.json`
125
+
from the [Generate Settings script](https://github.com/emacs-lsp/lsp-mode/blob/master/scripts/lsp-generate-settings.el) to generate `lsp-defcustom` from the`package.json`
When some of the workspaces that are active in the current project requests file notifications via `workspace/didChangeWatchedFiles`, `lsp-mode` will start monitoring each of the folders in the workspace for changes to notify the server about that.
6
+
When a workspace that is active in the current project requests file notifications via `workspace/didChangeWatchedFiles`, `lsp-mode` will monitor the workspace folders for changes and notify the server about them.
7
7
8
-
In case you have issues with file watchers, first, check what folders are being watched, they are logged on `*lsp-log*` when the server starts, then you may consider check the below:
8
+
If you have problems with file watchers, first check what folders are being watched (they are logged in the `*lsp-log*`buffer when the server starts) and then check the below:
9
9
10
-
- If your project has some specific folder that should not be watched, you can exclude it with:
10
+
- If your project has a specific folder that should not be watched, you can exclude it with:
11
11
12
12
```emacs-lisp
13
13
(with-eval-after-load 'lsp-mode
@@ -16,6 +16,6 @@ In case you have issues with file watchers, first, check what folders are being
- Increase the file watch warning threshold, the default is `1000`,`(setq lsp-file-watch-threshold 2000)`
20
-
- If the folder is some kind of cache folder or something that should always be excluded for everyone, consider opening a pull request or informing the maintainers to add to the [common regex](https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-mode.el#L306).
21
-
-In last case, disable file watchers with `(setq lsp-enable-file-watchers nil)` (you may use dir-locals).
19
+
- Increase the file watch warning threshold, the default is `1000`:`(setq lsp-file-watch-threshold 2000)`
20
+
- If the folder is some kind of cache folder or something that should always be excluded for everyone, consider [opening a pull request](https://github.com/emacs-lsp/lsp-mode/pulls) or [filing a bug](https://github.com/emacs-lsp/lsp-mode/issues) to add to the [common regex](https://github.com/emacs-lsp/lsp-mode/blob/1b13d7c1b39aaad12073095ef7719952568c45db/lsp-mode.el#L340).
21
+
-As a last resort, disable file watchers with `(setq lsp-enable-file-watchers nil)` (you may use dir-locals).
0 commit comments