Skip to content
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

Object property with quotes will not show in auto complete hints #1804

Closed
3 tasks done
littlee opened this issue Mar 24, 2020 · 4 comments · Fixed by #1808
Closed
3 tasks done

Object property with quotes will not show in auto complete hints #1804

littlee opened this issue Mar 24, 2020 · 4 comments · Fixed by #1808

Comments

@littlee
Copy link

littlee commented Mar 24, 2020

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform: macOS
  • Vetur version: 0.24.0
  • VS Code version: 1.43.1

Problem

Object property with quotes will not show in auto complete hints

WX20200324-173222

Reproducible Case

create a .vue file and a .js file
a.vue

<template>
</template>
<script>
import a from './a';
a.
</script>

a.js

export default {
  中文: 1,
  pp: 1,
  'pp-1': 1,
  '中文-1': 1
};
@yoyo930021
Copy link
Member

yoyo930021 commented Mar 25, 2020

It's a TypeScript feature.
https://www.typescriptlang.org/play/index.html?ssl=1&ssc=1&pln=9&pc=1#code/MYewdgzgLgBCCGIYF4YG8BQNswOSFo5QcNNcAuGARgBosdyyAmanGCAU2DIGYmcDCBaeqRgAWDAF8MGBCAB0RDEA

- is not a valid property name.
You can't input a.中文-1, but a['中文-1'] is correct.
If you want this feature, please open issue to https://github.com/microsoft/TypeScript.

@littlee
Copy link
Author

littlee commented Mar 25, 2020

but it works fine inside .js files

截屏2020-03-26上午12 58 48

@yoyo930021
Copy link
Member

yoyo930021 commented Mar 26, 2020

This problem exists in almost all online editors.
It's a LSP spec implement bug.

XD

@kdlslyv
Copy link

kdlslyv commented Apr 1, 2020

Awesome @yoyo930021 - I just stumbled across the same issue in *.vue files.
In *.ts files the autocomplete of props with hyphen works too.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants