microsoft / microsoft/TypeScript

Completions broken in setup function return object literal for vue

Open
#43,612 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Domain: LS: Completion Lists Experience Enhancement Experimentation Needed Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

Bug Report

🔎 Search Terms

completions return 'object literal shorthands'

🕗 Version & Regression Information
  • This changed between versions 4.2.0 and 4.2.3
⏯ Playground Link

Playground link with relevant code

💻 Code
import { defineComponent } from '@vue/runtime-core'

export default defineComponent({
  name: 'App',
  setup () {
    const waitingForAutocomplete = true;

    const a = {
      wait // get `waitingForAutocomplete`
    }

    return {
      wait // don't get any completion
    }
  }
})
🙁 Actual behavior

We can't get any completion for object literal shorthand in setup return.

🙂 Expected behavior

Like common object literal shorthand.

Ref: https://github.com/microsoft/TypeScript/issues/41259 https://github.com/microsoft/TypeScript/pull/41539
From: https://github.com/vuejs/vetur/issues/2544

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked TypeScript Playground reproduction and compare completion behavior for the ordinary object literal with the setup return object. Read the related issues 41259 and pull request 41539, then verify that shorthand properties in the setup return receive the expected completion.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.