Skip to content
This repository has been archived by the owner on Dec 28, 2022. It is now read-only.

Live previewing make editor stuck #200

Closed
m11y opened this issue Sep 8, 2016 · 29 comments
Closed

Live previewing make editor stuck #200

m11y opened this issue Sep 8, 2016 · 29 comments

Comments

@m11y
Copy link

m11y commented Sep 8, 2016

Description

When I opened live previewing and typed in editor, the editor got stuck for a few seconds, however,
when live previewing is closed, the editor runs smoothly.

  • Atom version:
    Atom    : 1.10.2
    Electron: 0.37.8
    Chrome  : 49.0.2623.75
    Node    : 5.10.0
  • OS: Mac OSX 10.11.6
  • asciidoc-preview version: 2.6.0
  • language-asciidoc version: 1.5.1

Activity Monitor shows fontd process at high cpu usage state:
2aa76a25-1935-4d0d-b623-ab42b3cb2f04

@m11y m11y changed the title Make editor stuck when live previewing Live previewing make editor stuck Sep 8, 2016
@ldez
Copy link
Member

ldez commented Oct 22, 2016

Hello,

Have you trying the same thing with the Markdown preview ?

@m11y
Copy link
Author

m11y commented Oct 30, 2016

Yes, Markdown preview is very smooth. But, recently, after I upgrade atom to 1.11.2, it seems that Asciidockor preview back to normal.

@ldez
Copy link
Member

ldez commented Oct 30, 2016

We can close this issue ?

@Foadsf
Copy link

Foadsf commented Mar 15, 2019

Same issue here. I'm developing a small library prototype which you can see here. However Atom is stuck rendering it:

2019-03-15_12-53-18

@ggrossetie
Copy link
Member

@Foadsf Could you please open the devtools and look for errors in the console ?

@Foadsf
Copy link

Foadsf commented Mar 15, 2019

@Mogztter Could you pleas elaborate with the instructions? My code is here BTW if you want to try yourself.

@ggrossetie
Copy link
Member

I can't find any documentation on Atom but Ctrl+Alt+I should open the developer tools with console.
On macOS, I think it's Cmd+Opt+I.

https://flight-manual.atom.io/hacking-atom/sections/debugging/#diagnose-runtime-performance

@Foadsf
Copy link

Foadsf commented Mar 15, 2019

@Mogztter Nothing shows up with that keyboard shortcut. from the menu bar maybe?

@Foadsf
Copy link

Foadsf commented Mar 15, 2019

@Mogztter aha ctrl+shift + I on windows link

@Foadsf
Copy link

Foadsf commented Mar 15, 2019

Here is the error:

Uncaught (in promise) TypeError: grammar.tokenizeLines is not a function
    at highlightSync (highlights.coffee:44)
    at tokenizeCodeBlocks (renderer.coffee:145)
    at renderer.coffee:23
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188)

Captureascii

@ggrossetie
Copy link
Member

I think it's related to #279 (comment)
And quoting myself, we definitely need to add this issue in the README: #279 (comment)

If I have some time tonight I will submit a pull request 😉

@Foadsf Could you please confirm that disabling tree-sitter parsers, solve your issue ?

@Foadsf
Copy link

Foadsf commented Mar 15, 2019

@Mogztter I have no idea how I should disable the "tree-sitter parsers" but I suppose it is something discuses on those links. I will do this tonight too. Anyways my code is here for testing. I appreciate your kind support.

@ggrossetie
Copy link
Member

have no idea how I should disable the "tree-sitter parsers" but I suppose it is something discuses on those links.

Not really, here's a detailed guide:

  1. Open the "Settings View"

settings

  1. In "Core" tab (ie. the default tab), scroll to the bottom:

core-settings

  1. Uncheck "Use Tree Sitter Parsers"

I appreciate your kind support.

You're welcome, I'm glad to help 🤗

@Foadsf
Copy link

Foadsf commented Mar 15, 2019

@Mogztter It does render now, however the collapsible section oesn't work and the code block inside it doesn't have syntax highlighting!

P.S. in fact none of the syntax highlighting works, and it was one of the main reasons I opted Atom against vscode as I have explained here.

@Foadsf
Copy link

Foadsf commented Mar 15, 2019

@Mogztter I checked on a different computer. Now the syntax highlighting works upon disabling tree-sitter parsers , however the collapsible part doesn't. The collapsible part works on vscode FYI.

@mojavelinux
Copy link
Member

however the collapsible part doesn't. The collapsible part works on vscode FYI.

I don't think collapsible blocks is a feature of this plugin.

@Foadsf
Copy link

Foadsf commented Mar 16, 2019

isn't the rendering engine of this plugin and vscode one the same?

@mojavelinux
Copy link
Member

Yes and no. The preview window uses Asciidoctor.js. But the editor window uses a very different technology stack.

@Foadsf
Copy link

Foadsf commented Mar 16, 2019

the editors window is great in both atom and vscode. No issues there. foldable / collapsible part I have implementation using HTML tags doesn't work in the preview section of Atom.

@mojavelinux
Copy link
Member

I'm afraid I don't know what you are talking about. Is this a custom extension you've added to the converted page? Could you show a screenshot or code?

@Foadsf
Copy link

Foadsf commented Mar 16, 2019

here my code. please note the part with



////
<details>
  <summary>Click to see the source code</summary>
////


collapsible part

////
</details>
////

of course these need to be between +++s the code on the gist is not up to date unfortunately. I will push today. consider this working example for the moment please.

@mojavelinux
Copy link
Member

This could be a limitation of the HTML viewer in Atom. Have you tried the same thing in the Markdown preview?

Btw, I strongly recommend against putting HTML directly in your AsciiDoc file. It would be much better if you created a custom block extension (or custom converter). It looks like you are attempting to implement asciidoctor/asciidoctor#1699.

@Foadsf
Copy link

Foadsf commented Mar 16, 2019

Markdown :

Code:

/*

This is the markdown **text** 

used for documentation

<details>
  <summary>Click to see the source code</summary>

``` scilab 
*/
This is the
  actual code
  which will 
be executed
/*
```

</details>

<!--- */ // -->

GitHub:

/*

This is the markdown text

used for documentation

Click to see the source code
*/
This is the
  actual code
  which will 
be executed
/*

Atom:

5tgyM1BBLu

VSCode:

WIeqpXouGh

@Foadsf
Copy link

Foadsf commented Mar 16, 2019

AsciiDoc:

Code:

////
/*
////
This is the markdown **text** 

used for documentation

+++ <details><summary> +++
Click to see the source code
+++ </summary><div> +++

[source,scilab]
....
*/
This is the
  actual code
  which will 
be executed
/*
....

+++ </div></details> +++
////
*/
////

Github

/*
This is the markdown text

used for documentation

+++

+++
Click to see the source code
+++
+++

[source,scilab]
....
/
This is the
actual code
which will
be executed
/

....

+++

+++
////
*/
////

Sadly Github doesn't render AsciiDoc here in the issue section properly. To see the result check this Gist.

Atom:

PGMRHtNYUx

VSCode:

Mplx4P5ivf

FireFox:

hlDKvRJQwv

@Foadsf
Copy link

Foadsf commented Mar 16, 2019

A comparison between different options so far:

Color layout Syntax highlighting Collapsible Include Other file extensions Relevant discussion
Atom ✔️ ✔️ ✔️ here
VSCode ✔️ ✔️ here
Browser ❓✔️ ❓✔️ ✔️ ❓❌ here

@Foadsf
Copy link

Foadsf commented Mar 18, 2019

Dear @mojavelinux and @Mogztter should I open a new issue for the Atom live preview not rendering the summary element properly? It doesn't seem to be relevant here.

@mojavelinux
Copy link
Member

The stylesheet provided by Asciidoctor Ruby will carry over to the Atom live preview once Asciidoctor.js is upgraded (the stylesheet is part of the upgrade).

@Foadsf
Copy link

Foadsf commented Mar 18, 2019

@Mogztter and @mojavelinux the Atom plugin just got updated and now the live preview syntax highlighting doesn't work anymore. Should I open a new issue for this or it is relevant to any of other issues we already have and I should just wait for the new PRs?

@ldez
Copy link
Member

ldez commented Mar 18, 2019

@Foadsf could you open a new issue?

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

No branches or pull requests

5 participants