tm4e
tm4e copied to clipboard
quotes and double-quotes surrounding pairs do not work correctly
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.

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

Brackets work correctly.

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
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 :

With this pattern, the surrounding pairs do not correctly :

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

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

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
How do I check it with other languages ?
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 https://github.com/eclipse/tm4e/pull/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.