question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature request] GLSL code formatting feature

See original GitHub issue

I like to look at the twigl code on Twitter. However, much of that code is obfuscated to keep it short. How about a formatting feature to make the obfuscated code easier to read?

I think js-beautify can be used to format the code. https://github.com/beautify-web/js-beautify

The following is an implementation image.

before: image

after: image

I think js-beautify can be called as follows.

<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.13.13/beautify.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.13.13/beautify-css.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.13.13/beautify-html.js"></script>
beautify.addEventListener('click', () => {
    const opts = {
        indent_size: 4
    };
    editor.setValue(js_beautify(editor.getValue(), opts));
}, false);

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
doxascommented, May 19, 2021

wow! this is a good idea. However, would you mind if I change the position and design of the bracket icons by myself?

0reactions
doxascommented, Aug 9, 2022

This could certainly be useful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ability to edit GLSL shader code in Vuo Editor
Write your shader code in the code editor. The code will be in Vuo's extended version of VIDVOX's Interactive Shader Format (ISF).
Read more >
GLSL language integration - Visual Studio Marketplace
VSIX Project that provides GLSL language integration. Includes syntax highlighting, code completion (OpenGL 4.6 + identifiers in shader ...
Read more >
[feature request] support for syntax highlight of inline GLSL ...
I've created a PR on cpp-textmate-grammar repository with this feature added. Please consider adding this to the default c++ syntax highlighter.
Read more >
Core Language (GLSL) - OpenGL Wiki - Khronos Group
The OpenGL Shading Language is a C-style language, so it covers most of the features you would expect with such a language.
Read more >
OSL implementation? - Feature requests - Babylon.js Forum
We support glsl shaders which you can use to create custom materials. To get OSL working you will need to convert it to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found