Skip to content

Commit

Permalink
diagnostic-ignore is not general protocol, use code action instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
manateelazycat committed Oct 6, 2023
1 parent 038e98a commit e30f304
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 22 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ lsp-bridge first looks for the content of the first *.pub file in the `~/.ssh` d
- `lsp-bridge-diagnostic-jump-prev`: Jump to the previous diagnostic position
- `lsp-bridge-diagnostic-list`: List all diagnostic information
- `lsp-bridge-diagnostic-copy`: Copy the current diagnostic information to the clipboard
- `lsp-bridge-diagnostic-ignore`: Insert comment to ignore the current diagnosis
- `lsp-bridge-code-action`: Popup code action menu, you can pass special `actin-kind` to fix, `action-kind` can use one of "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports", "source.fixAll"
- `lsp-bridge-workspace-list-symbols`: List all symbols in workspace and jump to the symbol definition
- `lsp-bridge-signature-help-fetch`: show signature help in minibuffer manually (move cursor to parameters area will show signature help automatically)
Expand Down
1 change: 0 additions & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ lsp-bridge 优先从`~/.ssh`目录下找第一个 *.pub 文件的内容作为远
- `lsp-bridge-diagnostic-jump-prev`: 跳转到上一个诊断位置
- `lsp-bridge-diagnostic-list`: 列出所有诊断信息
- `lsp-bridge-diagnostic-copy`: 拷贝当前诊断信息到剪切板
- `lsp-bridge-diagnostic-ignore`: 插入注视忽略当前诊断
- `lsp-bridge-code-action`: 弹出代码修复菜单, 也可以指需要修复的代码动作类型: "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports", "source.fixAll"
- `lsp-bridge-workspace-list-symbols`: 列出工作区所有符号, 并跳转到符号定义
- `lsp-bridge-signature-help-fetch`: 在 minibuffer 显示参数信息
Expand Down
7 changes: 0 additions & 7 deletions core/fileaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,6 @@ def change_cursor(self, position):
# Record change cursor time.
self.last_change_cursor_time = time.time()

def ignore_diagnostic(self):
lsp_server = self.get_match_lsp_servers("completion")[0]
if "ignore-diagnostic" in lsp_server.server_info:
eval_in_emacs("lsp-bridge-diagnostic--ignore", lsp_server.server_info["ignore-diagnostic"])
else:
message_emacs("Not found 'ignore_diagnostic' field in LSP server configure file.")

def get_diagnostics(self):
diagnostics = []
diagnostic_count = 0
Expand Down
1 change: 0 additions & 1 deletion langserver/kotlin-language-server.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"command": [
"kotlin-language-server"
],
"ignore-diagnostic": "# type: ignore",
"settings": {
"kotlin.externalSources": {
"autoConvertToKotlin": true,
Expand Down
1 change: 0 additions & 1 deletion langserver/pyright-background-analysis.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"--stdio",
"--cancellationReceive=file:%FILEHASH%"
],
"ignore-diagnostic": "# type: ignore",
"settings": {
"python.analysis": {
"autoImportCompletions": true,
Expand Down
1 change: 0 additions & 1 deletion langserver/pyright.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"pyright-langserver",
"--stdio"
],
"ignore-diagnostic": "# type: ignore",
"settings": {
"python.analysis": {
"autoImportCompletions": true,
Expand Down
9 changes: 0 additions & 9 deletions lsp-bridge-diagnostic.el
Original file line number Diff line number Diff line change
Expand Up @@ -320,15 +320,6 @@ You can set this value with `(2 3 4) if you just need render error diagnostic."
(interactive)
(lsp-bridge-call-file-api "list_diagnostics"))

(defun lsp-bridge-diagnostic-ignore()
(interactive)
(lsp-bridge-call-file-api "ignore_diagnostic"))

(defun lsp-bridge-diagnostic--ignore (comment-string)
(setq-local lsp-bridge-prohibit-completion t)
(move-end-of-line 1)
(insert (format " %s" comment-string)))

(defun lsp-bridge-diagnostic--list (diagnostics)
(let ((filepath acm-backend-lsp-filepath)
(current-buffer (current-buffer))
Expand Down
2 changes: 1 addition & 1 deletion lsp_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def init_search_backends(self):
handler_subclasses = list(map(lambda cls: cls.name, Handler.__subclasses__()))
for name in ["change_file", "update_file", "save_file",
"try_completion", "change_cursor",
"ignore_diagnostic", "list_diagnostics",
"list_diagnostics",
"try_code_action",
"workspace_symbol"] + handler_subclasses:
self.build_file_action_function(name)
Expand Down

0 comments on commit e30f304

Please sign in to comment.