rjocoleman / language-hosts

Language support for `/etc/hosts` files in Atom.
3 stars 0 forks source link

Doesn't highlight IPv6 addresses correctly #3

Open dflock opened 8 years ago

dflock commented 8 years ago

The last digit is coloured wrong:

screenshot - 16-08-15 - 08 40 34 pm

rjocoleman commented 8 years ago

sounds like the regex - IPv6 is here https://github.com/rjocoleman/language-hosts/blob/master/grammars/hosts.cson#L20

Looks like we're missing a test case too: https://github.com/rjocoleman/language-hosts/blob/master/spec/hosts-spec.coffee#L42-L50

I'd happily take a PR for both thanks :blush:

dflock commented 8 years ago

Well, here's your failing test:

{tokens} = grammar.tokenizeLine("fe00::0")
    expect(tokens[0]).toEqual value: "fe00::0", scopes: ["source.hosts", "constant.numeric.ipv6.hosts"]

Just for that one case. But, looking into this, the actual number of test cases required is quite large - as is the regex; and I'm sure that version probably has missing edge cases too ;)

I'll see if I can make time for this, as an intro to doing proper atom package dev.