racz16 / WebGL-GLSL-Editor

WebGL GLSL shader editor extension for Visual Studio Code.
Other
100 stars 12 forks source link

WebGL GLSL Editor

Visual Studio Marketplace Version Visual Studio Marketplace Installs Visual Studio Marketplace Downloads Visual Studio Marketplace Rating Codacy Badge build and package

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.

syntax highlight

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.

diagnostic

Offline documentation

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

offline documentation

Signature help

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

signature help

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.

code completion

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.

formatting

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.

embedded code in HTML

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

embedded code in JavaScript

Rename

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

rename

Highlights

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

highlights

Hover

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

hover

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.

symbols

Inlay hints

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

inlay hints

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.

color picker

Code injection

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

code injection

Show/Peek call hierarchy

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

call hierarchy

Go to/Peek declarations

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

declarations

Go to/Peek definitions

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

definitions

Go to/Peek type definitions

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

type definitions

Go to/Find all/Peek implementations

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

implementations

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.

references

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.

before the preprocessor

Folding

You can collapse or expand code blocks.

folding

Commands for online documentation

You can easily access several online documentations by commands.

online documentation

Other features

Configuration

Builtin Visual Studio Code configuration

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

Notes

Known Issues

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

1.3.7

1.3.6

1.3.5

1.3.4

1.3.3

1.3.2

1.3.1

1.3.0

1.2.2

1.2.1

1.2.0

1.1.1

1.1.0

1.0.1

1.0.0

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.