atom-language icon indicating copy to clipboard operation
atom-language copied to clipboard

Inconsistent highlighting

Open zoffixznet opened this issue 7 years ago • 4 comments

Not sure if much can be done about it, but I notice several cases of inconsistent highlighting in the code below:

  • ~~MONKEY-GUTS is highlighted different than MONKEY-TYPING~~ Fixed in https://github.com/perl6/atom-language-perl6/commit/5f79d719fefb8dfddcaa4a526618cb862c1b9b5f and https://github.com/perl6/atom-language-perl6/commit/af61e211552f78f8b51b6ee3d6593fcaf2401e3e (please double check I didn't mess up the regex)

  • The IO::Testo::Tester has IO part highlighted in different colour; appears to be due to there being an IO core type/namespace, as Foo::Testo::Tester highlights fine

  • plan method is highlighted as a routine, even though AFAIK there's no such core method

  • is method is highlighted differently from plan or from is-eqv and is-run methods; possibly because it gets highlighted as a trait

  • Even though @test %test &test are just text, they get highlighted differently from *test, as if they were variables

Example Code

unit module Testo;
use IO::Testo::Tester;
use Foo::Testo::Tester;

use MONKEY-GUTS;
use MONKEY-TYPING;

our $Tester = Testo::Tester.new;
sub plan   (|c) is export { $Tester.plan:   |c }
sub is     (|c) is export { $Tester.is:     |c }
sub is-eqv (|c) is export { $Tester.is-eqv: |c }
sub is-run (|c) is export { $Tester.is-run: |c }

say "@test %test &test *test";

Picture [optional]

z

Leave this in. For internal use.

  • [ ] Fixed in Master
  • [ ] Fixed in Release
  • [ ] Has Tests
  • [ ] Passes Tests

zoffixznet avatar May 12 '17 18:05 zoffixznet

I'd personally prefer it if we were to highlight things that are method calls or routines calls based on the syntax of them being that, rather than based on whether there's a built-in method or routine with that name. It's especially odd when you write a web framework that exports get, put, post, and delete routines; get and put end up colored differently to post and delete, even though the get and put you'll be calling are not those from CORE.setting at all. :-)

jnthn avatar May 12 '17 19:05 jnthn

  • The IO::Testo::Tester has IO part highlighted in different colour; appears to be due to there being an IO core type/namespace, as Foo::Testo::Tester highlights fine

The modules that are use'd are not highlighted at all and that is their default color. Will need an issue to track actual highlighting of use's

  • plan method is highlighted as a routine, even though AFAIK there's no such core method

Do you think plan shouldn't highlight? I think it's common enough that it's somewhat expected since it's part of Rakudo proper.

  • is method is highlighted differently from plan or from is-eqv and is-run methods; possibly because it gets highlighted as a trait

I :+1: @jnthn's comment above. Please open an issue for that separately.

  • Even though @test %test &test are just text, they get highlighted differently from *test, as if they were variables

Go ahead and open an issue for this one as well.

Thanks!

samcv avatar May 12 '17 21:05 samcv

Do you think plan shouldn't highlight? I think it's common enough that it's somewhat expected since it's part of Rakudo proper.

It isn't. There's a subroutine named plan, but no method.

zoffixznet avatar May 12 '17 21:05 zoffixznet

Ah yes. Agreed.

samcv avatar May 12 '17 22:05 samcv