mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 02:33:53 -06:00
Don’t suppress completions after yield (#37609)
This commit is contained in:
parent
4567fc4f1a
commit
a04225dbec
@ -2159,7 +2159,6 @@ namespace ts.Completions {
|
||||
case SyntaxKind.ImportKeyword:
|
||||
case SyntaxKind.LetKeyword:
|
||||
case SyntaxKind.ConstKeyword:
|
||||
case SyntaxKind.YieldKeyword:
|
||||
case SyntaxKind.TypeKeyword: // type htm|
|
||||
return true;
|
||||
|
||||
@ -2200,7 +2199,6 @@ namespace ts.Completions {
|
||||
case SyntaxKind.PublicKeyword:
|
||||
case SyntaxKind.StaticKeyword:
|
||||
case SyntaxKind.VarKeyword:
|
||||
case SyntaxKind.YieldKeyword:
|
||||
return true;
|
||||
case SyntaxKind.AsyncKeyword:
|
||||
return isPropertyDeclaration(contextToken.parent);
|
||||
|
||||
@ -3,5 +3,4 @@
|
||||
////var x;
|
||||
////var y = function* gen(p) { yield /*1*/
|
||||
|
||||
// These tentatively don't work.
|
||||
verify.completions({ marker: "1", exact: undefined });
|
||||
verify.completions({ marker: "1", includes: ["x", "y", "gen", "p", ...completion.globalsVars] });
|
||||
|
||||
20
tests/cases/fourslash/completionsImportYieldExpression.ts
Normal file
20
tests/cases/fourslash/completionsImportYieldExpression.ts
Normal file
@ -0,0 +1,20 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @Filename: /a.ts
|
||||
////export function a() {}
|
||||
|
||||
// @Filename: /b.ts
|
||||
////function *f() {
|
||||
//// yield a/**/
|
||||
////}
|
||||
|
||||
verify.applyCodeActionFromCompletion("", {
|
||||
name: "a",
|
||||
source: "/a",
|
||||
description: `Import 'a' from module "./a"`,
|
||||
newFileContent: `import { a } from "./a";
|
||||
|
||||
function *f() {
|
||||
yield a
|
||||
}`
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user