Skip to content

Suggest completions for newline-delimited type argument properties #62175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

mkantor
Copy link
Contributor

@mkantor mkantor commented Aug 2, 2025

Fixes #62117.

@mkantor
Copy link
Contributor Author

mkantor commented Aug 2, 2025

This is vaguely related to #62170 (at least inasmuch as that my work on #62170 was how I knew where to look to fix this).

@i-ayushh18
Copy link

🤖 AI Assistant: Task completed: PR #62175: Suggest completions for newline-delimited type argument properties

URL: https://github.c...

1 similar comment
@i-ayushh18
Copy link

🤖 AI Assistant: Task completed: PR #62175: Suggest completions for newline-delimited type argument properties

URL: https://github.c...

@@ -5757,6 +5757,7 @@ function tryGetTypeLiteralNode(node: Node): TypeLiteralNode | undefined {
case SyntaxKind.SemicolonToken:
case SyntaxKind.CommaToken:
case SyntaxKind.Identifier:
case SyntaxKind.StringKeyword:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me this PR focuses on StringKeyword but what about other tokens? Like even the NumberKeyword? And doesn't this change mean that now completions would be suggested at the same line too (like at five: string /*marker*/)?

Copy link
Contributor Author

@mkantor mkantor Aug 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, you're right. I must've had a brain fart this morning; I think I read StringKeyword as StringKey and thought it referred to property names, but in retrospect that obviously doesn't make sense. I'll close this for now and reopen with a more general fix when I have a chance. Thanks for the comments.

@@ -17,7 +17,7 @@
////var foobar: Bar<{
//// two: {
//// three: {
//// five: string,
//// five: string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add a new test case instead of removing the comma from the old one. The old test case is different and it's still worth testing it.

@mkantor mkantor closed this Aug 3, 2025
@github-project-automation github-project-automation bot moved this from Not started to Done in PR Backlog Aug 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants