Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename blacklist to blocklist #4173

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.org
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@
- introduced new command ~lsp-describe-session~ which replaces the existing one ~lsp-capabilities~. The command lists the folders that are part of the workspace and the servers that are associated with the corresponding folder.
- ~lsp-mode~ displays information about the running server and it's status in the modeline.
- ~lsp-define-stdio-client~ and ~lsp-define-tcp-client~ are replaced with ~lsp-register-client~
- ~lsp~ rely on ~projectile~ or ~project.el~ now only for suggesting project root. Once you open new file in a project and start ~lsp~ it will provide several options(import project, blacklist project, select other directory root). Once you select a root it will be persisted and used for the next sessions.
- ~lsp~ rely on ~projectile~ or ~project.el~ now only for suggesting project root. Once you open new file in a project and start ~lsp~ it will provide several options(import project, blocklist project, select other directory root). Once you select a root it will be persisted and used for the next sessions.
- support for multiple language servers per single file and workspace.
- changed ~lsp-mode~ settings to more sensible defaults.
- Removed all synchronous calls from the server startup.
Expand Down
6 changes: 3 additions & 3 deletions clients/lsp-rust.el
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ the latest build duration."
:group 'lsp-rust-rls
:package-version '(lsp-mode . "6.1"))

(defcustom lsp-rust-crate-blacklist [
(defcustom lsp-rust-crate-blocklist [
"cocoa"
"gleam"
"glium"
Expand All @@ -172,7 +172,7 @@ the latest build duration."
"unicode_segmentation"
"winapi"
]
"A list of Cargo crates to blacklist."
"A list of Cargo crates to blocklist."
:type 'lsp-string-vector
:group 'lsp-rust-rls
:package-version '(lsp-mode . "6.1"))
Expand Down Expand Up @@ -298,7 +298,7 @@ is often the type local variable declaration."
("rust.all_features" lsp-rust-all-features t)
("rust.features" lsp-rust-features)
("rust.build_on_save" lsp-rust-build-on-save t)
("rust.crate_blacklist" lsp-rust-crate-blacklist)
("rust.crate_blocklist" lsp-rust-crate-blocklist)
("rust.show_warnings" lsp-rust-show-warnings t)
("rust.wait_to_build" lsp-rust-wait-to-build)
("rust.unstable_features" lsp-rust-unstable-features t)
Expand Down
2 changes: 1 addition & 1 deletion docs/page/keybindings.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ configured `lsp-command-map` which is bound to `lsp-keymap-prefix`
| `s-l = r` | Ask the server to format the region, or if none is selected, the current line. |
| `s-l F a` | Add new project root to the list of workspace folders. |
| `s-l F r` | Remove project root from the list of workspace folders. |
| `s-l F b` | Remove project root from the workspace blacklist. |
| `s-l F b` | Remove project root from the workspace blocklist. |
| `s-l T l` | Toggle code-lens overlays. |
| `s-l T L` | Toggle client-server protocol logging. |
| `s-l T h` | Toggle symbol highlighting. |
Expand Down
32 changes: 16 additions & 16 deletions lsp-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ For finer granularity you may use `lsp-enable-*' properties."
:package-version '(lsp-mode . "6.1"))

(defcustom lsp-disabled-clients nil
"A list of disabled/blacklisted clients.
"A list of disabled/blocklisted clients.
Each entry in the list can be either:
a symbol, the server-id for the LSP client, or
a cons pair (MAJOR-MODE . CLIENTS), where MAJOR-MODE is the major-mode,
Expand Down Expand Up @@ -2590,7 +2590,7 @@ BINDINGS is a list of (key def desc cond)."

;; folders
"Fa" lsp-workspace-folders-add "add folder" t
"Fb" lsp-workspace-blacklist-remove "un-blacklist folder" t
"Fb" lsp-workspace-blocklist-remove "un-blocklist folder" t
"Fr" lsp-workspace-folders-remove "remove folder" t

;; toggles
Expand Down Expand Up @@ -3048,7 +3048,7 @@ and end-of-string meta-characters."
;; contains the folders that are part of the current session
folders
;; contains the folders that must not be imported in the current workspace.
folders-blacklist
folders-blocklist
;; contains the list of folders that must be imported in a project in case of
;; multi root LSP server.
(server-id->folders (make-hash-table :test 'equal))
Expand Down Expand Up @@ -3948,14 +3948,14 @@ yet."

(run-hook-with-args 'lsp-workspace-folders-changed-functions nil (list project-root)))

(defun lsp-workspace-blacklist-remove (project-root)
"Remove PROJECT-ROOT from the workspace blacklist."
(defun lsp-workspace-blocklist-remove (project-root)
"Remove PROJECT-ROOT from the workspace blocklist."
(interactive (list (completing-read "Select folder to remove:"
(lsp-session-folders-blacklist (lsp-session))
(lsp-session-folders-blocklist (lsp-session))
nil t)))
(setf (lsp-session-folders-blacklist (lsp-session))
(setf (lsp-session-folders-blocklist (lsp-session))
(delete project-root
(lsp-session-folders-blacklist (lsp-session))))
(lsp-session-folders-blocklist (lsp-session))))
(lsp--persist-session (lsp-session)))

(define-obsolete-function-alias 'lsp-workspace-folders-switch
Expand Down Expand Up @@ -8819,7 +8819,7 @@ Returns nil if the project should not be added to the current SESSION."
%s ==> Import project root %s
%s ==> Import project by selecting root directory interactively
%s ==> Import project at current directory %s
%s ==> Do not ask again for the current project by adding %s to lsp-session-folders-blacklist
%s ==> Do not ask again for the current project by adding %s to lsp-session-folders-blocklist
%s ==> Do not ask again for the current project by selecting ignore path interactively
%s ==> Do nothing: ask again when opening other files from the current project

Expand All @@ -8843,14 +8843,14 @@ Select action: "
nil
t))
(?. default-directory)
(?d (push project-root-suggestion (lsp-session-folders-blacklist session))
(?d (push project-root-suggestion (lsp-session-folders-blocklist session))
(lsp--persist-session session)
nil)
(?D (push (read-directory-name "Select folder to blacklist: "
(?D (push (read-directory-name "Select folder to blocklist: "
(or project-root-suggestion default-directory)
nil
t)
(lsp-session-folders-blacklist session))
(lsp-session-folders-blocklist session))
(lsp--persist-session session)
nil)
(t nil)))
Expand Down Expand Up @@ -8894,11 +8894,11 @@ Select action: "
"Calculate project root for FILE-NAME in SESSION."
(and
(->> session
(lsp-session-folders-blacklist)
(lsp-session-folders-blocklist)
(--first (and (lsp--files-same-host it file-name)
(lsp-f-ancestor-of? it file-name)
(prog1 t
(lsp--info "File %s is in blacklisted directory %s" file-name it))))
(lsp--info "File %s is in blocklisted directory %s" file-name it))))
not)
(or
(when lsp-auto-guess-root
Expand Down Expand Up @@ -8947,7 +8947,7 @@ The library folders are defined by each client for each of the active workspace.
"Persist SESSION to `lsp-session-file'."
(lsp--persist lsp-session-file (make-lsp-session
:folders (lsp-session-folders session)
:folders-blacklist (lsp-session-folders-blacklist session)
:folders-blocklist (lsp-session-folders-blocklist session)
:server-id->folders (lsp-session-server-id->folders session))))

(defun lsp--try-project-root-workspaces (ask-for-client ignore-multi-folder)
Expand All @@ -8972,7 +8972,7 @@ such."
(cl-pushnew project-root (lsp-session-folders session))
(lsp--persist-session session))
(lsp--ensure-lsp-servers session clients project-root ignore-multi-folder))
(lsp--warn "%s not in project or it is blacklisted." (buffer-name))
(lsp--warn "%s not in project or it is blocklisted." (buffer-name))
nil)
(lsp--warn "No LSP server for %s(check *lsp-log*)." major-mode)
nil)))
Expand Down
2 changes: 1 addition & 1 deletion refcard/lsp-refcard.tex
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
\begin{keylist}[labelwidth=\widthof{\keyify{C-c M-.}}]
\item[\prefix F a] Add folder to workspace
\item[\prefix F r] Remove folder from workspaces
\item[\prefix F b] Remove folder from the workspace blacklist
\item[\prefix F b] Remove folder from the workspace blocklist
\end{keylist}

\columnbreak
Expand Down
Loading