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

quotes and double-quotes surrounding pairs do not work correctly #470

Open
NicoPy opened this issue Nov 26, 2022 · 4 comments
Open

quotes and double-quotes surrounding pairs do not work correctly #470

NicoPy opened this issue Nov 26, 2022 · 4 comments

Comments

@NicoPy
Copy link

NicoPy commented Nov 26, 2022

I've configured TextMate to support Ada language.

Everything seems to be working correctly except quote and double-quote surrounding pairs highlighting.

When the editing cursor is after the opening quote/double-quote, the matching quote/double-quote is located correctly.
image

When the editing cursor is after the closing quote/double-quote, the matching quote/double-quote is not shown at the correct location.
image

Brackets work correctly.
image
image

The language-configuration.json file I use :

{
    "comments": {
        // symbol used for single line comment. Remove this entry if your language does not support line comments
        "lineComment": "-- "
    },
    // symbols used as brackets
    "brackets": [
        ["(", ")"]
    ],
    // symbols that are auto closed when typing
    "autoClosingPairs": [
        ["<<", ">>"],
        ["{", "}"],
        ["[", "]"],
        ["(", ")"],
        ["\"", "\""],
        ["'", "'"]
    ],
    // symbols that can be used to surround a selection
    "surroundingPairs": [
        ["{", "}"],
        ["[", "]"],
        ["(", ")"],
        ["\"", "\""],
        ["'", "'"]
    ]
}

Is this a bug or a bad configuration on my side ?

Eclipse :
Version: 2022-09 (4.25.0)
Build id: 20220908-1902

Windows 10

@NicoPy
Copy link
Author

NicoPy commented Nov 26, 2022

I forgot to say that to use a double-quote in strings, the escape character is a double-quote.
So, to print --"hello world"--, one have to code it like this :
image

With this pattern, the surrounding pairs do not correctly :
image

For a single character , there is no escape character (a quote is used directly) :
image

The surrounding pairs do not work correctly either in this case :
image

@sebthom
Copy link
Member

sebthom commented Jun 21, 2023

Is this issue reproducible with any other the languages provided by the Language Pack? https://github.com/eclipse/tm4e/tree/main/org.eclipse.tm4e.language_pack

@NicoPy
Copy link
Author

NicoPy commented Jul 1, 2023

How do I check it with other languages ?

@sebthom
Copy link
Member

sebthom commented Nov 7, 2023

We currently delegate surround handling to org.eclipse.jface.text.source.DefaultCharacterPairMatcher which apparently only handles brackets reliably, i.e. the opening and the closing chars must be different.

With PR #613 I am disabling the broken surround pair handling of quotes until a proper solution is found.

Btw. the native Eclipse Java Editor also currently does not support surround pair handling of quotes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants