diff --git a/Readme.md b/Readme.md index c368060..4cea2e2 100644 --- a/Readme.md +++ b/Readme.md @@ -274,6 +274,11 @@ for guide of coc.nvim's configuration. - `javascript.suggest.completeJSDocs` `typescript.suggest.completeJSDocs`: Enable/disable suggestion to complete JSDoc comments. default: `true` +### Added on 1.10.1 +- `typescript.suggest.objectLiteralMethodSnippets.enabled` + `javascript.suggest.objectLiteralMethodSnippets.enabled`: + Enable/disable snippet completions for methods in object literals. Requires using TypeScript 4.7+ in the workspace + Configurations are the same as with VSCode. Install [coc-json](https://github.com/neoclide/coc-json) and try completion with `tsserver`, `typescript` or `javascript` in your diff --git a/package.json b/package.json index 296ad6f..c8bd588 100644 --- a/package.json +++ b/package.json @@ -875,6 +875,18 @@ "type": "boolean", "default": true, "description": "Enable/disable suggestion to complete JSDoc comments." + }, + "javascript.suggest.objectLiteralMethodSnippets.enabled": { + "type": "boolean", + "default": true, + "description": "Enable/disable snippet completions for methods in object literals. Requires using TypeScript 4.7+ in the workspace", + "scope": "resource" + }, + "typescript.suggest.objectLiteralMethodSnippets.enabled": { + "type": "boolean", + "default": true, + "description": "Enable/disable snippet completions for methods in object literals. Requires using TypeScript 4.7+ in the workspace", + "scope": "resource" } } }, diff --git a/src/server/features/fileConfigurationManager.ts b/src/server/features/fileConfigurationManager.ts index 1c5b94d..42d9acc 100644 --- a/src/server/features/fileConfigurationManager.ts +++ b/src/server/features/fileConfigurationManager.ts @@ -161,6 +161,8 @@ export default class FileConfigurationManager { paths: config.get('paths', true), completeFunctionCalls: config.get('completeFunctionCalls', true), autoImports: config.get('autoImports', true), + // @ts-expect-error until 4.7 + includeCompletionsWithObjectLiteralMethodSnippets: config.get('suggest.objectLiteralMethodSnippets.enabled', true), generateReturnInDocTemplate: config.get('jsdoc.generateReturns', true), importStatementSuggestions: config.get('importStatements', true), includeCompletionsForImportStatements: config.get('includeCompletionsForImportStatements', true),