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

{-# SCC "Specialise" #-} messes up the color of text after it #195

Open
zliu41 opened this issue Aug 25, 2021 · 4 comments
Open

{-# SCC "Specialise" #-} messes up the color of text after it #195

zliu41 opened this issue Aug 25, 2021 · 4 comments
Labels

Comments

@zliu41
Copy link

zliu41 commented Aug 25, 2021

Screenshot from 2021-08-25 11-26-36

@sheaf sheaf added the bug label Aug 25, 2021
@sheaf
Copy link
Collaborator

sheaf commented Aug 25, 2021

Thanks for the bug report. I think the rule for SPECIALI(S|Z)E should check that it is preceded by a space and not just a word boundary.

@zliu41
Copy link
Author

zliu41 commented Aug 27, 2021

Thanks. Seems like a fairly small fix, which I would often do myself, but I didn't find any instructions for running tests in this repo, and the tests don't work for me, with some unhelpful error messages:

$ make test
cd test && bash test.sh
Running tests from base directory /home/zliu41/language-haskell
undefined:1



SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Object.t.parseRawGrammar (/home/zliu41/.npm/_npx/0730124e18183807/node_modules/vscode-textmate/release/main.js:1:20933)
    at createRegistryFromGrammars (/home/zliu41/.npm/_npx/0730124e18183807/node_modules/vscode-tmgrammar-test/dist/src/unit/index.js:115:29)
    at Object.createRegistry (/home/zliu41/.npm/_npx/0730124e18183807/node_modules/vscode-tmgrammar-test/dist/src/unit/index.js:141:12)
    at Object.<anonymous> (/home/zliu41/.npm/_npx/0730124e18183807/node_modules/vscode-tmgrammar-test/dist/src/unit.js:60:24)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
npm ERR! code 1
npm ERR! path /home/zliu41/language-haskell/test
npm ERR! command failed
npm ERR! command sh -c vscode-tmgrammar-test "-s" "source.haskell" "-g" "/home/zliu41/language-haskell/syntaxes/haskell.json" "-t" "/home/zliu41/language-haskell/test/tests/ADTs.hs"

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/zliu41/.npm/_logs/2021-08-27T20_13_23_965Z-debug.log
Fail (unexpected) ADTs.hs
...

This prevents me from validating my changes. Some instructions in README would be helpful.

@sheaf
Copy link
Collaborator

sheaf commented Aug 27, 2021

Hmm, sorry about that. What happens if you run:

npx vscode-tmgrammar-test "-s" "source.haskell" "-g" "/home/zliu41/language-haskell/syntaxes/haskell.json" "-t" "/home/zliu41/language-haskell/test/tests/ADTs.hs"

Thanks for taking the time to help, I appreciate it.

@sheaf
Copy link
Collaborator

sheaf commented Aug 27, 2021

By the way, to change the syntax grammar you should be editing the haskell.YAML-tmLanguage file, and then generating haskell.json using npx js-yaml haskell.YAML-tmLanguage > haskell.json. I will add instructions to the README, thank you.

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

No branches or pull requests

2 participants