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

[bug] syntest break #449

Open
Freed-Wu opened this issue Oct 7, 2022 · 4 comments
Open

[bug] syntest break #449

Freed-Wu opened this issue Oct 7, 2022 · 4 comments

Comments

@Freed-Wu
Copy link

Freed-Wu commented Oct 7, 2022

❯ git clone --depth=1 https://github.com/sharkdp/bat
...
❯ RUST_BACKTRACE=full syntest . .
loading syntax definitions from .
Testing file ./syntax_test_csv.csv
The test file references syntax definition file: CSV.sublime-syntax
Ok(Success(213))
Testing file ./syntax_test_man.man
The test file references syntax definition file: Manpage.sublime-syntax
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: UnresolvedContextReference(ByScope { scope: <source.c>, sub_context: None, with_escape: true })', examples/syntest.rs:276:51
stack backtrace:
   0:     0x5595448d9f7d - <unknown>
   1:     0x5595448fa25c - <unknown>
   2:     0x5595448d76c1 - <unknown>
   3:     0x5595448db605 - <unknown>
   4:     0x5595448db326 - <unknown>
   5:     0x5595448dbb96 - <unknown>
   6:     0x5595448dba87 - <unknown>
   7:     0x5595448da434 - <unknown>
   8:     0x5595448db7b9 - <unknown>
   9:     0x5595447bea43 - <unknown>
  10:     0x5595447beb33 - <unknown>
  11:     0x5595447c3e66 - <unknown>
  12:     0x5595447c1625 - <unknown>
  13:     0x5595447cca93 - <unknown>
  14:     0x5595447cd279 - <unknown>
  15:     0x5595448d3c6e - <unknown>
  16:     0x5595447c44f2 - <unknown>
  17:     0x7f3c76ddb2d0 - <unknown>
  18:     0x7f3c76ddb38a - __libc_start_main
  19:     0x5595447bece5 - <unknown>
  20:                0x0 - <unknown>
@Freed-Wu
Copy link
Author

Freed-Wu commented Oct 8, 2022

It is related to c. Because C.sublime-syntax doesn't exist, so the following code will has bug.

       The corresponding argument for pselect() has the following type:
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - source.c

@keith-hall
Copy link
Collaborator

Presumably doing a git clone with depth 1 doesn't initialize any submodules, so the C syntax file doesn't exist? Or am I missing something?

@Freed-Wu
Copy link
Author

Freed-Wu commented Oct 9, 2022

You are right. Just download https://raw.githubusercontent.com/sublimehq/Packages/759d6eed9b4beed87e602a23303a121c3a6c2fb3/C%2B%2B/C.sublime-syntax and retest, the bug disappear. So I still think it is a bug, at least, it should tell user missing C.sublime-syntax, not raise an error.

@keith-hall
Copy link
Collaborator

I guess we can make use of #338 in the syntest example to solve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants