提交 f7498f0b 编写于 作者: M Matt Bierner

Fixes #21056 dont auto show jsdoc as often

上级 0ae05b9f
......@@ -19,7 +19,7 @@ const tryCompleteJsDocCommand = '_typeScript.tryCompleteJsDoc';
class JsDocCompletionItem extends CompletionItem {
constructor(file: Uri, position: Position) {
super('/** @param */', CompletionItemKind.Text);
this.documentation = localize('typescript.jsDocCompletionItem.documentation', 'JSDoc comment');
this.detail = localize('typescript.jsDocCompletionItem.documentation', 'JSDoc comment');
this.insertText = '';
this.sortText = '\0';
this.command = {
......@@ -83,13 +83,13 @@ export default class JsDocCompletionHelper implements CompletionItemProvider {
const line = document.lineAt(position.line).text;
// Ensure line starts with '/**' then cursor
const prefix = line.slice(0, position.character).match(/^\s*(\/\*\*+)\s*$/);
const prefix = line.slice(0, position.character).match(/^\s*(\/\*\*+)$/);
if (prefix === null) {
return false;
}
// Ensure there is no content after the cursor besides possibly the end of the comment
const suffix = line.slice(position.character).match(/^\s*\**\/?$/);
// Ensure there is no content after the cursor besides the end of the comment
const suffix = line.slice(position.character).match(/^\s*\*+\/$/);
return suffix !== null;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册