atom / language-c

C support in Atom

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Specs do NOT reflect actual highlighting

alpyre opened this issue · comments

Prerequisites

Description

"Run Package Specs" results with zero failures, yet the actual highlighting on the editor is faulty.

Steps to Reproduce

  1. Open c-spec.coffee and copy the code for "conditionals".
  2. Create a new c file and paste the code.
  3. See it does NOT highlight the keyword "defined" correctly:
    ss1
  4. Yet the scope for that keyword in the spec is: keyword.control.directive.conditional.c
    expect(lines[0][3]).toEqual value: 'defined', scopes: ['source.c', 'meta.preprocessor.c', 'keyword.control.directive.conditional.c']

Expected behavior: This should have caused a spec failure.
Actual behavior: It does not!?
ss2
Reproduces how often: %100

Versions

Latest stable version (both linux and Windows versions):

Atom:     1.32.2
Electron: 2.0.9
Chrome:   61.0.3163.100
Node:     8.9.3

Additional Information

I could not reproduce it on Atom 1.31.2 (language-c: 0.60.4). This looks like a quite serious issue and maybe it is deeper than this package.

Those specs are for a different grammar system than the one being used in your editor, which is why they are passing. To toggle back to the old one, go Settings -> Core -> Use Tree Sitter Parsers

As for the issue, someone else will have to comment on that. It does look like the parse tree handles it, but the scopes aren't as before.