Skip to content

Commit 2f30e9f

Browse files
authored
add new typescript 5.9 settings (#273)
1 parent 034a65b commit 2f30e9f

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

LSP-typescript.sublime-settings

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"allowRenameOfImportPath": true,
1212
"allowTextChangesInNewFiles": true,
1313
"autoImportFileExcludePatterns": [],
14+
"autoImportSpecifierExcludeRegexes": [],
1415
"disableSuggestions": false,
1516
"displayPartsForJSDoc": true,
1617
"excludeLibrarySymbolsInNavTo": true,
@@ -28,12 +29,15 @@
2829
"interactiveInlayHints": true,
2930
"jsxAttributeCompletionStyle": "auto",
3031
"lazyConfiguredProjectsFromExternalProject": false,
32+
"maximumHoverLength": 500,
3133
"organizeImportsIgnoreCase": "auto",
3234
"organizeImportsCollation": "ordinal",
33-
"organizeImportsCollationLocale": "en",
35+
"organizeImportsLocale": "en",
3436
"organizeImportsNumericCollation": false,
3537
"organizeImportsAccentCollation": true,
3638
"organizeImportsCaseFirst": false,
39+
"organizeImportsTypeOrder": "auto",
40+
"preferTypeOnlyAutoImports": false,
3741
"providePrefixAndSuffixTextForRename": true,
3842
"provideRefactorNotApplicableReason": true,
3943
"quotePreference": "auto",

sublime-package.json

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
},
9797
"preferences": {
9898
"type": "object",
99+
"additionalProperties": false,
99100
"properties": {
100101
"allowIncompleteCompletions": {
101102
"type": "boolean",
@@ -117,6 +118,14 @@
117118
"default": [],
118119
"markdownDescription": "Glob patterns of files to exclude from auto imports. Requires using TypeScript 4.8 or newer in the workspace.\n\nRelative paths are resolved relative to the workspace root."
119120
},
121+
"autoImportSpecifierExcludeRegexes": {
122+
"type": "array",
123+
"items": {
124+
"type": "string"
125+
},
126+
"markdownDescription": "Specify regular expressions to exclude auto imports with matching import specifiers. Examples:\n\n- `^node:`\n- `lib/internal` (slashes don't need to be escaped...)\n- `/lib\\/internal/i` (...unless including surrounding slashes for `i` or `u` flags)\n- `^lodash$` (only allow subpath imports from lodash)",
127+
"scope": "resource"
128+
},
120129
"includeCompletionsForModuleExports": {
121130
"type": "boolean",
122131
"markdownDescription": "If enabled, TypeScript will search through all external modules' exports and add them to the completions list. This affects lone identifier completions but not completions on the right hand side of `obj.`."
@@ -191,7 +200,7 @@
191200
"default": "ordinal",
192201
"markdownDescription": "Indicates whether imports should be organized via an `\"ordinal\"` (binary) comparison using the numeric value of their code points, or via `\"unicode\"` collation (via the [Unicode Collation Algorithm](https://unicode.org/reports/tr10/#Scope)) using rules associated with the locale specified in `organizeImportsCollationLocale`."
193202
},
194-
"organizeImportsCollationLocale": {
203+
"organizeImportsLocale": {
195204
"type": "string",
196205
"default": "en",
197206
"markdownDescription": "Indicates the locale to use for `\"unicode\"` collation. If not specified, the locale `\"en\"` is used as an invariant for the sake of consistent sorting. Use `\"auto\"` to use the detected UI locale.\n\nThis preference is ignored if `organizeImportsCollation` is not `\"unicode\"`."
@@ -215,6 +224,28 @@
215224
"default": false,
216225
"markdownDescription": "Indicates whether upper case or lower case should sort first. When `false`, the default order for the locale specified in `organizeImportsCollationLocale` is used.\n\nThis preference is ignored if `organizeImportsCollation` is not `\"unicode\"`. This preference is also ignored if we are using case-insensitive sorting, which occurs when `organizeImportsIgnoreCase` is `true`, or if `organizeImportsIgnoreCase` is `\"auto\"` and the auto-detected case sensitivity is determined to be case-insensitive."
217226
},
227+
"organizeImportsTypeOrder": {
228+
"type": "string",
229+
"markdownDescription": "Specify how type-only named imports should be sorted.",
230+
"enum": [
231+
"auto",
232+
"last",
233+
"inline",
234+
"first"
235+
],
236+
"default": "auto",
237+
"markdownEnumDescriptions": [
238+
"Detect where type-only named imports should be sorted.",
239+
"Type only named imports are sorted to the end of the import list. E.g. `import { B, Z, type A, type Y } from 'module';`",
240+
"Named imports are sorted by name only. E.g. `import { type A, B, type Y, Z } from 'module';`",
241+
"Type only named imports are sorted to the beginning of the import list. E.g. `import { type A, type Y, B, Z } from 'module';`"
242+
]
243+
},
244+
"preferTypeOnlyAutoImports": {
245+
"type": "boolean",
246+
"default": false,
247+
"markdownDescription": "Include the `type` keyword in auto-imports whenever possible. Requires using TypeScript 5.3+ in the workspace.",
248+
},
218249
"providePrefixAndSuffixTextForRename": {
219250
"type": "boolean",
220251
},
@@ -263,6 +294,11 @@
263294
"Only insert attribute names."
264295
],
265296
"markdownDescription": "Preferred style for JSX attribute completions.\n\nRequires TypeScript 4.5+."
297+
},
298+
"maximumHoverLength": {
299+
"type": "number",
300+
"default": 500,
301+
"description": "The maximum number of characters in a hover. If the hover is longer than this, it will be truncated. Requires TypeScript 5.9+.",
266302
}
267303
}
268304
},

0 commit comments

Comments
 (0)