Giter Site home page Giter Site logo

vscode-shader's People

Contributors

lostintangent avatar minalear avatar stef-levesque avatar svetx avatar systemcluster avatar tyriar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

vscode-shader's Issues

Action needed: update your import of the built-in ripgrep

Hello from the VS Code team 👋

We're doing some housekeeping that involves renaming some of our internal packages. Namely, vscode-ripgrep will be renamed to @vscode/ripgrep, which affects its location in VS Code's node_modules folder. It looks like this extension depends on vscode-ripgrep in a way that will break when this rename happens.

We suggest either:

  1. Adding an extra check for the renamed binary path in your extension, or
  2. Updating your extension to import vscode-ripgrep and retrieve the binary path from there. We will alias the require statement, so that the renamed package is always resolved correctly, and vscode-ripgrep exports the binary path. For example:
function getCoreNodeModule(moduleName) {
    try {
        return require(`${vscode.env.appRoot}/node_modules.asar/${moduleName}`);
    } catch (err) {
        try {
            return require(`${vscode.env.appRoot}/node_modules/${moduleName}`);
        } catch (err) {
            return undefined;
        }
    }
}

const { rgPath } = getCoreNodeModule('vscode-ripgrep');
// then child_process.spawn(rgPath, [...

Note that if you're building your extension with Webpack, you will want to use __non_webpack_require__ instead of require, otherwise webpack will try to (incorrectly) resolve the request by itself.

Syntax highlighting for non standard extensions.

Hi ,

Great extension. Was just wondering if there could be added support for non standard file name extensions. At the moment it's probably .cg .hlsl .shader , etc , but we use a proprietary extension at work. Thanks

C++ raw string highlighting

Is it possible to highlight shader code inside C++11 raw strings?

For example, highlight this.

R"(
#version 420 core

void main(void)
{
    gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
}
)"

Extension activation time is really high

With the new "Show Running Extensions" feature I noticed that this extension has an abnormally high start-up time. Most extensions start in 30-100ms, this one in 700+ (tested it multiple times).

Is there an easy way to fix this?

  • Extension Name: shader
  • Extension Version: 1.1.2
  • OS Version: Windows_NT x64 10.0.16299
  • VSCode version: 1.19.0

We have written the needed data into your clipboard. Please paste:

{
	"activationTimes": {
		"startup": false,
		"codeLoadingTime": 731,
		"activateCallTime": 0,
		"activateResolvedTime": 12,
		"activationEvent": "onLanguage:glsl"
	}
}

Extension's code formatting ignores CLANG format options file

Tl;Dr

When formatting HLSL code the resulting format ignores the .clang-format file that's present in the Workspace, if present. I didn't test other languages, but it seems like the extension still doesn't support formatting for shader languages that are not HLSL

Steps to reproduce

  • Create a .clang-format file that changes the behaviour of the default C++ formatter options set in VSCode
  • Launch formatting on an HLSL file
  • The file doesn't follow the non-default options

Potential cause

I tried to look around the code and I think I understood that to format an HLSL file the code creates a temporary copy of the file in the system's temp folder, appends .cpp to it and then calls the standard VSCode format call on it. When using clang-formatter as a formatter provider and with file as a default format style VSCode looks for a .clang-format file by traversing the parent folders of the file (or so I understood from the documentation). Since we go in another root altogether the .clang-format file is not found.

HLSL Formatting does not work

When I press format document it's just do nothing. Currently I'm using last version of VSCode 1.74.3. I was trying to debug extension but I cannot fix it. It creates cpp file successfully but this line just return undefined (extension.ts, line 24)

return vscode.commands.executeCommand<vscode.TextEdit[]>('vscode.executeFormatDocumentProvider', doc.uri, options) .then(r => (tmpFile.removeCallback(), r));

I tried to copy my hlsl code to cpp file and format and it works. But I do not why extension seems can't do it action 'vscode.executeFormatDocumentProvider' return undefined. I checked doc.uri and options it also seems correct I do not know where is the problem.

Code highlighting and completion does not work.

Hello
I don't see any code highlighting nor completion in my files.
If I trigger [Ctrl]+[Space] I see only previously used keywords.
image

I'm using Code with WSL(ubuntu) but for Windows shell it also does not work.
image

Is there a way to enable it? (Extension is enabled)

any idea how to get GLSL syntax highlighting working in markdown?

In markdown code blocks can be highlighted in VSCode. Example text

# Markdown

Some text here with *italics* and **bold**
and [links](#foo).

Some JavaScript

```js
console.log('hello world');
```

Some **C#**

```csharp
class Foo {
  void process() {
    System.Console.WriteLine("Hello World!");
  }
}
```

Some **C++**

```cpp
#include <stdio.h>
int main(int argc, const char** argv) {
  printf("hello world\n");
  return 0;
}
```

Some **GLSL**

```glsl
in vec4 position;
uniform mat4 matrix;
void main() {
  gl_Position = matrix * position;
}
```

And the result in my VSCode looks like this

Screen Shot 2019-12-17 at 16 28 00

You can see above JavaScript, C++, C# are all syntax highlighted but not GLSL

Note that if I make a .glsl file then the syntax is highlighted

Screen Shot 2019-12-17 at 16 32 24

Any idea how to get VS code to use GLSL highlighting for GLSL blocks in markdown?

Add enhanced icon

I did render a new version of the icon of this addon; correct perspective of texts on the cube and proper transparency. (The current one disturbed me that much in my sidebar, that I thought I create one for you.)
I uploaded a 128x128 and a 2048x2048 version.
Please replace the current one.
Shader-Support-Icon-Small
Shader-Support-Icon-Large

Is there a symbol renaming feature?

In Visual Studio, you can usually double click a variable name and all instances of that variable will be highlighted. Afterwards, if you press Ctrl + R + R, you can rename all the symbols at once. Is there something like this for this extension?

Add support for Vulkan's GLSL... maybe

Adding new keywords introduced by Vulkan to the syntax highlighter is the easy part but there is a problem.

At the moment, vscode-shader's syntax highlighter contains some archaic GLSL constructs that don't quite align with Vulkan. One example is the keyword texture2D. At the very beginning texture2D was a function (GLSL 1.10), then it got deprecated and finally it got reintroduced in Vulkan as a type. At the moment the syntax highlighter thinks texture2D is a function.

I'm not sure what is the best course of action here. texture2D and co are functions in WebGL but types in Vulkan. Any idea how to solve this issue? Maybe have a config option to control this?

Please consider giving us a way to add custom extensions for shader files.

Hi there,

I love your Shader Languages package for VSC!

I work in game development and our shaders often come with game-engine specific file extensions, though the code within is still HLSL, GLSL, or CG.

Would it be possible for you to add a place where I can add custom file extensions to be handled by your highlighting package?

Thanks for the time and effort - it makes life much better!

~Alex

Can not reformat .glsl

I want to reformat some glsl code. But it tell me that I did not install format file.
When I change associate file to HLSL it work.
Is there something wrong?

Extension issue

  • Issue Type: Bug
  • Extension Name: shader
  • Extension Version: 1.1.5
  • OS Version: Windows_NT x64 10.0.19043
  • VS Code version: 1.57.0

⚠️ We have written the needed data into your clipboard. Please paste! ⚠️

Extension has caused the extension host to freeze. And it takes 8441ms to activate.

Word completion does not work when editing HLSL code

Normally, while typing, any words that exist in the current document are suggested, for example, when editing C code:

frog_c.mp4

But this does not work when editing HLSL code. It only suggests names of built-ins:

frog_hlsl.mp4

Using slevesque.shader last released 2021-02-08, 07:12:56.

Extension issue

  • Issue Type: Bug
  • Extension Name: shader
  • Extension Version: 1.1.5
  • OS Version: Windows_NT x64 10.0.19044
  • VS Code version: 1.69.2

⚠️ We have written the needed data into your clipboard. Please paste! ⚠️

"Find References and Definition" does not work

In the README.md, it's said that there is the feature "Find References and Definition".
But it doesn't work for me when I pressing F12 for a variable in a glsl file.
Also for a glsl file, it only says "No definition found for xxx".

The "Finding Definition" feature works for other languages like c++ in my Vscode.

highlight glsl inside javascript / typescript template strings

in ES 2015 there is a concept of template literals. More about that here
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals

In short: we can write something like this in js/ts

export const mySnippets = {
  foo: glsl`
    # some glsl source code to highlight
  `
}

where glsl is a tagged template

I would love to see syntax highlighting enabled for tagged templates like glsl and hlsl inside js/ts files. This is only about syntax highlighting, there is no need to provide these template functions.

Here is an example extension that does exactly that but with html templates

https://github.com/mjbvz/vscode-lit-html

Incorrect GLSL highlighting

Writing #ifdef and everything is correctly highlighted. However writing #if defined(...) causes the first line after to not be highlighted, and just plain white. Everything after that line is correctly highlighted again though.

Screenshot:

This also includes #elif defined(...).

Extension issue

  • Issue Type: Bug
  • Extension Name: shader
  • Extension Version: 1.1.5
  • OS Version: Windows_NT x64 6.2.9200
  • VS Code version: 1.69.2

⚠️ We have written the needed data into your clipboard. Please paste! ⚠️

Support WSGL language

I've been using WEBGPU lately and noticed there was no extension that supported proper highlight and/or completion. Would it be possible to add WSGL support?

Highlight WebGL shaders embedded in HTML file

In WebGL we can specify shaders in separate files or embedded in an HTML file like this:

<html>
  <script id="vertex-shader" type="x-shader/x-vertex">
    attribute vec4 vPosition;

    void main()
    {
      gl_Position = vPosition;
    }
  </script>
</html>

VSCode already has highlighting for embedded JS in an HTML file so I think this should be possible, although I'm not sure if it's within the realm of this extension or would require a change in the way VS Code parses HTML. The shader is identifiable as the text inside any <script> tag with the type property set to x-shader/x-vertex or x-shader/x-fragment. Syntax should be the same as OpenGL ES 2.0.

I could potentially have a look into implementing this is you think it's a worthwhile addition but don't have any experience in writing VS Code extensions so any help or ideas would be great. What do you reckon?

Add .usf and .ush as hlsl shading language

Hi,
When using unreal hlsl code is using the extention .usf and .ush. a simple modification in package.json with the 2 new files extensions had done the trick for me. Would be awesome if it's there by default so unreal shader code would work out of the box.

Code completion not working.

I see on the details page some shots for Completion Proposals and Help With Function and Method Signatures. But non of that works in glsl files?
Im on version 1.1.3

Upgrade to VS Code's webview API

Hi, I'm on the VS Code team. I noticed that your extension uses the vscode.previewHtml command which is deprecated and which we are actively working to remove: microsoft/vscode#62630

We've developed a webview API that provides a much better developer experience and offers a number of important security and compatibility benefits over previewHtml. We cannot fix previewHtml without breaking backwards compatibility, and have instead opted to remove it.

To ensure that your extension continues to work properly in VS Code, please try upgrading to use the new Webview API. You can find documentation on the API usage here. Let me know if you have any questions or concerns about this migration

VS Marketplace version not up to date

Hey, I was trying to get #43 running in VS Code but my embedded shaders weren't highlighted.

Then I noticed the merge happend on Feb 14 and https://marketplace.visualstudio.com/items?itemName=slevesque.shader says "Last updated | 2/8/2021".

If anyone else is looking for this – you can manually install the git version:

  • Remove the marketplace version from VS Code
  • Go to your extension folder
  • git clone https://github.com/stef-levesque/vscode-shader.git
  • cd vscode-shader && npm install
  • Reload/restart VS Code, the extension should be detected

Enable Alt+o to switch between .frag and .vert

It would be very comfortable to switch between vertex shader and fragment shader of the same name with this shortcut, like you can switch between .h and .cpp files in C++ with this shortcut

Add extension to OpenVSX registry

Hi, I used to use your extension in VSCode,
I now use gitpod and vscodium, I have to install it using the vsix file.
But there is a much better solution Eclipse foundation started a fully open source vscode extension registry name OpenVSX,
I would love it if you took a look at registering the extension there, so it can appear in non Microsoft VSCode alternatives.

Note that Microsoft is prohibiting the direct use of their marketplace by any non-Microsoft software, even though most extensions are actually open source and not developed or maintained by Microsoft. quoted from GitPod docs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.