From 99cd4a9c40fc74bef50c781794fa899132a7f8dd Mon Sep 17 00:00:00 2001 From: JenChieh Date: Mon, 26 Aug 2024 00:08:56 -0700 Subject: [PATCH 1/2] feat: Update TS config --- clients/lsp-javascript.el | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/clients/lsp-javascript.el b/clients/lsp-javascript.el index cb84c3eead3..3740ba910cc 100644 --- a/clients/lsp-javascript.el +++ b/clients/lsp-javascript.el @@ -537,12 +537,23 @@ workspace." (const "non-relative")) :package-version '(lsp-mode . "6.1")) -(defcustom lsp-typescript-preferences-import-module-specifier "auto" +(defcustom lsp-typescript-preferences-import-module-specifier-preference "shortest" "Infer the shortest path type." :type '(choice - (const "auto") + (const "shortest") + (const "project-relative") (const "relative") - (const "non-relative")) + (const "non-relative'")) + :package-version '(lsp-mode . "9.0.1")) + +(defcustom lsp-typescript-preferences-import-module-specifier-ending "auto" + "Determines whether we import `foo/index.ts' as `foo', `foo/index', +or `foo/index.js'" + :type '(choice + (const "auto") + (const "minimal") + (const "index") + (const "js")) :package-version '(lsp-mode . "6.1")) (defcustom lsp-javascript-preferences-rename-shorthand-properties t @@ -687,7 +698,8 @@ name (e.g. `data' variable passed as `data' parameter)." ("typescript.implementationsCodeLens.enabled" lsp-typescript-implementations-code-lens-enabled t) ("typescript.locale" lsp-typescript-locale) ("typescript.npm" lsp-typescript-npm) - ("typescript.preferences.importModuleSpecifier" lsp-typescript-preferences-import-module-specifier) + ("typescript.preferences.importModuleSpecifierPreference" lsp-typescript-preferences-import-module-specifier-preference) + ("typescript.preferences.importModuleSpecifierEnding" lsp-typescript-preferences-import-module-specifier-ending) ("typescript.preferences.quoteStyle" lsp-typescript-preferences-quote-style) ("typescript.preferences.renameShorthandProperties" lsp-typescript-preferences-rename-shorthand-properties t) ("typescript.referencesCodeLens.enabled" lsp-typescript-references-code-lens-enabled t) From 6e2393bb1447586e3e9c708570f08ec0bc0c0d0e Mon Sep 17 00:00:00 2001 From: JenChieh Date: Mon, 26 Aug 2024 00:13:24 -0700 Subject: [PATCH 2/2] Remove extra quote --- clients/lsp-javascript.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/lsp-javascript.el b/clients/lsp-javascript.el index 3740ba910cc..1189b74e174 100644 --- a/clients/lsp-javascript.el +++ b/clients/lsp-javascript.el @@ -543,7 +543,7 @@ workspace." (const "shortest") (const "project-relative") (const "relative") - (const "non-relative'")) + (const "non-relative")) :package-version '(lsp-mode . "9.0.1")) (defcustom lsp-typescript-preferences-import-module-specifier-ending "auto"