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

Support for multi-line statements #2692

Closed
elifoster opened this issue Oct 18, 2015 · 4 comments
Closed

Support for multi-line statements #2692

elifoster opened this issue Oct 18, 2015 · 4 comments

Comments

@elifoster
Copy link

I have only noticed this with Ruby, because that's really the only language that I've taken the care to actually follow a set style, but when a statement, particularly method definition, takes up more than one line, styling does not appear as it should. I'm probably really bad at explaining this, so here's an example.

@pchaigno
Copy link
Contributor

Each language has its own grammar for syntax highlighting. In general, a bug in the highlighting of one language shouldn't have consequences for other languages.
Also, Linguist only selects the correct grammar. For Ruby, GitHub uses textmate/ruby.tmbundle. You should open an issue there.

I can't see how it's broken though. The equal sign and true keyword appear to be highlighted correctly on the second line. Is there something else that should be highlighted?

@elifoster
Copy link
Author

Sorry, should have been a tiny bit more specific, and checked without GitHub Dark installed. You can see the difference if you install a Stylish theme, like GitHub Dark, or inspect the blob-code element of that line.

"verbose_errors" is not the span class "pl-smi", though it should be. This is only noticeable when using a stylish theme or something similar, because the default GitHub css shows pl-smi as the same color as default text.

This definitely does not belong in this repository, however I don't think it belongs in TextMate either. I am under the assumption that it is a general GitHub CSS issue.

@pchaigno
Copy link
Contributor

pchaigno commented Oct 25, 2015

The CSS classes are generated based on the output of the language grammar. So, even if the TextMate bundle didn't generate the pl-smi classes itself, I still think it's the source of the bug.

I don't have TextMate but, if you report the issue at textmate/ruby.tmbundle, someone might be able to check that it can be reproduced with the actual editor.

@arfon
Copy link
Contributor

arfon commented Oct 25, 2015

Closing as this isn't a Linguist issue :-)

@arfon arfon closed this as completed Oct 25, 2015
infininight added a commit to textmate/ruby.tmbundle that referenced this issue Oct 26, 2015
An error in the previous regular expression was preventing the first argument of successive lines of a definition from being matched unless they were at the very beginning of the line. Fixed by strictly matching the beginning of the argument.

Fixes #87 as first mentioned in github-linguist/linguist#2692.
noniq added a commit to die-antwort/textmate-bundles that referenced this issue Oct 27, 2015
PHP.tmbundle: b13a09c..58fb6b3

  * 2ecaa60 Update grammar, completions, etc. to PHP 7.0 (Michael Sheets)

  * 03b31ee Update generate scripts (Michael Sheets)

    - Point to ruby 1.8 installed via Homebrew
    - Switch to git repository for phd
    - Update included library paths

Ruby.tmbundle: 097c858..da81927

  * 97608b6 Match argument names on the second line of definition (Michael Sheets)

    An error in the previous regular expression was preventing the first
    argument of successive lines of a definition from being matched unless
    they were at the very beginning of the line. Fixed by strictly matching
    the beginning of the argument.

    Fixes #87 as first mentioned in github-linguist/linguist#2692.
@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
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

3 participants