From 5a2db48b929c20eb17471e3da7d76e69ac603edb Mon Sep 17 00:00:00 2001 From: Yuki Date: Sat, 4 Jan 2025 15:10:56 +0800 Subject: [PATCH 1/4] feat(lsp-bridge.el): add additional extension floors --- lsp-bridge.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lsp-bridge.el b/lsp-bridge.el index e6e9321bd1..bc816e3dfe 100644 --- a/lsp-bridge.el +++ b/lsp-bridge.el @@ -1083,7 +1083,7 @@ So we build this macro to restore postion after code format." (defun lsp-bridge-get-lang-server-by-extension (filename extension-list) "Get lang server for file extension." - (when-let* ((file-extension (file-name-extension filename)) + (when-let* ((file-extension (substring filename (+ (cl-position ?. filename) 1) (length filename))) (langserver-info (cl-find-if (lambda (pair) (let ((extension (car pair))) From 71d7bc445808fb96a2aad63dce9e814eb17c5946 Mon Sep 17 00:00:00 2001 From: Yuki Date: Sat, 4 Jan 2025 15:16:53 +0800 Subject: [PATCH 2/4] feat(lsp-bridge.el): add angular file extensions support --- lsp-bridge.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lsp-bridge.el b/lsp-bridge.el index bc816e3dfe..b471d6c1c1 100644 --- a/lsp-bridge.el +++ b/lsp-bridge.el @@ -449,6 +449,8 @@ Then LSP-Bridge will start by gdb, please send new issue with `*lsp-bridge*' buf (("vue") . "volar_emmet") (("ts") . "typescript_eslint") (("tsx") . "typescriptreact_eslint") + (("component.html") . "angular_template_html") + (("component.ts") . "angular_template_typescript") ) "The multi lang server rule for file extension." :type 'cons) From 32ad3cf7c00e4015d08ed2f1e8c4492f7e6ca9b6 Mon Sep 17 00:00:00 2001 From: Yuki61803 Date: Sat, 4 Jan 2025 11:21:57 +0800 Subject: [PATCH 3/4] feat: add angular lsp support --- langserver/angular-ls.json | 25 ++++++++++++++++++++ langserver/angular-ls_windows.json | 25 ++++++++++++++++++++ multiserver/angular_template_html.json | 22 +++++++++++++++++ multiserver/angular_template_typescript.json | 22 +++++++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 langserver/angular-ls.json create mode 100644 langserver/angular-ls_windows.json create mode 100644 multiserver/angular_template_html.json create mode 100644 multiserver/angular_template_typescript.json diff --git a/langserver/angular-ls.json b/langserver/angular-ls.json new file mode 100644 index 0000000000..f7650aa1f7 --- /dev/null +++ b/langserver/angular-ls.json @@ -0,0 +1,25 @@ +{ + "name": "angular-ls", + "languageId": "angular", + "command": [ + "ngserver", + "--ngProbeLocations", + "/usr/local/lib/node_modules", + "--tsProbeLocations", + "/usr/local/lib/node_modules", + "--tsdk", + "%TSDK_PATH%", + "--disableLetSyntax", + "false", + "--disableBlockSyntax", + "false", + "--includeCompletionsWithSnippetText", + "true", + "--forceStrictTemplates", + "true", + "--stdio" + ], + "projectFiles": ["package.json"], + "settings": {}, + "initializationOptions": {} +} diff --git a/langserver/angular-ls_windows.json b/langserver/angular-ls_windows.json new file mode 100644 index 0000000000..d1368db0f7 --- /dev/null +++ b/langserver/angular-ls_windows.json @@ -0,0 +1,25 @@ +{ + "name": "angular-ls", + "languageId": "angular", + "command": [ + "ngserver", + "--ngProbeLocations", + "%USERPROFILE%\\AppData\\Roaming\\npm\\node_modules", + "--tsProbeLocations", + "%USERPROFILE%\\AppData\\Roaming\\npm\\node_modules", + "--tsdk", + "%USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\typescript\\lib", + "--disableLetSyntax", + "false", + "--disableBlockSyntax", + "false", + "--includeCompletionsWithSnippetText", + "true", + "--forceStrictTemplates", + "true", + "--stdio" + ], + "projectFiles": ["package.json"], + "settings": {}, + "initializationOptions": {} +} diff --git a/multiserver/angular_template_html.json b/multiserver/angular_template_html.json new file mode 100644 index 0000000000..375d82acaf --- /dev/null +++ b/multiserver/angular_template_html.json @@ -0,0 +1,22 @@ +{ + "completion": ["vscode-html-language-server", "angular-ls", "emmet-ls"], + "completion_item_resolve": ["vscode-html-language-server", "angular-ls", "emmet-ls"], + "diagnostics": ["vscode-html-language-server", "angular-ls", "emmet-ls"], + "code_action": ["vscode-html-language-server", "angular-ls", "emmet-ls"], + "execute_command": ["vscode-html-language-server", "angular-ls", "emmet-ls"], + "find_define": "vscode-html-language-server", + "find_type_define": "vscode-html-language-server", + "find_implementation": "vscode-html-language-server", + "find_references": "vscode-html-language-server", + "peek_find_definition": "vscode-html-language-server", + "peek_find_references": "vscode-html-language-server", + "formatting": "vscode-html-language-server", + "hover": "vscode-html-language-server", + "signature_help": "vscode-html-language-server", + "prepare_rename": "vscode-html-language-server", + "rename": "vscode-html-language-server", + "document_symbol": "vscode-html-language-server", + "workspace_symbol": "vscode-html-language-server", + "semantic_tokens": "vscode-html-language-server", + "inlay_hint": "vscode-html-language-server" +} diff --git a/multiserver/angular_template_typescript.json b/multiserver/angular_template_typescript.json new file mode 100644 index 0000000000..676c1d47c2 --- /dev/null +++ b/multiserver/angular_template_typescript.json @@ -0,0 +1,22 @@ +{ + "completion": ["typescript", "angular-ls"], + "completion_item_resolve": ["typescript", "angular-ls"], + "diagnostics": ["typescript", "angular-ls"], + "code_action": ["typescript", "angular-ls"], + "execute_command": ["typescript", "angular-ls"], + "find_define": "typescript", + "find_type_define": "typescript", + "find_implementation": "typescript", + "find_references": "typescript", + "peek_find_definition": "typescript", + "peek_find_references": "typescript", + "formatting": "typescript", + "hover": "typescript", + "signature_help": "typescript", + "prepare_rename": "typescript", + "rename": "typescript", + "document_symbol": "typescript", + "workspace_symbol": "typescript", + "semantic_tokens": "typescript", + "inlay_hint": "typescript" +} From f024083f5b9638fa0fa4743ec21673b14fcd6d25 Mon Sep 17 00:00:00 2001 From: Yuki Date: Sat, 4 Jan 2025 15:53:21 +0800 Subject: [PATCH 4/4] docs(readme): update readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9653db759f..9857a7c1d9 100644 --- a/README.md +++ b/README.md @@ -361,6 +361,7 @@ If your language supports mixed multi-language servers, it is recommended to che |:------------|:---------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | Ada | [ada_language_server](https://github.com/AdaCore/ada_language_server) | | | Ansible | [ansible-language-server](https://github.com/ansible/ansible-language-server) | Ansible uses YAML as source code, you’ll need to customize `lsp-bridge-get-single-lang-server-by-project` to return "ansible-language-server". | +| Angular | [angular-language-server](https://github.com/angular/vscode-ng-language-service) | `npm i -g @angular/language-server @angular/language-service typescript emmet-ls vscode-langservers-extracted typescript-language-server` | | Astro | [astro](https://github.com/withastro/language-tools/tree/main/packages/language-server) | `npm i -g @astrojs/language-server` | | Ballerina | [ballerina-lang-server](https://github.com/ballerina-platform/ballerina-lang) | | | Bash | [bash-language-server](https://github.com/bash-lsp/bash-language-server) | |