wmertens / sublime-nix

Nix syntax highlighting for Sublime Text
MIT License
30 stars 9 forks source link

False syntax errors since latest update #5

Closed FPtje closed 7 years ago

FPtje commented 7 years ago

Today I noticed that valid code is highlighted as syntactically incorrect. I reckon it has to do with the latest commit.

Example:

{ config, lib, pkgs, ... }:

with lib;

{
  config = {
    systemd.services.example = with pkgs; {
      description = "asdf";
      serviceConfig = {
        ExecStart = "asdf";
      };
    };
  };
}

Result:

2017-06-02-094117_354x219_scrot

The code is syntactically valid. The pink highlights are incorrect.

wmertens commented 7 years ago

thank you for the heads-up, hopefully v2.3.1 restores normalcy.

FPtje commented 7 years ago

It hasn't. The latest version on package control still has this issue.

wmertens commented 7 years ago

@FPtje Strange, the code you gave renders correctly in github, and they use https://github.com/github/linguist which presumably uses the latest sublime-nix. Can you confirm that your installed sublime package is v2.3.1 and it has the changes included in https://github.com/wmertens/sublime-nix/commit/5fa227a7c42cd3ecd4dd86721f1a8d5dc460df8a ?

FPtje commented 7 years ago

It is version 2.3.1 and it does contain the changes included in that revision. I checked by opening nix.YAML-tmLanguage inside the nix.sublime-package and observing line 332 being as follows:

    begin: (?![\w'-])(with|assert)(?![\w'-])
wmertens commented 7 years ago

Ok, thanks for checking. I will investigate and fix soon.

demin-dmitriy commented 7 years ago

@FPtje until fixed version is not available as a package in package control repository you can try master branch version, e.g. on linux this should do the trick:

$ git clone https://github.com/wmertens/sublime-nix ~/.config/sublime-text-3/Packages/Nix
FPtje commented 7 years ago

I had already reverted to a previous version that didn't have the bug

wmertens commented 7 years ago

In the meantime, I hope the latest release fixed the bug?

On Wed, Jul 5, 2017 at 7:39 PM Falco Peijnenburg notifications@github.com wrote:

I had already reverted to a previous version that didn't have the bug

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/wmertens/sublime-nix/issues/5#issuecomment-313174372, or mute the thread https://github.com/notifications/unsubscribe-auth/AADWlplCfcS9Wxmnx4SmwRj8bLDlgdWBks5sK8pbgaJpZM4Nt8Ek .

FPtje commented 7 years ago

Looks like it's fixed on ebf06571f3cc2b30a7f88bbd4eb371b72ce828c2. Thanks!