Add suggest.jsdoc.generateReturns configuration.

This commit is contained in:
Qiming Zhao 2021-12-21 17:22:46 +08:00
parent cd16da88ef
commit 5a8c68fc60
3 changed files with 23 additions and 0 deletions

View file

@ -159,6 +159,9 @@ for guide of coc.nvim's configuration.
- `typescript.suggest.classMemberSnippets.enabled`: Enable/disable - `typescript.suggest.classMemberSnippets.enabled`: Enable/disable
snippet completions for class members. Requires using TypeScript 4.5+ in the snippet completions for class members. Requires using TypeScript 4.5+ in the
workspace, default: `true` workspace, default: `true`
- `typescript.suggest.jsdoc.generateReturns`: Enable/disable generating
`@return` annotations for JSDoc templates. Requires using TypeScript 4.2+ in
the workspace. default: `true`
- `typescript.format.enabled`:Enable/disable format of typescript files. - `typescript.format.enabled`:Enable/disable format of typescript files.
- `typescript.format.insertSpaceAfterCommaDelimiter` default: `true` - `typescript.format.insertSpaceAfterCommaDelimiter` default: `true`
- `typescript.format.insertSpaceAfterConstructor` default: `false` - `typescript.format.insertSpaceAfterConstructor` default: `false`
@ -210,6 +213,9 @@ for guide of coc.nvim's configuration.
- `javascript.suggest.includeCompletionsForImportStatements`: Enable/disable - `javascript.suggest.includeCompletionsForImportStatements`: Enable/disable
auto-import-style completions on partially-typed import statements. Requires auto-import-style completions on partially-typed import statements. Requires
using TypeScript 4.3+ in the workspace, default: `true` using TypeScript 4.3+ in the workspace, default: `true`
- `javascript.suggest.jsdoc.generateReturns`: Enable/disable generating
`@return` annotations for JSDoc templates. Requires using TypeScript 4.2+ in
the workspace. default: `true`
- `javascript.suggest.classMemberSnippets.enabled`: Enable/disable - `javascript.suggest.classMemberSnippets.enabled`: Enable/disable
snippet completions for class members. Requires using TypeScript 4.5+ in the snippet completions for class members. Requires using TypeScript 4.5+ in the
workspace, default: `true` workspace, default: `true`

View file

@ -396,6 +396,12 @@
"description": "Enable/disable snippet completions for class members. Requires using TypeScript 4.5+ in the workspace", "description": "Enable/disable snippet completions for class members. Requires using TypeScript 4.5+ in the workspace",
"scope": "resource" "scope": "resource"
}, },
"typescript.suggest.jsdoc.generateReturns": {
"type": "boolean",
"default": true,
"markdownDescription": "Enable/disable generating `@return` annotations for JSDoc templates. Requires using TypeScript 4.2+ in the workspace.",
"scope": "resource"
},
"typescript.format.enabled": { "typescript.format.enabled": {
"type": "boolean", "type": "boolean",
"default": true, "default": true,
@ -622,6 +628,12 @@
"description": "Enable/disable snippet completions for class members. Requires using TypeScript 4.5+ in the workspace", "description": "Enable/disable snippet completions for class members. Requires using TypeScript 4.5+ in the workspace",
"scope": "resource" "scope": "resource"
}, },
"javascript.suggest.jsdoc.generateReturns": {
"type": "boolean",
"default": true,
"markdownDescription": "Enable/disable generating `@return` annotations for JSDoc templates. Requires using TypeScript 4.2+ in the workspace.",
"scope": "resource"
},
"javascript.format.enabled": { "javascript.format.enabled": {
"type": "boolean", "type": "boolean",
"default": true, "default": true,

View file

@ -41,6 +41,7 @@ export interface SuggestOptions {
readonly includeCompletionsForImportStatements: boolean readonly includeCompletionsForImportStatements: boolean
readonly includeCompletionsWithSnippetText: boolean readonly includeCompletionsWithSnippetText: boolean
readonly includeCompletionsWithClassMemberSnippets: boolean readonly includeCompletionsWithClassMemberSnippets: boolean
readonly generateReturnInDocTemplate: boolean
} }
export default class FileConfigurationManager { export default class FileConfigurationManager {
@ -160,6 +161,7 @@ export default class FileConfigurationManager {
paths: config.get<boolean>('paths', true), paths: config.get<boolean>('paths', true),
completeFunctionCalls: config.get<boolean>('completeFunctionCalls', true), completeFunctionCalls: config.get<boolean>('completeFunctionCalls', true),
autoImports: config.get<boolean>('autoImports', true), autoImports: config.get<boolean>('autoImports', true),
generateReturnInDocTemplate: config.get<boolean>('jsdoc.generateReturns', true),
importStatementSuggestions: config.get<boolean>('importStatements', true), importStatementSuggestions: config.get<boolean>('importStatements', true),
includeCompletionsForImportStatements: config.get<boolean>('includeCompletionsForImportStatements', true), includeCompletionsForImportStatements: config.get<boolean>('includeCompletionsForImportStatements', true),
includeCompletionsWithSnippetText: config.get<boolean>('includeCompletionsWithSnippetText', true), includeCompletionsWithSnippetText: config.get<boolean>('includeCompletionsWithSnippetText', true),
@ -182,7 +184,10 @@ export default class FileConfigurationManager {
jsxAttributeCompletionStyle: getJsxAttributeCompletionStyle(config), jsxAttributeCompletionStyle: getJsxAttributeCompletionStyle(config),
allowTextChangesInNewFiles: uri.startsWith('file:'), allowTextChangesInNewFiles: uri.startsWith('file:'),
allowRenameOfImportPath: true, allowRenameOfImportPath: true,
// can't support it with coc.nvim by now.
provideRefactorNotApplicableReason: false,
providePrefixAndSuffixTextForRename: config.get<boolean>('renameShorthandProperties', true) === false ? false : config.get<boolean>('useAliasesForRenames', true), providePrefixAndSuffixTextForRename: config.get<boolean>('renameShorthandProperties', true) === false ? false : config.get<boolean>('useAliasesForRenames', true),
generateReturnInDocTemplate: suggestConfig.generateReturnInDocTemplate,
includeCompletionsForImportStatements: suggestConfig.includeCompletionsForImportStatements, includeCompletionsForImportStatements: suggestConfig.includeCompletionsForImportStatements,
includeCompletionsWithClassMemberSnippets: suggestConfig.includeCompletionsWithClassMemberSnippets, includeCompletionsWithClassMemberSnippets: suggestConfig.includeCompletionsWithClassMemberSnippets,
includeCompletionsWithSnippetText: suggestConfig.includeCompletionsWithSnippetText, includeCompletionsWithSnippetText: suggestConfig.includeCompletionsWithSnippetText,