Skip to content

Commit da2d7ec

Browse files
committed
ignoreAutoImports: add missing s
1 parent ec5cf17 commit da2d7ec

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

README.MD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ Some settings examples:
193193
<!-- just duplicated from configurationType -->
194194

195195
```jsonc
196-
"suggestions.ignoreAutoImport": [
196+
"suggestions.ignoreAutoImports": [
197197
"path", // ignore path, but not path/posix or path/win32 modules
198198
"path/*", // ignore path, path/posix and path/win32
199199
"path/*#join", // ignore path, path/posix and path/win32, but only join symbol

src/configurationType.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export type Configuration = {
7474
* - jquery/* - ignore absolutely all auto imports from jquery, even if it was declared virtually (declare module)
7575
* @default []
7676
*/
77-
'suggestions.ignoreAutoImport': string[]
77+
'suggestions.ignoreAutoImports': string[]
7878
/**
7979
* Disable it only if it causes problems / crashes with TypeScript, which of course should never happen
8080
* But it wasn't tested on very old versions
@@ -394,7 +394,7 @@ export type Configuration = {
394394
*/
395395
'autoImport.changeSorting': { [pathAndOrSymbol: string]: string[] }
396396
/**
397-
* Advanced. Use `suggestions.ignoreAutoImport` setting if possible.
397+
* Advanced. Use `suggestions.ignoreAutoImports` setting if possible.
398398
*
399399
* Packages to ignore in import all fix.
400400
*

src/migrateSettings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default () => {
2020
{
2121
rename: {
2222
old: 'suggestions.banAutoImportPackages',
23-
new: 'suggestions.ignoreAutoImport',
23+
new: 'suggestions.ignoreAutoImports',
2424
mustBePrimitive: false,
2525
},
2626
},

typescript/src/adjustAutoImports.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const initIgnoreAutoImport = () => {
4040
}
4141

4242
export const getIgnoreAutoImportSetting = (c: GetConfig) => {
43-
return c('suggestions.ignoreAutoImport').map((spec): ParsedIgnoreSetting => {
43+
return c('suggestions.ignoreAutoImports').map((spec): ParsedIgnoreSetting => {
4444
const hashIndex = spec.indexOf('#')
4545
let module = hashIndex === -1 ? spec : spec.slice(0, hashIndex)
4646
const moduleCompare = module.endsWith('/*') ? 'startsWith' : 'strict'
@@ -67,8 +67,8 @@ export const getIgnoreAutoImportSetting = (c: GetConfig) => {
6767
})
6868
}
6969

70-
export const isAutoImportEntryShouldBeIgnored = (ignoreAutoImportSetting: ParsedIgnoreSetting[], targetModule: string, symbol: string) => {
71-
for (const { module, moduleCompare, isAnySymbol, symbols } of ignoreAutoImportSetting) {
70+
export const isAutoImportEntryShouldBeIgnored = (ignoreAutoImportsSetting: ParsedIgnoreSetting[], targetModule: string, symbol: string) => {
71+
for (const { module, moduleCompare, isAnySymbol, symbols } of ignoreAutoImportsSetting) {
7272
const isIgnoreModule = moduleCompare === 'startsWith' ? targetModule.startsWith(module) : targetModule === module
7373
if (!isIgnoreModule) continue
7474
if (isAnySymbol) return true

typescript/src/codeFixes.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default (proxy: ts.LanguageService, languageService: ts.LanguageService,
2626
let prior: readonly ts.CodeFixAction[]
2727
try {
2828
const { importFixName } = tsFull.codefix
29-
const ignoreAutoImportSetting = getIgnoreAutoImportSetting(c)
29+
const ignoreAutoImportsSetting = getIgnoreAutoImportSetting(c)
3030
const sortFn = changeSortingOfAutoImport(c, (node as ts.Identifier).text)
3131
tsFull.codefix.createCodeFixAction = (fixName, changes, description, fixId, fixAllDescription, command) => {
3232
if (fixName !== importFixName) return oldCreateCodeFixAction(fixName, changes, description, fixId, fixAllDescription, command)
@@ -35,7 +35,7 @@ export default (proxy: ts.LanguageService, languageService: ts.LanguageService,
3535
if (placeholderIndexesInfo) {
3636
const targetModule = description[placeholderIndexesInfo[1] + 1]
3737
const symbolName = placeholderIndexesInfo[2] !== undefined ? description[placeholderIndexesInfo[2] + 1] : (node as ts.Identifier).text
38-
const toIgnore = isAutoImportEntryShouldBeIgnored(ignoreAutoImportSetting, targetModule, symbolName)
38+
const toIgnore = isAutoImportEntryShouldBeIgnored(ignoreAutoImportsSetting, targetModule, symbolName)
3939
if (toIgnore) {
4040
return {
4141
fixName: 'IGNORE',
@@ -162,7 +162,7 @@ export default (proxy: ts.LanguageService, languageService: ts.LanguageService,
162162
sourceFile,
163163
}
164164
const errorCodes = getFixAllErrorCodes()
165-
const ignoreAutoImportSetting = getIgnoreAutoImportSetting(c)
165+
const ignoreAutoImportsSetting = getIgnoreAutoImportSetting(c)
166166
for (const diagnostic of semanticDiagnostics) {
167167
if (!errorCodes.includes(diagnostic.code)) continue
168168
const oldFirst = tsFull.first
@@ -175,7 +175,7 @@ export default (proxy: ts.LanguageService, languageService: ts.LanguageService,
175175
if (fix.kind === (ImportFixKind.PromoteTypeOnly as number)) return false
176176
const shouldBeIgnored =
177177
c('autoImport.alwaysIgnoreInImportAll').includes(fix.moduleSpecifier) ||
178-
isAutoImportEntryShouldBeIgnored(ignoreAutoImportSetting, fix.moduleSpecifier, symbolName)
178+
isAutoImportEntryShouldBeIgnored(ignoreAutoImportsSetting, fix.moduleSpecifier, symbolName)
179179
return !shouldBeIgnored
180180
}),
181181
({ fix }) => sortFn(fix.moduleSpecifier),

typescript/src/completions/filterWIthIgnoreAutoImports.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import { GetConfig } from '../types'
44
import { sortBy } from 'rambda'
55

66
export default (entries: ts.CompletionEntry[], languageService: ts.LanguageService, c: GetConfig) => {
7-
const ignoreAutoImportSetting = getIgnoreAutoImportSetting(c)
7+
const ignoreAutoImportsSetting = getIgnoreAutoImportSetting(c)
88

99
let newEntries = entries.filter(({ sourceDisplay, name }) => {
1010
if (!sourceDisplay) return
1111
const targetModule = ts.displayPartsToString(sourceDisplay)
12-
const toIgnore = isAutoImportEntryShouldBeIgnored(ignoreAutoImportSetting, targetModule, name)
12+
const toIgnore = isAutoImportEntryShouldBeIgnored(ignoreAutoImportsSetting, targetModule, name)
1313
return !toIgnore
1414
})
1515
// todo I'm not sure of incomplete completion (wasnt tested)

0 commit comments

Comments
 (0)