Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Fix in/when dedent with language configuration #897

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

vinistock
Copy link
Member

Motivation

Fixes part of Shopify/ruby-lsp#1734

The issue with the indentation is the Ruby language configuration defined inside VS Code itself. We can expose a configuration to fix it temporarily, but we will upstream this to VS Code itself so that we don't have to bundle one.

Implementation

Instead of decreasing the indentation on in|when, we only decrease on (in|when)\s which waits for a single space to do it. That way, things like include will never match and not reduce the indendation.

@vinistock vinistock added the bugfix This PR will fix an existing bug label Nov 15, 2023
@vinistock vinistock self-assigned this Nov 15, 2023
@vinistock vinistock requested a review from a team as a code owner November 15, 2023 01:46
@vinistock vinistock requested review from Morriar and st0012 November 15, 2023 01:46
This is a temporary fix. We will submit a PR to fix this upstream in
vscode itself, so that we don't need to bundle a language configuration
file

Co-authored-by: Soutaro Matsumoto <[email protected]>
@vinistock vinistock force-pushed the vs/fix_in_and_when_dedent branch from 89af3a7 to 77e88bf Compare November 15, 2023 01:47
@vinistock
Copy link
Member Author

Upstream PR microsoft/vscode#198349.

@vinistock
Copy link
Member Author

No reviews on the upstream PR yet, so I will merge this one so that we can improve the experience for now.

Once the upstream PR is merged, we can revert this one and just rely on VS Code to do the right thing.

@vinistock vinistock merged commit ef066cc into main Nov 22, 2023
4 checks passed
@vinistock vinistock deleted the vs/fix_in_and_when_dedent branch November 22, 2023 19:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bugfix This PR will fix an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants