You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
As I said in #59339, our existing behavior, implemented based on vscode's behavior, is that whenever isNewIdentifierLocation is true, we disable all commit characters, otherwise the commit characters are ., ,, ;.
However, there have been issues opened over time that this approach is too conservative.
This PR enables some of the usual commit characters in some places where isNewIdentifierLocation is true and that previously we'd enable no commit characters.
Mainly, this PR enables all the three commit characters in every position where an expression is expected. In some of those positions, where we are inside an open parenthesis, the user could be typing a parameter list for an arrow expression, so we disable , as a commit character.
I considered adding space as a commit character too, but we would have to disable it pretty much everywhere where isNewIdentifierLocation is true because space could validly follow a new identifier in all of those places, so I figured users wouldn't be able to use it reliably as a commit character and it didn't seem like a good idea.
gabritto
changed the title
Enable existing commit characters in certain locations where `is
Enable existing commit characters in certain locations where isNewIdentifier is true
Aug 2, 2024
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #31244.
Fixes #25691.
As I said in #59339, our existing behavior, implemented based on vscode's behavior, is that whenever
isNewIdentifierLocation
istrue
, we disable all commit characters, otherwise the commit characters are.
,,
,;
.However, there have been issues opened over time that this approach is too conservative.
This PR enables some of the usual commit characters in some places where
isNewIdentifierLocation
istrue
and that previously we'd enable no commit characters.Mainly, this PR enables all the three commit characters in every position where an expression is expected. In some of those positions, where we are inside an open parenthesis, the user could be typing a parameter list for an arrow expression, so we disable
,
as a commit character.I considered adding space as a commit character too, but we would have to disable it pretty much everywhere where
isNewIdentifierLocation
istrue
because space could validly follow a new identifier in all of those places, so I figured users wouldn't be able to use it reliably as a commit character and it didn't seem like a good idea.This PR should be testable in vscode insiders once it picks up microsoft/vscode#223541.