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

Missing TextEditorOptions.indentSize API type #168836

Closed
tao-cumplido opened this issue Dec 12, 2022 · 4 comments
Closed

Missing TextEditorOptions.indentSize API type #168836

tao-cumplido opened this issue Dec 12, 2022 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release regression Something that used to work is now broken verified Verification succeeded

Comments

@tao-cumplido
Copy link

Setting the TextEditorOptions.tabSize setting in an extension behaves differently since the introduction of the new indentSize setting, as it only sets the tab size and not anymore the indent size, which, as I understand it, is intended behavior (#168745). Now, there is no indentSize property on the TextEditorOptions interface, ignoring TypeScript and setting it anyway does work though.

This currently affects the EditorConfig extension. See editorconfig/editorconfig-vscode#341 (comment)

@sbatten sbatten assigned alexdima and unassigned sbatten Dec 12, 2022
@alexdima alexdima added the regression Something that used to work is now broken label Dec 12, 2022
@alexdima alexdima added this to the November 2022 Recovery 1 milestone Dec 12, 2022
@alexdima alexdima added the candidate Issue identified as probable candidate for fixing in the next release label Dec 12, 2022
alexdima added a commit that referenced this issue Dec 13, 2022
alexdima added a commit that referenced this issue Dec 13, 2022
@alexdima alexdima added the bug Issue identified by VS Code Team member as probable bug label Dec 13, 2022
@alexdima
Copy link
Member

To reproduce, you can use the following settings:

{
	"editor.tabSize": 2,
	"editor.detectIndentation": false,
	"editor.insertSpaces": true
}

And then the following extension:

  • package.json:
{
    "name": "168836",
    "publisher": "alex",
    "version": "1.0.0",
    "engines": {"vscode": "^1.22.0"},
    "main": "main.js",
    "activationEvents": ["*"]
}
  • main.js:
const vscode = require('vscode');
exports.activate = function(context) {
    setTimeout(() => {
        console.log(`SETTING tabSize to 4`);
        vscode.window.activeTextEditor.options.tabSize = 4;
    }, 3000);
}

alexdima added a commit that referenced this issue Dec 13, 2022
… configured to be equal to `tabSize` (#168984)

Updating `tabSize` should also update `indentSize` if `indentSize` is configured to be equal to `tabSize` (#168836)
aeschli pushed a commit that referenced this issue Dec 13, 2022
#168986)

Fixes #168836: When `tabSize` is set via API, also set `indentSize` to the same value
@aeschli
Copy link
Contributor

aeschli commented Dec 13, 2022

Fixed by #168986

@aeschli aeschli closed this as completed Dec 13, 2022
@fwcd
Copy link
Contributor

fwcd commented Dec 13, 2022

Is adding TextEditorOptions.indentSize to the API still planned?

Edit: Ah, I just found the proposed API

@rzhao271 rzhao271 added the verified Verification succeeded label Dec 13, 2022
mustard-mh pushed a commit to gitpod-io/openvscode-server that referenced this issue Dec 14, 2022
… configured to be equal to `tabSize` (microsoft#168984)

Updating `tabSize` should also update `indentSize` if `indentSize` is configured to be equal to `tabSize` (microsoft#168836)
@abdella0983
Copy link

R3CM90C7F9W

@github-actions github-actions bot locked and limited conversation to collaborators Jan 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release regression Something that used to work is now broken verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

9 participants