We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
highlightTreeSitter
Execution was success:
await highlightTreeSitter(`function () {console.log()}\n`.repeat(30), 'source.js')
<span class="syntax--source syntax--js"><span class="syntax--storage syntax--type syntax--function">function</span> <span class="syntax--punctuation syntax--definition syntax--parameters syntax--begin syntax--bracket syntax--round">(</span><span class="syntax--punctuation syntax--definition syntax--parameters syntax--end syntax--bracket syntax--round">)</span> <span class="syntax--punctuation syntax--definition syntax--function syntax--body syntax--begin syntax--bracket syntax--curly">{</span><span class="syntax--support syntax--variable syntax--dom">console</span><span class="syntax--meta syntax--delimiter syntax--period">.</span><span class="syntax--entity syntax--name syntax--function">log</span><span class="syntax--punctuation syntax--definition syntax--parameters syntax--begin syntax--bracket syntax--round">(</span><span class="syntax--punctuation syntax--definition syntax--parameters syntax--end syntax--bracket syntax--round">)</span><span class="syntax--punctuation syntax--definition syntax--function syntax--body syntax--end syntax--bracket syntax--curly">}</span> ... <span class="syntax--storage syntax--type syntax--function">function</span> <span class="syntax--punctuation syntax--definition syntax--parameters syntax--begin syntax--bracket syntax--round">(</span><span class="syntax--punctuation syntax--definition syntax--parameters syntax--end syntax--bracket syntax--round">)</span> <span class="syntax--punctuation syntax--definition syntax--function syntax--body syntax--begin syntax--bracket syntax--curly">{</span><span class="syntax--support syntax--variable syntax--dom">console</span><span class="syntax--meta syntax--delimiter syntax--period">.</span><span class="syntax--entity syntax--name syntax--function">log</span><span class="syntax--punctuation syntax--definition syntax--parameters syntax--begin syntax--bracket syntax--round">(</span><span class="syntax--punctuation syntax--definition syntax--parameters syntax--end syntax--bracket syntax--round">)</span><span class="syntax--punctuation syntax--definition syntax--function syntax--body syntax--end syntax--bracket syntax--curly">}</span> </span>
Randomly fail:
await highlightTreeSitter(`function () {console.log()}\n`.repeat(80), 'source.js')
Completely fail:
await highlightTreeSitter(`function () {console.log()}\n`.repeat(120), 'source.js')
<span class="syntax--source syntax--js">function () {console.log()} function () {console.log()} ... function () {console.log()} </span>
As far as I've tested locally, adding something like await delay (100) after buf.setText (sourceCode) in the implementation seems to work as expected.
await delay (100)
buf.setText (sourceCode)
atom-ide-markdown-service/src/highlighter.ts
Lines 33 to 35 in 6ef490f
const delay = ms => new Promise(resolve=>setTimeout(resolve, ms))
buf.setLanguageMode(lm) buf.setText(sourceCode) await delay(100) // <- add this line const end = buf.getEndPosition()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Execution was success:
Randomly fail:
Completely fail:
As far as I've tested locally, adding something like
await delay (100)
afterbuf.setText (sourceCode)
in the implementation seems to work as expected.atom-ide-markdown-service/src/highlighter.ts
Lines 33 to 35 in 6ef490f
The text was updated successfully, but these errors were encountered: