WebGL GLSL Editor - Visual Studio Marketplace (2024)

WebGL GLSL Editor - Visual Studio Marketplace (5)WebGL GLSL Editor - Visual Studio Marketplace (6)

This extension adds language support for GLSL ES 100 (WebGL 1 and OpenGL ES 1.00) and GLSL ES 300 (WebGL 2 and OpenGL ES 3.00). It supports all the WebGL-compatible GLSL extensions too. It supports most of the well-known VS Code language features like syntax highlight, IntelliSense and more, see the details below.

Features

Syntax highlight

The extension colorizes types, builtin types, variables, builtin variables, functions, keywords, qualifiers, operators, preprocessor directives and comments.

WebGL GLSL Editor - Visual Studio Marketplace (7)

Diagnostic

The extension uses glslang, the Khronos Group's reference GLSL compiler to provide diagnostic information (errors and warnings). It also grays out the unused functions, types and variables. Only available in the desktop version.

WebGL GLSL Editor - Visual Studio Marketplace (8)

Offline documentation

The extension uses docs.gl to provide the offline documentation for builtin variables and builtin functions. Only available in the desktop version.

WebGL GLSL Editor - Visual Studio Marketplace (9)

Signature help

The extension can display a signature helper for functions and constructors (except matrix constructors).

WebGL GLSL Editor - Visual Studio Marketplace (10)

Code completion

The extension provides types, variables, functions, constructors, keywords, qualifiers, qualifier parameters, preprocessor directives, macros, and code snippets using IntelliSense, according to the current scope and shader stage. Member variables and vector swizzles are also supported.

WebGL GLSL Editor - Visual Studio Marketplace (11)

Formatting

The extension can format the whole source code and it can format a region of the source code. The formatting is customizable in Settings.

WebGL GLSL Editor - Visual Studio Marketplace (12)

Syntax highlight in HTML scripts and in JavaScript/TypeScript template strings

The extension can colorize GLSL code in HTML scripts if the script's type is x-shader/x-vertex or x-shader/x-fragment.

WebGL GLSL Editor - Visual Studio Marketplace (13)

The extension can colorize GLSL code in JavaScript/TypeScript strings if there is a /*glsl*/ comment before it.

WebGL GLSL Editor - Visual Studio Marketplace (14)

Rename

You can rename types (and constructors), interface blocks, variables and functions.

WebGL GLSL Editor - Visual Studio Marketplace (15)

Highlights

The extension can highlight all the occurrences of the selected type, variable function or constructor.

WebGL GLSL Editor - Visual Studio Marketplace (16)

Hover

The extension can provide useful information or documentation summary if you hover over types, variables, functions or constructors.

WebGL GLSL Editor - Visual Studio Marketplace (17)

Symbols

The extension can provide outline information and breadcrumbs about the types, interface blocks, variables and functions. You can also easily find them by typing a @ into the Command Palette.

WebGL GLSL Editor - Visual Studio Marketplace (18)

Inlay hints

The extension can show function and constructor parameters in the source code with tooltips and links.

WebGL GLSL Editor - Visual Studio Marketplace (19)

Color picker

The extension can display a color picker if you initialize or reassign a vec3 or vec4 variable whose name contains the word color or colour and the assigned expression is a vec3 or vec4 constructor and its parameters are number literals.

WebGL GLSL Editor - Visual Studio Marketplace (20)

Code injection

The extension can inject code into the GLSL files. You can specify the code in Settings.

WebGL GLSL Editor - Visual Studio Marketplace (21)

Show/Peek call hierarchy

The extension can visualize the functions' and constructors' incoming and outgoing calls as a graph.

WebGL GLSL Editor - Visual Studio Marketplace (22)

Go to/Peek declarations

You can find (go to / peek) the declaration of a type, a variable, a function or a constructor.

WebGL GLSL Editor - Visual Studio Marketplace (23)

Go to/Peek definitions

You can find (go to / peek) the definition of a type, a variable, a function or a constructor.

WebGL GLSL Editor - Visual Studio Marketplace (24)

Go to/Peek type definitions

You can find (go to / peek) the type definition of a variable, a function or a constructor.

WebGL GLSL Editor - Visual Studio Marketplace (25)

Go to/Find all/Peek implementations

You can find (go to / find all / peek) the implementation of a function.

WebGL GLSL Editor - Visual Studio Marketplace (26)

Go to/Find all/Peek references

You can find (go to / find all / peek) the references of a type, a variable, a function or a constructor.

WebGL GLSL Editor - Visual Studio Marketplace (27)

Generating preprocessed GLSL source code

You can generate preprocessed GLSL source code by running a command or pressing the button on the top-right corner of the editor. Only available in the desktop version.

WebGL GLSL Editor - Visual Studio Marketplace (28)

Folding

You can collapse or expand code blocks.

WebGL GLSL Editor - Visual Studio Marketplace (29)

Commands for online documentation

You can easily access several online documentations by commands.

WebGL GLSL Editor - Visual Studio Marketplace (30)

Other features

  • Indentation
  • Brace matching
  • Comment toggling
  • Autoclosing pairs
  • Surrounding pairs
  • Default icon for GLSL files

Configuration

  • webgl-glsl-editor.diagnostics: Enables/disables displaying errors, warnings and hints.
  • webgl-glsl-editor.strictRename: Prevents invalid renames.
  • webgl-glsl-editor.alwaysOpenOnlineDoc: Documentation is always opened online in the browser.
  • webgl-glsl-editor.alwaysOpenOfflineDocInNewTab: Offline documentation is always opened in a new tab.
  • webgl-glsl-editor.format.placeBracesOnSeparateLine: Places the braces on separate lines.
  • webgl-glsl-editor.format.placeSpaceAroundUnaryOperators: Places a space between the unary operators and the operands.
  • webgl-glsl-editor.format.placeSpacesAroundBinaryOperators: Places spaces around the binary operators.
  • webgl-glsl-editor.format.placeSpacesAroundAssignmentOperators: Places spaces around the assignment operators.
  • webgl-glsl-editor.format.placeSpacesAroundTernaryOperators: Places spaces around the ternary operators.
  • webgl-glsl-editor.format.placeSpaceAfterKeywords: Places a space between keywords and the opening parentheses.
  • webgl-glsl-editor.format.placeSpaceAfterFunctionNames: Places a space between function names and the opening parentheses.
  • webgl-glsl-editor.format.placeSpaceBeforeCommas: Places a space before commas.
  • webgl-glsl-editor.format.placeSpaceAfterCommas: Places a space after commas.
  • webgl-glsl-editor.format.placeSpacesAroundDots: Places spaces around dots.
  • webgl-glsl-editor.format.placeSpaceBeforeCaseColons: Places a space before colons in cases and defaults.
  • webgl-glsl-editor.format.placeSpaceBeforeSemicolonsInFor: Places a space before semicolons in fors.
  • webgl-glsl-editor.format.placeSpaceAfterSemicolonsInFor: Places a space after semicolons in fors.
  • webgl-glsl-editor.format.placeSpacesInsideParentheses: Places spaces inside parentheses.
  • webgl-glsl-editor.format.placeSpacesAroundBraces: Places spaces around braces.
  • webgl-glsl-editor.format.placeSpaceBeforeOpeningBrackets: Places a space before opening brackets.
  • webgl-glsl-editor.format.placeSpacesInsideBrackets: Places spaces inside brackets.
  • webgl-glsl-editor.format.favorFloatingSuffix: The formatter and the color picker favor the floating suffix when applicable.
  • webgl-glsl-editor.codeInjection: Enables/disables code injection.
  • webgl-glsl-editor.codeInjectionSource: The lines of the injected source code. Only works if Code Injection is enabled.

Builtin Visual Studio Code configuration

There are a lot of features you can enable/disable using builtin VS Code configurations:

  • editor.semanticHighlighting.enabled: Semantic highlight
  • editor.occurrencesHighlight: Highlights
  • editor.hover.enabled: Hover
  • editor.inlayHints.enabled: Inlay hints
  • editor.colorDecorators: Color picker
  • editor.folding: Folding
  • editor.autoIndent: Indentation
  • editor.bracketPairColorization.enabled: Brace matching
  • editor.autoClosingBrackets: Autoclosing pairs
  • editor.autoSurround: Surrounding pairs

Notes

  • If you open GLSL code embedded in HTML, only the syntax highlight and limited indentation will work

Known Issues

  • Preprocessor directives may cause problems
  • Incorrect GLSL code (like an if statement without parentheses) may cause problems

You can find the user-provided issues on GitHub. Feel free to add new issues, but please provide some sort of information to I can reproduce the problem.

Release Notes

For more information, see the changelog.

1.3.8

  • Making builtin macros available in normal code completion (with values), not only in preprocessor lines
  • Adding a tooltip and a link to inlay hints
  • Other small changes

1.3.7

  • Added default file icons
  • Added a button (top-right corner of the editor) to generate preprocessed code
  • Extended the syntax highlight to work with strings in .tsx files (thanks George Corney)
  • Other small changes and bugfixes

1.3.6

  • Added a new configuration to control if you like floating suffixes or not
  • Other small changes and bugfixes

1.3.5

  • Extending the syntax highlight to work in JavaScript and TypeScript strings
  • Other small changes and bugfixes

1.3.4

  • Adding a configuration to be able to disable diagnostics
  • Adding the possibility of multiline function parameter lists to the formatter
  • Other small changes and bugfixes

1.3.3

  • Enabled almost all desktop features to the web extension
  • Other small changes and bugfixes

1.3.2

  • I made a mistake when I published it, don't use this version!

1.3.1

  • Added diagnostic support for compound file extensions (thanks RAX7)
  • Other small changes

1.3.0

  • Inlay hints
  • Available as a web extension
  • Improved formatting
  • Improved syntax highlight
  • Improved call hierarchy
  • Improved references
  • Improved highlight
  • Improved brace matching
  • Other small changes and bugfixes

1.2.2

  • Improved code completion
  • Other small changes and bugfixes

1.2.1

  • Support for the extensions
  • Range formatting
  • Generating preprocessed GLSL
  • Improved code completion
  • Improved syntax highlight
  • Improved diagnostic
  • Other small changes and bugfixes

1.2.0

  • Formatting
  • Syntax highlight in HTML scripts
  • Code injection
  • Improved folding
  • Other small changes and bugfixes

1.1.1

  • Improved diagnostic
  • Other small changes and bugfixes

1.1.0

  • Function signature helper
  • Call hierarchy
  • Color picker
  • Generating Shadertoy variables
  • Improved syntax highlight
  • Improved code completion
  • Improved diagnostic
  • Other small changes and bugfixes

1.0.1

  • Improved syntax highlight
  • Other small changes and bugfixes

1.0.0

  • Syntax highlight
  • Diagnostics
  • Offline documentation
  • Code completion
  • Rename
  • Highlights
  • Hover
  • Symbols
  • Go to/Peek declarations
  • Go to/Peek definitions
  • Go to/Peek type definitions
  • Go to/Find all/Peek implementations
  • Go to/Find all/Peek references
  • Commands for online documentation

Contributions

Special thanks to michaelmcleodnz, RAX7, Matt Curtis, and George Corney for contributing.

More information about the project

If you want to know more about a project structure, how to build, run, package, and much more, read the extension's wiki page.

WebGL GLSL Editor - Visual Studio Marketplace (2024)
Top Articles
Latest Posts
Article information

Author: Amb. Frankie Simonis

Last Updated:

Views: 6413

Rating: 4.6 / 5 (56 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Amb. Frankie Simonis

Birthday: 1998-02-19

Address: 64841 Delmar Isle, North Wiley, OR 74073

Phone: +17844167847676

Job: Forward IT Agent

Hobby: LARPing, Kitesurfing, Sewing, Digital arts, Sand art, Gardening, Dance

Introduction: My name is Amb. Frankie Simonis, I am a hilarious, enchanting, energetic, cooperative, innocent, cute, joyous person who loves writing and wants to share my knowledge and understanding with you.