Use suggest for suggest configuration
This commit is contained in:
parent
48a515005b
commit
b930a7b193
5 changed files with 107 additions and 388 deletions
102
package.json
102
package.json
|
@ -1,11 +1,11 @@
|
||||||
{
|
{
|
||||||
"name": "coc-tsserver",
|
"name": "coc-tsserver",
|
||||||
"version": "1.0.11",
|
"version": "1.1.0",
|
||||||
"description": "tsserver extension for coc",
|
"description": "tsserver extension for coc",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"publisher": "chemzqm",
|
"publisher": "chemzqm",
|
||||||
"engines": {
|
"engines": {
|
||||||
"coc": "^0.0.15"
|
"coc": "^0.0.24"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rimraf lib",
|
"clean": "rimraf lib",
|
||||||
|
@ -167,31 +167,6 @@
|
||||||
"default": true,
|
"default": true,
|
||||||
"description": "Enable codeLens for references"
|
"description": "Enable codeLens for references"
|
||||||
},
|
},
|
||||||
"typescript.preferences.completion.useCodeSnippetsOnMethodSuggest": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true,
|
|
||||||
"description": "Enable snippet for method suggestion"
|
|
||||||
},
|
|
||||||
"typescript.preferences.completion.nameSuggestions": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true,
|
|
||||||
"description": "Complete for warning type of tsserver"
|
|
||||||
},
|
|
||||||
"typescript.preferences.completion.autoImportSuggestions": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true,
|
|
||||||
"description": "Enable auto import suggestions for completion"
|
|
||||||
},
|
|
||||||
"typescript.preferences.completion.commaAfterImport": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true,
|
|
||||||
"description": "Add comma after import"
|
|
||||||
},
|
|
||||||
"typescript.preferences.completion.moduleExports": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true,
|
|
||||||
"description": "Include completion for module.exports"
|
|
||||||
},
|
|
||||||
"typescript.preferences.importModuleSpecifier": {
|
"typescript.preferences.importModuleSpecifier": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "non-relative",
|
"default": "non-relative",
|
||||||
|
@ -212,6 +187,30 @@
|
||||||
"double"
|
"double"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"typescript.suggest.enabled": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
|
"typescript.suggest.paths": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true,
|
||||||
|
"description": "Enable/disable suggest paths in import statement and require calls"
|
||||||
|
},
|
||||||
|
"typescript.suggest.commaAfterImport": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true,
|
||||||
|
"description": "Add comma after import statement."
|
||||||
|
},
|
||||||
|
"typescript.suggest.autoImports": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true,
|
||||||
|
"description": "Enable/disable auto import suggests."
|
||||||
|
},
|
||||||
|
"typescript.suggest.completeFunctionCalls": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true,
|
||||||
|
"description": "Enable snippet for method suggestion"
|
||||||
|
},
|
||||||
"typescript.format.insertSpaceAfterCommaDelimiter": {
|
"typescript.format.insertSpaceAfterCommaDelimiter": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
|
@ -276,27 +275,6 @@
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"javascript.preferences.completion.useCodeSnippetsOnMethodSuggest": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"javascript.preferences.completion.nameSuggestions": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"javascript.preferences.completion.autoImportSuggestions": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"javascript.preferences.completion.commaAfterImport": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"javascript.preferences.completion.moduleExports": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true,
|
|
||||||
"description": "Include completion for module.exports"
|
|
||||||
},
|
|
||||||
"javascript.preferences.importModuleSpecifier": {
|
"javascript.preferences.importModuleSpecifier": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "non-relative",
|
"default": "non-relative",
|
||||||
|
@ -317,6 +295,34 @@
|
||||||
"double"
|
"double"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"javascript.suggest.names": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
|
"javascript.suggest.enabled": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
|
"javascript.suggest.paths": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true,
|
||||||
|
"description": "Enable/disable suggest paths in import statement and require calls"
|
||||||
|
},
|
||||||
|
"javascript.suggest.commaAfterImport": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true,
|
||||||
|
"description": "Add comma after import statement."
|
||||||
|
},
|
||||||
|
"javascript.suggest.autoImports": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true,
|
||||||
|
"description": "Enable/disable auto import suggests."
|
||||||
|
},
|
||||||
|
"javascript.suggest.completeFunctionCalls": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true,
|
||||||
|
"description": "Enable snippet for method suggestion"
|
||||||
|
},
|
||||||
"javascript.format.insertSpaceAfterCommaDelimiter": {
|
"javascript.format.insertSpaceAfterCommaDelimiter": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
|
|
|
@ -14,7 +14,7 @@ import { convertCompletionEntry, resolveItem } from '../utils/completionItem'
|
||||||
import * as Previewer from '../utils/previewer'
|
import * as Previewer from '../utils/previewer'
|
||||||
import * as typeConverters from '../utils/typeConverters'
|
import * as typeConverters from '../utils/typeConverters'
|
||||||
import TypingsStatus from '../utils/typingsStatus'
|
import TypingsStatus from '../utils/typingsStatus'
|
||||||
import FileConfigurationManager, { CompletionOptions } from './fileConfigurationManager'
|
import FileConfigurationManager, { SuggestOptions } from './fileConfigurationManager'
|
||||||
|
|
||||||
// command center
|
// command center
|
||||||
export interface CommandItem {
|
export interface CommandItem {
|
||||||
|
@ -50,7 +50,7 @@ class ApplyCompletionCodeActionCommand implements CommandItem {
|
||||||
export default class TypeScriptCompletionItemProvider implements CompletionItemProvider {
|
export default class TypeScriptCompletionItemProvider implements CompletionItemProvider {
|
||||||
|
|
||||||
public static readonly triggerCharacters = ['.', '@', '<']
|
public static readonly triggerCharacters = ['.', '@', '<']
|
||||||
private completeOption: CompletionOptions
|
private completeOption: SuggestOptions
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly client: ITypeScriptServiceClient,
|
private readonly client: ITypeScriptServiceClient,
|
||||||
|
@ -104,9 +104,9 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP
|
||||||
|
|
||||||
const args: Proto.CompletionsRequestArgs = {
|
const args: Proto.CompletionsRequestArgs = {
|
||||||
...typeConverters.Position.toFileLocationRequestArgs(file, position),
|
...typeConverters.Position.toFileLocationRequestArgs(file, position),
|
||||||
includeExternalModuleExports: completeOption.autoImportSuggestions,
|
includeExternalModuleExports: completeOption.autoImports,
|
||||||
includeInsertTextCompletions: true,
|
includeInsertTextCompletions: true,
|
||||||
triggerCharacter: triggerCharacter && triggerCharacter === '.' ? triggerCharacter : undefined
|
triggerCharacter: this.getTsTriggerCharacter(context)
|
||||||
}
|
}
|
||||||
|
|
||||||
let msg: Proto.CompletionEntry[] | undefined
|
let msg: Proto.CompletionEntry[] | undefined
|
||||||
|
@ -122,21 +122,14 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP
|
||||||
|
|
||||||
const completionItems: CompletionItem[] = []
|
const completionItems: CompletionItem[] = []
|
||||||
for (const element of msg) {
|
for (const element of msg) {
|
||||||
let { kind } = element
|
if (!shouldExcludeCompletionEntry(element, completeOption)) {
|
||||||
if (kind === PConst.Kind.warning
|
|
||||||
|| kind === PConst.Kind.script) {
|
|
||||||
if (!completeOption.nameSuggestions || triggerCharacter == '.') {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!completeOption.autoImportSuggestions && element.hasAction) {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
const item = convertCompletionEntry(
|
const item = convertCompletionEntry(
|
||||||
element,
|
element,
|
||||||
uri,
|
uri,
|
||||||
position,
|
position,
|
||||||
completeOption.useCodeSnippetsOnMethodSuggest,
|
completeOption.completeFunctionCalls,
|
||||||
)
|
)
|
||||||
completionItems.push(item)
|
completionItems.push(item)
|
||||||
}
|
}
|
||||||
|
@ -144,6 +137,17 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP
|
||||||
return completionItems
|
return completionItems
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getTsTriggerCharacter(context: CompletionContext): Proto.CompletionsTriggerCharacter | undefined {
|
||||||
|
// Workaround for https://github.com/Microsoft/TypeScript/issues/27321
|
||||||
|
if (context.triggerCharacter === '@'
|
||||||
|
&& this.client.apiVersion.gte(API.v310) && this.client.apiVersion.lt(API.v320)
|
||||||
|
) {
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
return context.triggerCharacter as Proto.CompletionsTriggerCharacter
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resolve complete item, could have documentation added
|
* Resolve complete item, could have documentation added
|
||||||
*
|
*
|
||||||
|
@ -347,6 +351,7 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP
|
||||||
if (!nameIsFollowedByOptionalIndicator) {
|
if (!nameIsFollowedByOptionalIndicator) {
|
||||||
if (hasAddedParameters) snippet += ', '
|
if (hasAddedParameters) snippet += ', '
|
||||||
hasAddedParameters = true
|
hasAddedParameters = true
|
||||||
|
// tslint:disable-next-line:no-invalid-template-strings
|
||||||
snippet += '${' + holderIndex + ':' + part.text + '}'
|
snippet += '${' + holderIndex + ':' + part.text + '}'
|
||||||
holderIndex = holderIndex + 1
|
holderIndex = holderIndex + 1
|
||||||
}
|
}
|
||||||
|
@ -365,6 +370,7 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (hasOptionalParameters) {
|
if (hasOptionalParameters) {
|
||||||
|
// tslint:disable-next-line:no-invalid-template-strings
|
||||||
snippet += '${' + holderIndex + '}'
|
snippet += '${' + holderIndex + '}'
|
||||||
}
|
}
|
||||||
snippet += ')'
|
snippet += ')'
|
||||||
|
@ -373,3 +379,15 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP
|
||||||
item.textEdit = textEdit
|
item.textEdit = textEdit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function shouldExcludeCompletionEntry(
|
||||||
|
element: Proto.CompletionEntry,
|
||||||
|
completionConfiguration: SuggestOptions
|
||||||
|
): boolean {
|
||||||
|
return (
|
||||||
|
(!completionConfiguration.names && element.kind === PConst.Kind.warning)
|
||||||
|
|| (!completionConfiguration.paths &&
|
||||||
|
(element.kind === PConst.Kind.directory || element.kind === PConst.Kind.script || element.kind === PConst.Kind.externalModuleName))
|
||||||
|
|| (!completionConfiguration.autoImports && element.hasAction)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
|
@ -30,11 +30,13 @@ interface FileConfiguration {
|
||||||
preferences: Proto.UserPreferences
|
preferences: Proto.UserPreferences
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CompletionOptions {
|
export interface SuggestOptions {
|
||||||
|
readonly enabled: boolean
|
||||||
|
readonly names: boolean
|
||||||
|
readonly paths: boolean
|
||||||
readonly commaAfterImport: boolean
|
readonly commaAfterImport: boolean
|
||||||
readonly useCodeSnippetsOnMethodSuggest: boolean
|
readonly completeFunctionCalls: boolean
|
||||||
readonly nameSuggestions: boolean
|
readonly autoImports: boolean
|
||||||
readonly autoImportSuggestions: boolean
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class FileConfigurationManager {
|
export default class FileConfigurationManager {
|
||||||
|
@ -120,14 +122,16 @@ export default class FileConfigurationManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public getCompleteOptions(languageId: string): CompletionOptions {
|
public getCompleteOptions(languageId: string): SuggestOptions {
|
||||||
const lang = this.isTypeScriptDocument(languageId) ? 'typescript' : 'javascript'
|
const lang = this.isTypeScriptDocument(languageId) ? 'typescript' : 'javascript'
|
||||||
const config = workspace.getConfiguration(`${lang}.preferences.completion`)
|
const config = workspace.getConfiguration(`${lang}.suggest`)
|
||||||
return {
|
return {
|
||||||
useCodeSnippetsOnMethodSuggest: config.get<boolean>('useCodeSnippetsOnMethodSuggest', true),
|
enabled: config.get<boolean>('enabled', true),
|
||||||
|
names: config.get<boolean>('names', true),
|
||||||
|
paths: config.get<boolean>('paths', true),
|
||||||
commaAfterImport: config.get<boolean>('commaAfterImport', true),
|
commaAfterImport: config.get<boolean>('commaAfterImport', true),
|
||||||
nameSuggestions: config.get<boolean>('nameSuggestions', true),
|
completeFunctionCalls: config.get<boolean>('completeFunctionCalls', true),
|
||||||
autoImportSuggestions: config.get<boolean>('autoImportSuggestions', true)
|
autoImports: config.get<boolean>('autoImports', true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,23 +139,20 @@ export default class FileConfigurationManager {
|
||||||
if (!this.client.apiVersion.gte(API.v290)) {
|
if (!this.client.apiVersion.gte(API.v290)) {
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
const config = workspace.getConfiguration(`${language}.preferences`)
|
const config = workspace.getConfiguration(`${language}`)
|
||||||
return {
|
return {
|
||||||
|
disableSuggestions: !config.get<boolean>('suggest.enabled', true),
|
||||||
importModuleSpecifierPreference: getImportModuleSpecifier(config) as any,
|
importModuleSpecifierPreference: getImportModuleSpecifier(config) as any,
|
||||||
disableSuggestions: !config.get<boolean>('suggestionActions.enabled', true),
|
quotePreference: config.get<'single' | 'double'>('preferences.quoteStyle', 'single'),
|
||||||
quotePreference: getQuoteType(config),
|
allowTextChangesInNewFiles: true,
|
||||||
includeCompletionsForModuleExports: config.get<boolean>('completion.moduleExports', true),
|
|
||||||
includeCompletionsWithInsertText: true,
|
|
||||||
allowTextChangesInNewFiles: false,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type ModuleImportType = 'relative' | 'non-relative' | 'auto'
|
type ModuleImportType = 'relative' | 'non-relative' | 'auto'
|
||||||
type QuoteType = 'single' | 'double'
|
|
||||||
|
|
||||||
function getImportModuleSpecifier(config): ModuleImportType {
|
function getImportModuleSpecifier(config): ModuleImportType {
|
||||||
let val = config.get('importModuleSpecifier')
|
let val = config.get('preferences.importModuleSpecifier')
|
||||||
switch (val) {
|
switch (val) {
|
||||||
case 'relative':
|
case 'relative':
|
||||||
return 'relative'
|
return 'relative'
|
||||||
|
@ -161,15 +162,3 @@ function getImportModuleSpecifier(config): ModuleImportType {
|
||||||
return 'auto'
|
return 'auto'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getQuoteType(config): QuoteType {
|
|
||||||
let val = config.get('quoteStyle')
|
|
||||||
switch (val) {
|
|
||||||
case 'single':
|
|
||||||
return 'single'
|
|
||||||
case 'double':
|
|
||||||
return 'double'
|
|
||||||
default:
|
|
||||||
return 'single'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,298 +0,0 @@
|
||||||
{
|
|
||||||
"$schema": "http://json-schema.org/draft-04/schema",
|
|
||||||
"properties": {
|
|
||||||
"tsserver.enable": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true,
|
|
||||||
"description": "Enable tsserver extension"
|
|
||||||
},
|
|
||||||
"tsserver.locale": {
|
|
||||||
"type": "string",
|
|
||||||
"default": "",
|
|
||||||
"description": "Locale of tsserver"
|
|
||||||
},
|
|
||||||
"tsserver.typingsCacheLocation": {
|
|
||||||
"type": "string",
|
|
||||||
"default": "",
|
|
||||||
"description": "Folder path for cache typings"
|
|
||||||
},
|
|
||||||
"tsserver.formatOnSave": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false,
|
|
||||||
"description": "Format document on buffer will save"
|
|
||||||
},
|
|
||||||
"tsserver.orgnizeImportOnSave": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false,
|
|
||||||
"description": "Orgnize import on buffer will save"
|
|
||||||
},
|
|
||||||
"tsserver.formatOnType": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true,
|
|
||||||
"description": "Run format on type special characters."
|
|
||||||
},
|
|
||||||
"tsserver.enableJavascript": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true,
|
|
||||||
"description": "Use tsserver for javascript files"
|
|
||||||
},
|
|
||||||
"tsserver.tsdk": {
|
|
||||||
"type": "string",
|
|
||||||
"default": "",
|
|
||||||
"description": "Directory contains tsserver.js, works for workspace only"
|
|
||||||
},
|
|
||||||
"tsserver.npm": {
|
|
||||||
"type": "string",
|
|
||||||
"default": "",
|
|
||||||
"description": "Executable path of npm for download typings"
|
|
||||||
},
|
|
||||||
"tsserver.log": {
|
|
||||||
"type": "string",
|
|
||||||
"default": "off",
|
|
||||||
"enum": ["normal", "terse", "verbose", "off"],
|
|
||||||
"description": "Log level of tsserver"
|
|
||||||
},
|
|
||||||
"tsserver.trace.server": {
|
|
||||||
"type": "string",
|
|
||||||
"default": "off",
|
|
||||||
"enum": ["off", "messages", "verbose"],
|
|
||||||
"description": "Trace level of tsserver"
|
|
||||||
},
|
|
||||||
"tserver.pluginNames": {
|
|
||||||
"type": "array",
|
|
||||||
"default": [],
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"description": "Module names of tsserver plugins"
|
|
||||||
},
|
|
||||||
"tsserver.pluginRoot": {
|
|
||||||
"type": "string",
|
|
||||||
"default": "",
|
|
||||||
"description": "Folder contains tsserver plugins"
|
|
||||||
},
|
|
||||||
"tsserver.debugPort": {
|
|
||||||
"type": "number",
|
|
||||||
"description": "Debug port number of tsserver"
|
|
||||||
},
|
|
||||||
"tsserver.reportStyleChecksAsWarnings": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"tsserver.implicitProjectConfig.checkJs": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false,
|
|
||||||
"description": "Enable checkJs for implicit project"
|
|
||||||
},
|
|
||||||
"tsserver.implicitProjectConfig.experimentalDecorators": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false,
|
|
||||||
"description": "Enable experimentalDecorators for implicit project"
|
|
||||||
},
|
|
||||||
"tsserver.disableAutomaticTypeAcquisition": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false,
|
|
||||||
"description": "Disable download of typings"
|
|
||||||
},
|
|
||||||
"typescript.updateImportsOnFileMove.enable": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true,
|
|
||||||
"description": "Enable update imports on file move."
|
|
||||||
},
|
|
||||||
"typescript.implementationsCodeLens.enable": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true,
|
|
||||||
"description": "Enable codeLens for implementations"
|
|
||||||
},
|
|
||||||
"typescript.referencesCodeLens.enable": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true,
|
|
||||||
"description": "Enable codeLens for references"
|
|
||||||
},
|
|
||||||
"typescript.preferences.completion.useCodeSnippetsOnMethodSuggest": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true,
|
|
||||||
"description": "Enable snippet for method suggestion"
|
|
||||||
},
|
|
||||||
"typescript.preferences.completion.nameSuggestions": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true,
|
|
||||||
"description": "Complete for warning type of tsserver"
|
|
||||||
},
|
|
||||||
"typescript.preferences.completion.autoImportSuggestions": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true,
|
|
||||||
"description": "Enable auto import suggestions for completion"
|
|
||||||
},
|
|
||||||
"typescript.preferences.completion.commaAfterImport": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true,
|
|
||||||
"description": "Add comma after import"
|
|
||||||
},
|
|
||||||
"typescript.preferences.completion.moduleExports": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true,
|
|
||||||
"description": "Include completion for module.exports"
|
|
||||||
},
|
|
||||||
"typescript.preferences.importModuleSpecifier": {
|
|
||||||
"type": "string",
|
|
||||||
"default": "non-relative",
|
|
||||||
"enum": ["non-relative", "relative"]
|
|
||||||
},
|
|
||||||
"typescript.preferences.suggestionActions.enabled": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"typescript.preferences.quoteStyle": {
|
|
||||||
"type": "string",
|
|
||||||
"default": "single",
|
|
||||||
"enum": ["single", "double"]
|
|
||||||
},
|
|
||||||
"typescript.format.insertSpaceAfterCommaDelimiter": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"typescript.format.insertSpaceAfterConstructor": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"typescript.format.insertSpaceAfterSemicolonInForStatements": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"typescript.format.insertSpaceBeforeAndAfterBinaryOperators": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"typescript.format.insertSpaceAfterKeywordsInControlFlowStatements": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"typescript.format.insertSpaceBeforeFunctionParenthesis": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"typescript.format.insertSpaceAfterTypeAssertion": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"typescript.format.placeOpenBraceOnNewLineForFunctions": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"typescript.format.placeOpenBraceOnNewLineForControlBlocks": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"javascript.updateImportsOnFileMove.enable": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"javascript.implementationsCodeLens.enable": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"javascript.referencesCodeLens.enable": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"javascript.preferences.completion.useCodeSnippetsOnMethodSuggest": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"javascript.preferences.completion.nameSuggestions": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"javascript.preferences.completion.autoImportSuggestions": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"javascript.preferences.importModuleSpecifier": {
|
|
||||||
"type": "string",
|
|
||||||
"default": "non-relative",
|
|
||||||
"enum": ["non-relative", "relative"]
|
|
||||||
},
|
|
||||||
"javascript.preferences.suggestionActions.enabled": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"javascript.preferences.completion.commaAfterImport": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"javascript.preferences.quoteStyle": {
|
|
||||||
"type": "string",
|
|
||||||
"default": "single",
|
|
||||||
"enum": ["single", "double"]
|
|
||||||
},
|
|
||||||
"javascript.format.insertSpaceAfterCommaDelimiter": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"javascript.format.insertSpaceAfterConstructor": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"javascript.format.insertSpaceAfterSemicolonInForStatements": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"javascript.format.insertSpaceBeforeAndAfterBinaryOperators": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"javascript.format.insertSpaceAfterKeywordsInControlFlowStatements": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"javascript.format.insertSpaceBeforeFunctionParenthesis": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"javascript.format.insertSpaceAfterTypeAssertion": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"javascript.format.placeOpenBraceOnNewLineForFunctions": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"javascript.format.placeOpenBraceOnNewLineForControlBlocks": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -52,4 +52,8 @@ export default class API {
|
||||||
public gte(other: API): boolean {
|
public gte(other: API): boolean {
|
||||||
return semver.gte(this.version, other.version)
|
return semver.gte(this.version, other.version)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public lt(other: API): boolean {
|
||||||
|
return !this.gte(other)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue