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

Autodetect indentSize takes template literal into account #4720

Closed
SamVerschueren opened this issue Mar 28, 2016 · 3 comments
Closed

Autodetect indentSize takes template literal into account #4720

SamVerschueren opened this issue Mar 28, 2016 · 3 comments
Labels
feature-request Request for new features or functionality
Milestone

Comments

@SamVerschueren
Copy link
Contributor

  • VSCode Version: 0.10.11
  • OS Version: Mac OS X 10.11.3

Steps to Reproduce:

  1. Open a new project and make sure editor.tabSize is set to auto
  2. Create a new file test.js with the following contents
'use strict';

const multiline = `
  this is a multiline
  string with 2 space indentation
`;

function log(str) {
    console.log(str);
}

log(multiline);

Note: The indentation inside the log function is a tab but GitHub parses it to 4 spaces. So make sure to convert this to a tab when copy-pasting.

  1. Close the file and reopen it

screen shot 2016-03-28 at 21 33 32

As you can see, it sets the tabSize to 2 because it is 2 in the multiline template literal. But it shouldn't take strings into account to determine this.

// @alexandrudima

@Tyriar Tyriar added feature-request Request for new features or functionality workbench labels Mar 28, 2016
@alexdima
Copy link
Member

I think the feature request label is appropriate for now...

The indentation detection code is language agnostic, so it just looks at the file contents (not at the tokens).

If we ever change that code to first tokenize the file and then guess, I agree that lines in multiline strings and lines in multiline comments should be omitted from the detection.

@alexdima alexdima added editor and removed workbench labels Mar 29, 2016
@SamVerschueren
Copy link
Contributor Author

👍

@alexdima alexdima added this to the Backlog milestone Oct 27, 2016
@alexdima alexdima removed their assignment Oct 27, 2016
@alexdima
Copy link
Member

To keep the number of issues in our inbox at a manageable level, we're closing issues that have been on the backlog for a long time but haven't gained traction: we look at the number of votes the issue has received and the number of duplicate issues filed. Thank you for your time and understanding.

P.S. If you disagree and feel that this issue is crucial: we're happy to listen and to reconsider.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 7, 2018
Tyriar added a commit that referenced this issue Apr 12, 2024
This will overlay the terminal inline chat widget on top of the terminal the same
as previously where the cursor would be visible. If it would not be visible, the
terminal wrapper element is now shifted upwards to ensure it's visible. This comes
with a couple of downsides:

- The very top of the terminal cannot be accessed as overflow is clipped by the
  view.
- The chat may overlap content if there is any below the cursor, which is an
  unlikely edge case.

This isn't as good as a zone widget-like system in xterm.js could be, but that is
quite the undertaking and complicates the renderer code quite a bit. So this is
a good compromise.

Fixes #4720
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

3 participants