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

Syntax highlighting spills out of source block #319

Open
Tracked by #686
cscalfani opened this issue May 20, 2020 · 5 comments
Open
Tracked by #686

Syntax highlighting spills out of source block #319

cscalfani opened this issue May 20, 2020 · 5 comments

Comments

@cscalfani
Copy link

cscalfani commented May 20, 2020

Description

After updating to VSCode 1.45.1 and the AsciiDoc extension 2.7.15, and Haskell Syntax Highlighting 3.2.1, syntax highlighting no longer works.

System Information

Version: 1.45.1
Commit: 5763d909d5f12fe19f215cbfdd29a91c0fa9208a
Date: 2020-05-14T08:33:47.663Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 19.2.0

To Reproduce

Steps to reproduce the issue:

  1. Create a file named test.asc
  2. Add the following text:
[source,haskell]
----
data Maybe a = Nothing | Just a
----

The first word is highlighted.
  1. You should notice that the trailing ---- doesn't get interpreted as the end of the source block. Instead it's interpreted as a COMMENT in Haskell, which starts with --.

  2. You should see that the trailing ---- shows the syntax highlighting of a Haskell comment, which in my screenshot is grey.

  3. The first word of the following sentence is highlighted telling as an Uppercase Variable in Haskell.

  4. Next, add a NON-BLANK line after the data, i.e. anything AFTER the line with data in it EXCEPT for a COMMENT, i.e. a line that starts with --, and you'll see that it works properly. If the line after the line with data is a COMMENT line, it will still be broken.

  5. Next, delete the added line and change data to datax and the problem also goes away.

Seems like the word data is the problem here when there is no other non-comment line.

Screenshots & Files

image

Additional Context

Turns out that going back to an older version of the extension doesn't fix the problem.

@cscalfani
Copy link
Author

I found another case:

[source,haskell]
----
compareMaybe :: ∀ a. Maybe a -> Maybe a -> Boolean
----

This will spill out unless I remove the :: or add a NON-COMMENT line AFTER the line with compareMaybe.

@cscalfani
Copy link
Author

Turns out that downgrading to Haskell Syntax Highlighting 3.0.3 works, yet there are ZERO problems with syntax highlighting in Haskell files, just ASC files.

@nidu
Copy link

nidu commented Jun 22, 2020

Something similar as far as i can tell
image

@ggrossetie
Copy link
Member

Probably related to: #403

@JoshuaKGoldberg
Copy link

Similar issue with TypeScript, when a type isn't followed by a ;:

Before

```ts
type Incomplete = number
```

After

Screenshot of the snippet incorrectly highlighting After

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

4 participants