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

Add support for JS/TS import module specifier ending preferences #4500

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.org
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Added a new optional ~:action-filter~ argument when defining LSP clients that allows code action requests to be modified before they are sent to the server. This is used by the Haskell language server client to work around an ~lsp-mode~ parsing quirk that incorrectly sends ~null~ values instead of ~false~ in code action requests.
* Add support for C# via the [[https://github.com/dotnet/roslyn/tree/main/src/LanguageServer][Roslyn language server]].
* Add basic support for [[https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_pullDiagnostics][pull diagnostics]] requests.
* Add support for the ~javascript.preferences.importModuleSpecifierEnding~ and ~typescript.preferences.importModuleSpecifierEnding~ preferences.

** 9.0.0
* Add language server config for QML (Qt Modeling Language) using qmlls.
Expand Down
22 changes: 22 additions & 0 deletions clients/lsp-javascript.el
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,26 @@ workspace."
(const "non-relative"))
:package-version '(lsp-mode . "6.1"))

(defcustom lsp-javascript-preferences-import-module-specifier-ending "auto"
"Preferred path ending for auto imports.
Requires using TypeScript 4.5+ in the workspace."
:type '(choice
(const "auto")
(const "minimal")
(const "index")
(const "js"))
:package-version '(lsp-mode . "9.0.1"))

(defcustom lsp-typescript-preferences-import-module-specifier-ending "auto"
"Preferred path ending for auto imports.
Requires using TypeScript 4.5+ in the workspace."
:type '(choice
(const "auto")
(const "minimal")
(const "index")
(const "js"))
:package-version '(lsp-mode . "9.0.1"))

(defcustom lsp-javascript-preferences-rename-shorthand-properties t
"Enable/disable introducing aliases for object shorthand
properties during renames. Requires using TypeScript 3.4 or newer
Expand Down Expand Up @@ -653,6 +673,7 @@ name (e.g. `data' variable passed as `data' parameter)."
("javascript.implicitProjectConfig.checkJs" lsp-javascript-implicit-project-config-check-js t)
("javascript.implicitProjectConfig.experimentalDecorators" lsp-javascript-implicit-project-config-experimental-decorators t)
("javascript.preferences.importModuleSpecifier" lsp-javascript-preferences-import-module-specifier)
("javascript.preferences.importModuleSpecifierEnding" lsp-javascript-preferences-import-module-specifier-ending)
("javascript.preferences.quoteStyle" lsp-javascript-preferences-quote-style)
("javascript.preferences.renameShorthandProperties" lsp-javascript-preferences-rename-shorthand-properties t)
("javascript.referencesCodeLens.enabled" lsp-javascript-references-code-lens-enabled t)
Expand Down Expand Up @@ -688,6 +709,7 @@ name (e.g. `data' variable passed as `data' parameter)."
("typescript.locale" lsp-typescript-locale)
("typescript.npm" lsp-typescript-npm)
("typescript.preferences.importModuleSpecifier" lsp-typescript-preferences-import-module-specifier)
("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)
Expand Down
Loading