{"id":13681952,"url":"https://github.com/tgjones/HlslTools","last_synced_at":"2025-04-30T06:33:22.416Z","repository":{"id":2199802,"uuid":"43505277","full_name":"tgjones/HlslTools","owner":"tgjones","description":"A Visual Studio extension that provides enhanced support for editing High Level Shading Language (HLSL) files","archived":false,"fork":false,"pushed_at":"2024-04-20T11:07:35.000Z","size":8122,"stargazers_count":556,"open_issues_count":61,"forks_count":95,"subscribers_count":30,"default_branch":"master","last_synced_at":"2024-08-02T13:33:11.633Z","etag":null,"topics":["hlsl","parser","visual-studio"],"latest_commit_sha":null,"homepage":"http://timjones.io/blog/archive/2016/04/25/hlsl-tools-for-visual-studio-v1.0-released","language":"HLSL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tgjones.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-01T15:44:38.000Z","updated_at":"2024-07-30T23:59:03.000Z","dependencies_parsed_at":"2023-07-05T18:02:26.586Z","dependency_job_id":"b24e1d3f-0347-4e84-ab95-edc9d27cccde","html_url":"https://github.com/tgjones/HlslTools","commit_stats":{"total_commits":753,"total_committers":12,"mean_commits":62.75,"dds":"0.44090305444887123","last_synced_commit":"54687140d929fd349a3177accfe7b736c4ae8633"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tgjones%2FHlslTools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tgjones%2FHlslTools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tgjones%2FHlslTools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tgjones%2FHlslTools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tgjones","download_url":"https://codeload.github.com/tgjones/HlslTools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224201786,"owners_count":17272645,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hlsl","parser","visual-studio"],"created_at":"2024-08-02T13:01:38.262Z","updated_at":"2025-04-30T06:33:22.410Z","avatar_url":"https://github.com/tgjones.png","language":"HLSL","funding_links":[],"categories":["HLSL","d3d11 repositories","Tools"],"sub_categories":["w32 youtube videos"],"readme":"# HLSL Tools for Visual Studio [![Join the chat at https://gitter.im/tgjones/HlslTools](https://badges.gitter.im/tgjones/HlslTools.svg)](https://gitter.im/tgjones/HlslTools) [![Build Status](https://dev.azure.com/timjones/HlslTools/_apis/build/status/tgjones.HlslTools?branchName=master)](https://dev.azure.com/timjones/HlslTools/_build/latest?definitionId=3\u0026branchName=master)\n\n*This extension is for Visual Studio 2019 / 2022. [Go here for the Visual Studio Code extension](https://github.com/tgjones/HlslTools/tree/master/src/ShaderTools.VSCode).*\n\nHLSL Tools is a Visual Studio 2019 / 2022 extension that provides enhanced support for editing High Level Shading Language (HLSL) files.\n\nDownload the extension at the [Visual Studio Marketplace](https://visualstudiogallery.msdn.microsoft.com/75ddd3be-6eda-4433-a850-458b51186658).\n\nSee the [changelog](CHANGELOG.md) for changes.\n\n### Why use HLSL Tools?\n\nSince Visual Studio 2012, Visual Studio has shipped with basic support for editing HLSL files.\nIn addition to that basic feature set, HLSL Tools includes many more navigational and editing features:\n\n| VS2019 / VS2022      | VS2019 / VS2022 with HLSL Tools |\n| -------------------- | ------------------------------- |\n| Syntax highlighting  | Syntax highlighting             |\n| Automatic formatting | Automatic formatting            |\n| Brace matching       | Brace matching                  |\n| Brace completion     | Brace completion                |\n| Outlining            | Outlining                       |\n|                      | [Statement completion](#statement-completion) |\n|                      | [Signature help](#signature-help) |\n|                      | [Reference highlighting](#reference-highlighting) |\n|                      | [Navigation bar](#navigation-bar) |\n|                      | [Navigate to (Ctrl+,)](#navigate-to) |\n|                      | [Live errors](#live-errors) |\n|                      | [Go to definition](#go-to-definition) |\n|                      | [Quick info](#quick-info) |\n|                      | [Gray out code excluded by preprocessor](#preprocessor-support) |\n|                      | [HLSL-specific preferences](#options) |\n\nThere are more features [on the roadmap](CHANGELOG.md).\n\n### Features\n\n#### Statement completion\n\nJust start typing, and HLSL Tools will show you a list of the available symbols (variables, functions, etc.)\nat that location. You can manually trigger this with the usual shortcuts: `Ctrl+J`, `Ctrl+Space`, etc.\n\n![Statement completion demo](art/statement-completion.gif)\n\n#### Signature help\n\nSignature help (a.k.a. parameter info) shows you all the overloads for a function call, along with information (from MSDN)\nabout the function, its parameters, and return types. Typing an open parenthesis will trigger statement\ncompletion, as will the standard `Ctrl+Shift+Space` shortcut. Signature help is available for all HLSL functions and methods,\nincluding the older `tex2D`-style texture sampling functions, and the newer `Texture2D.Sample`-style methods.\n\n![Signature help demo](art/signature-help.gif)\n\n#### Reference highlighting\n\nPlacing the cursor within a symbol (local variable, function name, etc.) will cause all references to\nthat symbol to be highlighted. Navigate between references using `Ctrl+Shift+Up` and `Ctrl+Shift+Down`.\n\n![Reference highlighting demo](art/reference-highlighting.gif)\n\n#### Navigation bar\n\n![Navigation bar demo](art/navigation-bar.gif)\n\n#### Navigate To\n\nHLSL Tools supports Visual Studio's Navigate To feature. Activate it with `Ctrl+,`, and start typing the name\nof the variable, function, or other symbol that you want to find.\n\n![Navigate To demo](art/navigate-to.gif)\n\n#### Live errors\n\nHLSL Tools shows you syntax and semantic errors immediately. No need to wait till compilation!\nErrors are shown as squigglies and in the error list.\n\n![Live errors demo](art/live-errors.gif)\n\n#### Go to definition\n\nPress F12 to go to a symbol definition. Go to definition works for variables, fields, functions, classes,\nmacros, and more.\n\n![Go to definition demo](art/go-to-definition.gif)\n\n#### Quick info\n\nHover over almost anything (variable, field, function call, macro, semantic, type, etc.) to see a Quick Info tooltip.\n\n![Quick info demo](art/quick-info.gif)\n\n#### Preprocessor support\n\nHLSL Tools evaluates preprocessor directives as it parses your code, and grays out excluded code.\nIf you want to make a code block visible to, or hidden from, HLSL Tools, use the `__INTELLISENSE__` macro:\n\n![__INTELLISENSE__ macro demo](art/intellisense-macro.gif)\n\n#### Options\n\nConfigure HLSL-specific IntelliSense and formatting options. If you really want to, you can disable IntelliSense altogether\nand just use HLSL Tools' other features. You can also set HLSL-specific highlighting colours in \nTools \u003e Options \u003e Environment \u003e Fonts and Colors.\n\n![Options demo](art/options.gif)\n\n### Extras\n\n#### The code\n\nHLSL Tools includes a [handwritten HLSL parser](https://github.com/tgjones/HlslTools/blob/master/src/HlslTools).\nIt initially used an ANTLR lexer and parser,\nbut the handwritten version was faster, and offered better error recovery.\n\nHLSL Tools has a reasonable test suite - although it can certainly be improved. Amongst more granular tests,\nit includes a suite of 433 shaders, including all of the shaders from the DirectX and Nvidia SDKs.\nIf you want to contribute gnarly source files which push HLSL to its limit, that would be great!\n\n#### Syntax visualizer\n\nInspired by Roslyn, HLSL Tools includes a syntax visualizer. It's primarily of interest to HLSL Tools developers,\nbut may be of interest to language nerds, so it's included in the main extension. Open it using `View \u003e Other Windows \u003e HLSL Syntax Visualizer`.\n\n![Syntax visualizer demo](art/syntax-visualizer.gif)\n\n### Custom preprocessor definitions and additional include directories\n\nHLSL Tools has a built-in preprocessor to handle `#define` and `#include` directives. The behavior\nof this preprocessor can be customised by creating a file named `shadertoolsconfig.json`:\n\n``` json\n{\n  \"hlsl.preprocessorDefinitions\": {\n    \"MY_PREPROCESSOR_DEFINE_1\": \"Foo\",\n    \"MY_PREPROCESSOR_DEFINE_2\": 1\n  },\n  \"hlsl.additionalIncludeDirectories\": [\n    \"C:\\\\Code\\\\MyDirectoryA\",\n    \"C:\\\\Code\\\\MyDirectoryB\",\n    \".\",\n    \"..\\\\RelativeDirectory\"\n  ],\n  \"hlsl.virtualDirectoryMappings\": {\n    \"/Project\": \"C:\\\\MyProject\\\\Shaders\"\n  }\n}\n```\n\n* `hlsl.preprocessorDefinitions`: It's normal for additional preprocessor definitions to be defined\n  as part of a project build. In some cases, the shader won't compile correcty without these. To handle\n  this, you can add those additional preprocessor definitions here.\n* `hlsl.additionalIncludeDirectories`: HLSL Tools will, by default, only use the directory containing \n  the source file to search for `#include` files. Additional include directories can be added here.\n* `hlsl.virtualDirectoryMappings`: Use this to configure the virtual directory mappings required by\n  Unreal Engine. The virtual directory (`/Project` in the example above) must start with a forward slash or backslash.\n\nHLSL Tools will look for a file named `shadertoolsconfig.json` in the directory of an opened file,\nand in every parent directory. A search for `shadertoolsconfig.json` files will stop when the drive\nroot is reached or a `shadertoolsconfig.json` file with `\"root\": true` is found. If multiple config\nfiles are found during this search, they will be combined, with properties in closer files taking\nprecedence.\n\nConfig files are cached for performance reasons. If you make make changes to a config file,\nyou'll need to close and re-open any source files that use that config file.\n\n### Getting involved\n\nYou can ask questions in our [Gitter room](https://gitter.im/tgjones/HlslTools).\nIf you find a bug or want to request a feature, [create an issue here ](https://github.com/tgjones/HlslTools/issues).\nYou can find me on Twitter at [@\\_tim_jones\\_](https://twitter.com/_tim_jones_) and I tweet about HLSL Tools using the\n[#hlsltools](https://twitter.com/hashtag/hlsltools) hashtag.\n\nContributions are always welcome. [Please read the contributing guide first.](CONTRIBUTING.md)\n\n### Maintainer(s)\n\n* [@tgjones](https://github.com/tgjones)\n\n### Acknowledgements\n\n* Much of the code structure, and some of the actual code, comes from [Roslyn](https://github.com/dotnet/roslyn).\n* [NQuery-vnext](https://github.com/terrajobst/nquery-vnext) is a nice example of a simplified Roslyn-style API,\n  and HLSL Tools borrows some of its ideas and code.\n* [Node.js Tools for Visual Studio](https://github.com/Microsoft/nodejstools) and\n  [Python Tools for Visual Studio](https://github.com/Microsoft/PTVS) are amongst the best examples of how to build\n  a language service for Visual Studio, and were a great help.\n* [ScriptSharp](https://github.com/nikhilk/scriptsharp) is one of the older open-source .NET-related compilers,\n  and is still a great example of how to structure a compiler.\n* [LangSvcV2](https://github.com/tunnelvisionlabs/LangSvcV2) includes many nice abstractions for some of the more\n  complicated parts of Visual Studio's language service support.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftgjones%2FHlslTools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftgjones%2FHlslTools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftgjones%2FHlslTools/lists"}