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

Conversation

graceful-potato
Copy link
Contributor

This is a fix for #658
First I just wanted to check that there is a start of line or space char before do keyword, but there is some weird cases where you can put do right after the method name without space:

def +
  yield "test"
end

self.+do |e|
  e.upcase
end

I am pretty sure this will work for any of these methods: +, -, *, /, ^, %, &, |
Blocks are rarely used with them and blocks without space between method name and do I think almost never.
So I am not sure what is better.

@codecov
Copy link

codecov bot commented Oct 11, 2020

Codecov Report

Merging #660 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #660   +/-   ##
======================================
  Coverage    5.08%   5.08%           
======================================
  Files          10      10           
  Lines         118     118           
  Branches       20      20           
======================================
  Hits            6       6           
  Misses        112     112           
Flag Coverage Δ
#language_server_ruby 5.08% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2449c01...7f6ac76. Read the comment docs.

@graceful-potato graceful-potato changed the title Check for @ and $ before 'do' Check for : @ and $ before 'do' Oct 11, 2020
@wingrunr21
Copy link
Collaborator

I'd just make it whatever is going to be right most of the time.

Part of my radio silence on this is converting things over to the tree-sitter query support. That should open up the semantic highlighting API that VSCode recently shipped which will hopefully cover the rest of these edge cases.

@graceful-potato
Copy link
Contributor Author

I heard about tree sitter, but I dont know much about it. This is just a quick fix in standard grammar file.

@Nowaker
Copy link

Nowaker commented Oct 15, 2020

Thank you!

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

Successfully merging this pull request may close these issues.

3 participants