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

[json] Incorrect brace matching in JSON files #26637

Closed
danielbaak opened this issue May 15, 2017 · 2 comments
Closed

[json] Incorrect brace matching in JSON files #26637

danielbaak opened this issue May 15, 2017 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug json JSON support issues verified Verification succeeded
Milestone

Comments

@danielbaak
Copy link

danielbaak commented May 15, 2017

  • VSCode Version:
    Version 1.12.1
    Commit f6868fc
    Date 2017-05-04T21:40:39.245Z
    Shell 1.6.6
    Renderer 56.0.2924.87
    Node 7.4.0

  • OS Version:
    Linux Mint 18.1

Steps to Reproduce:

  1. create the following .json file:
{
	"foo": [
		{
			"[": {}
		},
		1,
		{"{":"a"},
		3
	]
}
  1. click braces } and or ] to highlight corresponding opening braces ... notice it matches the braces embedded in strings.
@aeschli
Copy link
Contributor

aeschli commented May 26, 2017

@alexandrudima For JSON, the keys are not of scope 'string', but support.type.property-name.
Any chance this can be customized for bracket matching?

image

@alexdima
Copy link
Member

The scopes for string, regex or comment cannot be configured at this time. The JSON grammar could push an extra string scope. e.g.:

  • string.json
  • support.type.property-name
    to make this work as expected.

IMHO it is a lot easier to tweak the grammar in such cases than to implement a configurable scope selector for string / regex / comment. i.e. convention over configuration.

@aeschli aeschli changed the title Incorrect brace matching in JSON files [json] Incorrect brace matching in JSON files Aug 4, 2017
@aeschli aeschli added this to the August 2017 milestone Aug 4, 2017
@aeschli aeschli added json JSON support issues bug Issue identified by VS Code Team member as probable bug labels Aug 4, 2017
aeschli added a commit to microsoft/vscode-JSON.tmLanguage that referenced this issue Aug 4, 2017
@aeschli aeschli closed this as completed in 06c1e05 Aug 8, 2017
@roblourens roblourens added the verified Verification succeeded label Aug 30, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
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 json JSON support issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants