Skip to content

auto closing pairs with conflicting patterns problems #72177

@msftrncs

Description

@msftrncs
Version: 1.33.1 (user setup)
Commit: 51b0b28134d51361cf996d2f0a1c698247aeabd8
Date: 2019-04-11T08:27:14.102Z
Electron: 3.1.6
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 10.0.17763

Steps to Reproduce:

  1. Create two auto closing pairs in a language configuration file,
	"autoClosingPairs": [
		{"open": "(", "close": ")"},
		{"open": "(*", "close": "*)",  "notIn": ["string"]},
	],
  1. trying using the two character auto closing pair, (* and you will get (**)).

On the other hand, if you remove the ending ')' from the closing '*)' you almost get normal function, except that in cases where ( doesn't auto close with ), you get (**.

Note this condition exists in #57838, in a reference to the Structured Text Language, though it is not shown in the example on that feature request. Reference the repository https://github.com/Serhioromano/vscode-st for some example.

I think the Auto Closing logic needs to consider when auto closing pairs might conflict with each other. In this case, '(**)' overlaps with '()'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    editor-autoclosingEditor automatic closing of parens / brackets / etc.feature-requestRequest for new features or functionalityinsiders-releasedPatch has been released in VS Code InsidersverifiedVerification succeeded

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions