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

Make use of trailing semicolons optional #39802

Closed
demisx opened this issue Dec 6, 2017 · 5 comments
Closed

Make use of trailing semicolons optional #39802

demisx opened this issue Dec 6, 2017 · 5 comments
Assignees
Labels
info-needed Issue requires more information from poster javascript JavaScript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@demisx
Copy link

demisx commented Dec 6, 2017

Many programmers are no longer using a semicolon to terminate code lines in languages where it's optional. Our team doesn't use trailing ; when programming in TypeScript and/or JavaScript. However, when Intellisense inserts a line, it automatically terminates it with ;. Would be really helpful if the option whether to end each line with a semicolon or not was configurable globally per language. Then, Intellisense and other plugins could honor it to make one's coding more efficient.

  • VSCode Version: 1.18.1
  • OS Version: macOS High Sierra 10.13.1

Steps to Reproduce:

  1. Remove import statement for an existing type
  2. Accept Intellisense suggestion to add import statement
  3. When import is added a ; is auto added at the end of the line

Reproduces without extensions: Yes

@vscodebot vscodebot bot assigned mjbvz Dec 6, 2017
@vscodebot vscodebot bot added the javascript JavaScript support issues label Dec 6, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented Dec 6, 2017

Can you please explain what specific action is triggering the semicolon to be inserted?

@mjbvz mjbvz added the info-needed Issue requires more information from poster label Dec 6, 2017
@demisx
Copy link
Author

demisx commented Dec 6, 2017

Sure. It's just as I wrote in the description pretty much:

  1. Let's say I write this line where IAd is a new type:
const ad: IAd = ctx.request.body
  1. The TypeScript Intellisense kicks in and suggests me to import it, i.e.
    screen shot 2017-12-06 at 10 32 47 am

  2. I accept the suggestion and this is what's added to the import block. Note the trailing ;

import IAd from './ad.interface';

I'd like to be able to instruct VS Code that I don't use ending semicolons in some language, e.g. TypeScript, JavaScript etc. And then have Intellisense, plugins, snippets to honor that setting. Currently, I have to take care of the semicolons myself and that makes coding less efficient.

Hope this helps. Please let me know if you need more info.

@mjbvz
Copy link
Collaborator

mjbvz commented Dec 6, 2017

Thanks for the additional info. This falls under microsoft/TypeScript#18780 and microsoft/TypeScript#19882

Using the TSlint workaround from the SO question may help for now: https://stackoverflow.com/a/47667384/306149

Closing as upstream

@mjbvz mjbvz closed this as completed Dec 6, 2017
@mjbvz mjbvz added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Dec 6, 2017
@demisx
Copy link
Author

demisx commented Dec 6, 2017

@mjbvz Thanks. Will those cover other languages (besides TypeScript) that also have ; optional?

@mjbvz
Copy link
Collaborator

mjbvz commented Dec 6, 2017

Yes, those issues apply to both JavaScript and TypeScript. The TypeScript project is what provides our JS language support

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster javascript JavaScript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

2 participants