mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
Autofill for JSDocs (#20625)
* Add autofill for JSDocs
Adds prototype of autofill for jsdoc comments. For code like:
```js
/**|
function mul(x, y) {
return x * y;
}
```
When you press return, we will complete it to:
```js
/**
*
* @param x
* @param y
*/
function mul(x, y) {
return x * y;
}
```
In Typescript and to:
```js
/**
*
* @param {any} x
* @param {any} y
*/
function mul(x, y) {
return x + y;
}
```
In JavaScript
* Handle revert case better
* Disable on enter when suggestion is visible
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
"onCommand:typescript.selectTypeScriptVersion",
|
||||
"onCommand:javascript.goToProjectConfig",
|
||||
"onCommand:typescript.goToProjectConfig",
|
||||
"onCommand:_typescript.tryCompleteJsDoc",
|
||||
"workspaceContains:jsconfig.json",
|
||||
"workspaceContains:tsconfig.json"
|
||||
],
|
||||
@@ -83,6 +84,18 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"keybindings": [
|
||||
{
|
||||
"key": "enter",
|
||||
"command": "_typescript.tryCompleteJsDoc",
|
||||
"when": "editorTextFocus && !suggestWidgetVisible && editorLangId == 'typescript'"
|
||||
},
|
||||
{
|
||||
"key": "enter",
|
||||
"command": "_typescript.tryCompleteJsDoc",
|
||||
"when": "editorTextFocus && !suggestWidgetVisible && editorLangId == 'javascript'"
|
||||
}
|
||||
],
|
||||
"configuration": {
|
||||
"type": "object",
|
||||
"title": "%configuration.typescript%",
|
||||
@@ -279,7 +292,7 @@
|
||||
"title": "%typescript.goToProjectConfig.title%",
|
||||
"category": "TypeScript"
|
||||
},
|
||||
{
|
||||
{
|
||||
"command": "javascript.goToProjectConfig",
|
||||
"title": "%javascript.goToProjectConfig.title%",
|
||||
"category": "JavaScript"
|
||||
|
||||
Reference in New Issue
Block a user