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
{{ message }}
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.
I've run in to some issues whit the way the language is parsed.
The first is that a code block like this doesnt fold correctly because of the multiline string,
also for matching in the comment, oddly it detects, but doesnt care about the 'end' in the comment
def test()
optparse = OptionParser.new do |parser|
parser.banner = 'multi line
stuff
'
parser.thing #other issues is the word> for <in comments, this matches with the end below
end
I realize this code is all banged up, its just the shortest bit of code i could provide to display the issues.
It also breaks with this format
myVar = someStuff if myVar.nil?
the if is matched with the next 'end'
The text was updated successfully, but these errors were encountered:
Basically all of this will be covered by #317 but I'll elaborate here:
It has proven to be difficult to meet everyone's use case for highlighting, folding, etc via the Textmate grammar support that VSCode provides. As ruby is so dynamic, it's very difficult to use a regex based approach to parse it. My in-progress solution for this is to use an AST to facilitate accurate code representations.
Code folding via matched pairs is currently a proposed language server feature. I have it mostly working in a local branch via the proposed protocol. VSCode itself shipped support for this via an opt-in flag a little while ago.
In terms of highlighting support, semantic highlighting via the language server is currently pre-proposal (see microsoft/language-server-protocol#18). Until that occurs, we can't get much better than the current highlighting support. We can try and focus the regex's in the Textmate grammar some more, but that ends up being too specific and users lose highlighting support for other things.
I've run in to some issues whit the way the language is parsed.
The first is that a code block like this doesnt fold correctly because of the multiline string,
also
for
matching in the comment, oddly it detects, but doesnt care about the 'end' in the commentI realize this code is all banged up, its just the shortest bit of code i could provide to display the issues.
It also breaks with this format
myVar = someStuff if myVar.nil?
the if is matched with the next 'end'
The text was updated successfully, but these errors were encountered: