Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Groupings #345

Closed
jrich523 opened this issue Jun 6, 2018 · 2 comments
Closed

Groupings #345

jrich523 opened this issue Jun 6, 2018 · 2 comments

Comments

@jrich523
Copy link

jrich523 commented Jun 6, 2018

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'

@wingrunr21
Copy link
Collaborator

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.

@jrich523
Copy link
Author

jrich523 commented Jun 7, 2018

Completely understand, just wanted to toss a few more instances at you incase any were missed.

good luck and keep it up! :)

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

No branches or pull requests

2 participants