A Visual Studio extension that provides enhanced support for editing High Level Shading Language (HLSL) files

Overview

HLSL Tools for Visual Studio Join the chat at https://gitter.im/tgjones/HlslTools Build Status

This extension is for Visual Studio 2017 / 2019. Go here for the Visual Studio Code extension.

HLSL Tools is a Visual Studio 2017 / 2019 extension that provides enhanced support for editing High Level Shading Language (HLSL) files.

Download the extension at the Visual Studio Marketplace.

See the changelog for changes.

Why use HLSL Tools?

Since Visual Studio 2012, Visual Studio has shipped with basic support for editing HLSL files. In addition to that basic feature set, HLSL Tools includes many more navigational and editing features:

VS2017 / VS2019 VS2017 / VS2019 with HLSL Tools
Syntax highlighting Syntax highlighting
Automatic formatting Automatic formatting
Brace matching Brace matching
Brace completion Brace completion
Outlining Outlining
Statement completion
Signature help
Reference highlighting
Navigation bar
Navigate to (Ctrl+,)
Live errors
Go to definition
Quick info
Gray out code excluded by preprocessor
HLSL-specific preferences

There are more features on the roadmap.

Features

Statement completion

Just start typing, and HLSL Tools will show you a list of the available symbols (variables, functions, etc.) at that location. You can manually trigger this with the usual shortcuts: Ctrl+J, Ctrl+Space, etc.

Statement completion demo

Signature help

Signature help (a.k.a. parameter info) shows you all the overloads for a function call, along with information (from MSDN) about the function, its parameters, and return types. Typing an open parenthesis will trigger statement completion, as will the standard Ctrl+Shift+Space shortcut. Signature help is available for all HLSL functions and methods, including the older tex2D-style texture sampling functions, and the newer Texture2D.Sample-style methods.

Signature help demo

Reference highlighting

Placing the cursor within a symbol (local variable, function name, etc.) will cause all references to that symbol to be highlighted. Navigate between references using Ctrl+Shift+Up and Ctrl+Shift+Down.

Reference highlighting demo

Navigation bar

Navigation bar demo

Navigate To

HLSL Tools supports Visual Studio's Navigate To feature. Activate it with Ctrl+,, and start typing the name of the variable, function, or other symbol that you want to find.

Navigate To demo

Live errors

HLSL Tools shows you syntax and semantic errors immediately. No need to wait till compilation! Errors are shown as squigglies and in the error list.

Live errors demo

Go to definition

Press F12 to go to a symbol definition. Go to definition works for variables, fields, functions, classes, macros, and more.

Go to definition demo

Quick info

Hover over almost anything (variable, field, function call, macro, semantic, type, etc.) to see a Quick Info tooltip.

Quick info demo

Preprocessor support

HLSL Tools evaluates preprocessor directives as it parses your code, and grays out excluded code. If you want to make a code block visible to, or hidden from, HLSL Tools, use the __INTELLISENSE__ macro:

INTELLISENSE macro demo

Options

Configure HLSL-specific IntelliSense and formatting options. If you really want to, you can disable IntelliSense altogether and just use HLSL Tools' other features. You can also set HLSL-specific highlighting colours in Tools > Options > Environment > Fonts and Colors.

Options demo

Extras

The code

HLSL Tools includes a handwritten HLSL parser. It initially used an ANTLR lexer and parser, but the handwritten version was faster, and offered better error recovery.

HLSL Tools has a reasonable test suite - although it can certainly be improved. Amongst more granular tests, it includes a suite of 433 shaders, including all of the shaders from the DirectX and Nvidia SDKs. If you want to contribute gnarly source files which push HLSL to its limit, that would be great!

Syntax visualizer

Inspired by Roslyn, HLSL Tools includes a syntax visualizer. It's primarily of interest to HLSL Tools developers, but may be of interest to language nerds, so it's included in the main extension. Open it using View > Other Windows > HLSL Syntax Visualizer.

Syntax visualizer demo

Custom preprocessor definitions and additional include directories

HLSL Tools has a built-in preprocessor to handle #define and #include directives. The behavior of this preprocessor can be customised by creating a file named shadertoolsconfig.json:

{
  "hlsl.preprocessorDefinitions": {
    "MY_PREPROCESSOR_DEFINE_1": "Foo",
    "MY_PREPROCESSOR_DEFINE_2": 1
  },
  "hlsl.additionalIncludeDirectories": [
    "C:\\Code\\MyDirectoryA",
    "C:\\Code\\MyDirectoryB",
    ".",
    "..\\RelativeDirectory"
  ],
  "hlsl.virtualDirectoryMappings": {
    "/Project": "C:\\MyProject\\Shaders"
  }
}
  • hlsl.preprocessorDefinitions: It's normal for additional preprocessor definitions to be defined as part of a project build. In some cases, the shader won't compile correcty without these. To handle this, you can add those additional preprocessor definitions here.
  • hlsl.additionalIncludeDirectories: HLSL Tools will, by default, only use the directory containing the source file to search for #include files. Additional include directories can be added here.
  • hlsl.virtualDirectoryMappings: Use this to configure the virtual directory mappings required by Unreal Engine. The virtual directory (/Project in the example above) must start with a forward slash or backslash.

HLSL Tools will look for a file named shadertoolsconfig.json in the directory of an opened file, and in every parent directory. A search for shadertoolsconfig.json files will stop when the drive root is reached or a shadertoolsconfig.json file with "root": true is found. If multiple config files are found during this search, they will be combined, with properties in closer files taking precedence.

Config files are cached for performance reasons. If you make make changes to a config file, you'll need to close and re-open any source files that use that config file.

Getting involved

You can ask questions in our Gitter room. If you find a bug or want to request a feature, create an issue here . You can find me on Twitter at @_tim_jones_ and I tweet about HLSL Tools using the #hlsltools hashtag.

Contributions are always welcome. Please read the contributing guide first.

Maintainer(s)

Acknowledgements

  • Much of the code structure, and some of the actual code, comes from Roslyn.
  • NQuery-vnext is a nice example of a simplified Roslyn-style API, and HLSL Tools borrows some of its ideas and code.
  • Node.js Tools for Visual Studio and Python Tools for Visual Studio are amongst the best examples of how to build a language service for Visual Studio, and were a great help.
  • ScriptSharp is one of the older open-source .NET-related compilers, and is still a great example of how to structure a compiler.
  • LangSvcV2 includes many nice abstractions for some of the more complicated parts of Visual Studio's language service support.
Comments
  • Feature request: define macros in project settings

    Feature request: define macros in project settings

    Unreal Engine 4 shaders are heavily #ifdefed, and most of those are defined at shader compile time by CPU code. This results in large parts of code being greyed out in the VS editor due to #if arguments evaluating to 0.

    Thus, it would be nice to define these from a dialog somewhere, preferably associated with the project.

    enhancement 
    opened by inequation 26
  • Autocomplete doubles up first letter

    Autocomplete doubles up first letter

    • Visual Studio 2015 Enterprise
    • Only third party extension installed aside from this is P4VS
    • Editing .usf (Unreal shaders, still compliant HLSL though) files
    • Tried nightly and VS Gallery version

    Steps to reproduce:

    1. With Intellisense on, type a variable or function name.
    2. When autocomplete shows up, select any of the suggestions.
    3. The first letter will be doubled up, e.g. CalcSceneColorAndDepth becomes CCalcSceneColorAndDepth.
    opened by Friendly0Fire 9
  • Crashes Visual Studio opening large file.

    Crashes Visual Studio opening large file.

    The extension makes Visual Studio crash a few seconds after opening a specific, relatively large file (~500 lines, plus includes and macros), every time the file is opened.

    Visual Studio 2015 Update 3 Community Windows 10 x64 Creators Update Xeon E5-2683 V3 32 GB RAM This version of the extension : http://vsixgallery.com/extension/7def6c01-a05e-42e6-953d-3fdea1891737/

    opened by ldotn 8
  • Implement keyword completion

    Implement keyword completion

    When you type if( or even if  (space), the code turns into ProcessIsolineTessFactors, so in order to properly type an if you have to either disable Intellisense altogether or remember to type ESC right after typing if. Now if is a pretty common keyword, it should be supported by the tool and should be on top of the Intellisense list. Every time I type an if it changes into something I don't want, that bothered me so much that I've disabled the feature altogether but then Notepad++ provides better coding capabilities. Other than that this tool is good and definitely keep up the good work! Too bad there's no official support from MS for a tool like this.

    opened by Alan-FGR 7
  • Is there a way to use HLSL tools with Unity?

    Is there a way to use HLSL tools with Unity?

    The last commit in "unity" banch was almost a year ago, with no stable release yet. Are there any plans to continue developing it in the nearest future?

    If not, is there any workaround to avoid the most crucial errors at least in the CG part of Unity shaders with the current stable version of HLSL tools? By errors I mean a lack of:

    • Support for the basic types like fixed
    • A way to specify a folder with Unity's built-in cginc files (so #include "UnityCG.cginc" won't highlight as an error and will also provide all the built-in functions/structs/macros).
    • Support for including cginc files by a path relatively to project root. So that #include "Assets/Shaders/MyFile.cginc" will work.
    • Support for preprocessor directives like #if defined(FOO).

    The whole ShaderLab part is not as important. After all, you can extract the entire CG code to the external cginc file, if you don't want to see errors. But inability to include cgincs and the lack of support for internal types devalues all the benefits of this amazing extention for Unity-shader development :disappointed_relieved: .

    opened by Lex-DRL 7
  • Add .usf (Unreal Engine shaders) to the list of supported extensions

    Add .usf (Unreal Engine shaders) to the list of supported extensions

    I work with the Unreal Engine 4 and I'd love it if I didn't have to manually change the GUID every time a HLSL Tools update arrives. ;)

    Perhaps you could just add this extension to the manifest? It's not a widely used one, there is little chance of ambiguity.

    enhancement 
    opened by inequation 7
  • PrimitiveIndex causes unhandled exception from BindFunctionInvocationExpression

    PrimitiveIndex causes unhandled exception from BindFunctionInvocationExpression

    VS 2019 (16.7.2), HlslTools 1.1.302

    This looks similar to #203, but the stack trace is a bit different. It happens in a very large HLSL file, so I don't know what code exactly triggered it. Other files in the same project are ok.

    This extension looks great otherwise - makes VS an actual IDE for HLSL, instead of a glorified notepad. Thanks for your work!

    VS xml log event with some newlines added for readability:

        <type>Error</type>
        <source>Editor or Editor Extension</source>
        <description>System.AggregateException: One or more errors occurred. 
    ---&gt; System.AggregateException: One or more errors occurred. 
    ---&gt; System.InvalidOperationException: Sequence contains no elements&#x000D;&#x000A;
       at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)&#x000D;&#x000A;
       at System.Linq.ImmutableArrayExtensions.First[T](ImmutableArray`1 immutableArray, Func`2 predicate)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindFunctionInvocationExpression(FunctionInvocationExpressionSyntax syntax)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindExpression(ExpressionSyntax node)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.Bind[TInput,TResult](TInput node, Func`2 bindMethod)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindEqualsValue(EqualsValueClauseSyntax syntax)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindInitializer(InitializerSyntax syntax)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindVariableDeclarator(VariableDeclaratorSyntax syntax, TypeSymbol variableType, Func`3 createSymbol)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.&lt;&gt;c__DisplayClass24_0.&lt;BindVariableDeclaration&gt;b__1(VariableDeclaratorSyntax x)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.Bind[TInput,TResult](TInput node, Func`2 bindMethod)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindVariableDeclaration(VariableDeclarationSyntax syntax, Symbol parent, Func`3 createSymbol)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindVariableDeclaration(VariableDeclarationSyntax syntax, Symbol parent)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindVariableDeclarationStatement(VariableDeclarationStatementSyntax syntax, Symbol parent)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindStatement(StatementSyntax syntax, Symbol parent)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.&lt;&gt;c__DisplayClass95_0.&lt;BindBlock&gt;b__1(StatementSyntax y)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.Bind[TInput,TResult](TInput node, Func`2 bindMethod)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.&lt;&gt;c__DisplayClass95_0.&lt;BindBlock&gt;b__0(StatementSyntax x)&#x000D;&#x000A;
       at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()&#x000D;&#x000A;
       at System.Linq.Buffer`1..ctor(IEnumerable`1 source)&#x000D;&#x000A;
       at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)&#x000D;&#x000A;
       at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable`1 items)&#x000D;&#x000A;
       at System.Collections.Immutable.ImmutableArray.ToImmutableArray[TSource](IEnumerable`1 items)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindBlock(BlockSyntax syntax, Symbol parent)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.&lt;&gt;c__DisplayClass29_0.&lt;BindFunctionDefinition&gt;b__3(BlockSyntax x)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.Bind[TInput,TResult](TInput node, Func`2 bindMethod)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindFunctionDefinition(FunctionDefinitionSyntax declaration, Symbol parent)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindGlobalDeclaration(SyntaxNode declaration, Symbol parent)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.&lt;&gt;c__DisplayClass16_0.&lt;BindTopLevelDeclarations&gt;b__1(SyntaxNode y)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.Bind[TInput,TResult](TInput node, Func`2 bindMethod)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.&lt;&gt;c__DisplayClass16_0.&lt;BindTopLevelDeclarations&gt;b__0(SyntaxNode x)&#x000D;&#x000A;
       at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()&#x000D;&#x000A;
       at System.Linq.Buffer`1..ctor(IEnumerable`1 source)&#x000D;&#x000A;
       at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)&#x000D;&#x000A;
       at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable`1 items)&#x000D;&#x000A;
       at System.Collections.Immutable.ImmutableArray.ToImmutableArray[TSource](IEnumerable`1 items)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindTopLevelDeclarations(List`1 declarations, Symbol parent)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindCompilationUnit(CompilationUnitSyntax compilationUnit)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindRoot(SyntaxNode syntax)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.Bind[TInput,TResult](TInput node, Func`2 bindMethod)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.Bind(SyntaxNode syntaxRoot, CancellationToken cancellationToken)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Compilation.Compilation.GetSemanticModel(Nullable`1 cancellationToken)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Compilation.Compilation.GetSemanticModelBase(CancellationToken cancellationToken)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Document.&lt;&gt;c__DisplayClass20_2.&lt;&lt;-ctor&gt;b__3&gt;d.MoveNext()&#x000D;&#x000A;
    --- End of stack trace from previous location where exception was thrown 
    ---&#x000D;&#x000A;
       at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)&#x000D;&#x000A;   
    --- End of inner exception stack trace 
    ---&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Document.&lt;GetSemanticModelAsync&gt;d__28.MoveNext()&#x000D;&#x000A;
    --- End of stack trace from previous location where exception was thrown 
    ---&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.QuickInfo.AbstractSemanticQuickInfoProvider.&lt;BindTokenAsync&gt;d__3.MoveNext()&#x000D;&#x000A;
    --- End of stack trace from previous location where exception was thrown 
    ---&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.QuickInfo.AbstractSemanticQuickInfoProvider.&lt;BuildContentAsync&gt;d__0.MoveNext()&#x000D;&#x000A;
    --- End of stack trace from previous location where exception was thrown 
    ---&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.QuickInfo.AbstractQuickInfoProvider.&lt;GetQuickInfoItemAsync&gt;d__2.MoveNext()&#x000D;&#x000A;
    --- End of stack trace from previous location where exception was thrown 
    ---&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.QuickInfo.AbstractQuickInfoProvider.&lt;GetItemAsync&gt;d__0.MoveNext()&#x000D;&#x000A;
    --- End of stack trace from previous location where exception was thrown 
    ---&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.QuickInfo.QuickInfoService.&lt;GetQuickInfoAsync&gt;d__6.MoveNext()&#x000D;&#x000A;
    --- End of stack trace from previous location where exception was thrown 
    ---&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Editor.Implementation.QuickInfo.QuickInfoSource.&lt;GetQuickInfoItemAsync&gt;d__3.MoveNext()&#x000D;&#x000A;
    --- End of stack trace from previous location where exception was thrown 
    ---&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;
       at Microsoft.VisualStudio.Language.Intellisense.Implementation.AsyncQuickInfoSession.&lt;ComputeSourceContentAsync&gt;d__39.MoveNext()&#x000D;&#x000A;   
    --- End of inner exception stack trace 
    ---&#x000D;&#x000A;
       at Microsoft.VisualStudio.Language.Intellisense.Implementation.AsyncQuickInfoSession.&lt;UpdateAsync&gt;d__32.MoveNext()&#x000D;&#x000A;
    --- End of stack trace from previous location where exception was thrown 
    ---&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;
       at Microsoft.VisualStudio.Language.Intellisense.Implementation.AsyncQuickInfoPresentationSession.&lt;UpdateAsync&gt;d__5.MoveNext()&#x000D;&#x000A;
    ---&gt; (Inner Exception #0) System.AggregateException: One or more errors occurred. 
    ---&gt; System.InvalidOperationException: Sequence contains no elements&#x000D;&#x000A;
       at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)&#x000D;&#x000A;
       at System.Linq.ImmutableArrayExtensions.First[T](ImmutableArray`1 immutableArray, Func`2 predicate)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindFunctionInvocationExpression(FunctionInvocationExpressionSyntax syntax)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindExpression(ExpressionSyntax node)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.Bind[TInput,TResult](TInput node, Func`2 bindMethod)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindEqualsValue(EqualsValueClauseSyntax syntax)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindInitializer(InitializerSyntax syntax)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindVariableDeclarator(VariableDeclaratorSyntax syntax, TypeSymbol variableType, Func`3 createSymbol)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.&lt;&gt;c__DisplayClass24_0.&lt;BindVariableDeclaration&gt;b__1(VariableDeclaratorSyntax x)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.Bind[TInput,TResult](TInput node, Func`2 bindMethod)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindVariableDeclaration(VariableDeclarationSyntax syntax, Symbol parent, Func`3 createSymbol)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindVariableDeclaration(VariableDeclarationSyntax syntax, Symbol parent)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindVariableDeclarationStatement(VariableDeclarationStatementSyntax syntax, Symbol parent)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindStatement(StatementSyntax syntax, Symbol parent)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.&lt;&gt;c__DisplayClass95_0.&lt;BindBlock&gt;b__1(StatementSyntax y)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.Bind[TInput,TResult](TInput node, Func`2 bindMethod)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.&lt;&gt;c__DisplayClass95_0.&lt;BindBlock&gt;b__0(StatementSyntax x)&#x000D;&#x000A;
       at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()&#x000D;&#x000A;
       at System.Linq.Buffer`1..ctor(IEnumerable`1 source)&#x000D;&#x000A;
       at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)&#x000D;&#x000A;
       at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable`1 items)&#x000D;&#x000A;
       at System.Collections.Immutable.ImmutableArray.ToImmutableArray[TSource](IEnumerable`1 items)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindBlock(BlockSyntax syntax, Symbol parent)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.&lt;&gt;c__DisplayClass29_0.&lt;BindFunctionDefinition&gt;b__3(BlockSyntax x)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.Bind[TInput,TResult](TInput node, Func`2 bindMethod)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindFunctionDefinition(FunctionDefinitionSyntax declaration, Symbol parent)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindGlobalDeclaration(SyntaxNode declaration, Symbol parent)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.&lt;&gt;c__DisplayClass16_0.&lt;BindTopLevelDeclarations&gt;b__1(SyntaxNode y)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.Bind[TInput,TResult](TInput node, Func`2 bindMethod)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.&lt;&gt;c__DisplayClass16_0.&lt;BindTopLevelDeclarations&gt;b__0(SyntaxNode x)&#x000D;&#x000A;
       at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()&#x000D;&#x000A;
       at System.Linq.Buffer`1..ctor(IEnumerable`1 source)&#x000D;&#x000A;
       at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)&#x000D;&#x000A;
       at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable`1 items)&#x000D;&#x000A;
       at System.Collections.Immutable.ImmutableArray.ToImmutableArray[TSource](IEnumerable`1 items)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindTopLevelDeclarations(List`1 declarations, Symbol parent)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindCompilationUnit(CompilationUnitSyntax compilationUnit)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindRoot(SyntaxNode syntax)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.Bind[TInput,TResult](TInput node, Func`2 bindMethod)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.Bind(SyntaxNode syntaxRoot, CancellationToken cancellationToken)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Compilation.Compilation.GetSemanticModel(Nullable`1 cancellationToken)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Compilation.Compilation.GetSemanticModelBase(CancellationToken cancellationToken)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Document.&lt;&gt;c__DisplayClass20_2.&lt;&lt;-ctor&gt;b__3&gt;d.MoveNext()&#x000D;&#x000A;
    --- End of stack trace from previous location where exception was thrown 
    ---&#x000D;&#x000A;
       at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)&#x000D;&#x000A;   
    --- End of inner exception stack trace 
    ---&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Document.&lt;GetSemanticModelAsync&gt;d__28.MoveNext()&#x000D;&#x000A;
    --- End of stack trace from previous location where exception was thrown 
    ---&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.QuickInfo.AbstractSemanticQuickInfoProvider.&lt;BindTokenAsync&gt;d__3.MoveNext()&#x000D;&#x000A;
    --- End of stack trace from previous location where exception was thrown 
    ---&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.QuickInfo.AbstractSemanticQuickInfoProvider.&lt;BuildContentAsync&gt;d__0.MoveNext()&#x000D;&#x000A;
    --- End of stack trace from previous location where exception was thrown 
    ---&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.QuickInfo.AbstractQuickInfoProvider.&lt;GetQuickInfoItemAsync&gt;d__2.MoveNext()&#x000D;&#x000A;
    --- End of stack trace from previous location where exception was thrown 
    ---&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.QuickInfo.AbstractQuickInfoProvider.&lt;GetItemAsync&gt;d__0.MoveNext()&#x000D;&#x000A;
    --- End of stack trace from previous location where exception was thrown 
    ---&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.QuickInfo.QuickInfoService.&lt;GetQuickInfoAsync&gt;d__6.MoveNext()&#x000D;&#x000A;
    --- End of stack trace from previous location where exception was thrown 
    ---&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Editor.Implementation.QuickInfo.QuickInfoSource.&lt;GetQuickInfoItemAsync&gt;d__3.MoveNext()&#x000D;&#x000A;
    --- End of stack trace from previous location where exception was thrown 
    ---&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;
       at Microsoft.VisualStudio.Language.Intellisense.Implementation.AsyncQuickInfoSession.&lt;ComputeSourceContentAsync&gt;d__39.MoveNext()&#x000D;&#x000A;
    ---&gt; (Inner Exception #0) System.InvalidOperationException: Sequence contains no elements&#x000D;&#x000A;
       at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)&#x000D;&#x000A;
       at System.Linq.ImmutableArrayExtensions.First[T](ImmutableArray`1 immutableArray, Func`2 predicate)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindFunctionInvocationExpression(FunctionInvocationExpressionSyntax syntax)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindExpression(ExpressionSyntax node)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.Bind[TInput,TResult](TInput node, Func`2 bindMethod)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindEqualsValue(EqualsValueClauseSyntax syntax)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindInitializer(InitializerSyntax syntax)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindVariableDeclarator(VariableDeclaratorSyntax syntax, TypeSymbol variableType, Func`3 createSymbol)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.&lt;&gt;c__DisplayClass24_0.&lt;BindVariableDeclaration&gt;b__1(VariableDeclaratorSyntax x)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.Bind[TInput,TResult](TInput node, Func`2 bindMethod)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindVariableDeclaration(VariableDeclarationSyntax syntax, Symbol parent, Func`3 createSymbol)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindVariableDeclaration(VariableDeclarationSyntax syntax, Symbol parent)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindVariableDeclarationStatement(VariableDeclarationStatementSyntax syntax, Symbol parent)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindStatement(StatementSyntax syntax, Symbol parent)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.&lt;&gt;c__DisplayClass95_0.&lt;BindBlock&gt;b__1(StatementSyntax y)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.Bind[TInput,TResult](TInput node, Func`2 bindMethod)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.&lt;&gt;c__DisplayClass95_0.&lt;BindBlock&gt;b__0(StatementSyntax x)&#x000D;&#x000A;
       at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()&#x000D;&#x000A;
       at System.Linq.Buffer`1..ctor(IEnumerable`1 source)&#x000D;&#x000A;
       at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)&#x000D;&#x000A;
       at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable`1 items)&#x000D;&#x000A;
       at System.Collections.Immutable.ImmutableArray.ToImmutableArray[TSource](IEnumerable`1 items)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindBlock(BlockSyntax syntax, Symbol parent)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.&lt;&gt;c__DisplayClass29_0.&lt;BindFunctionDefinition&gt;b__3(BlockSyntax x)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.Bind[TInput,TResult](TInput node, Func`2 bindMethod)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindFunctionDefinition(FunctionDefinitionSyntax declaration, Symbol parent)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindGlobalDeclaration(SyntaxNode declaration, Symbol parent)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.&lt;&gt;c__DisplayClass16_0.&lt;BindTopLevelDeclarations&gt;b__1(SyntaxNode y)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.Bind[TInput,TResult](TInput node, Func`2 bindMethod)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.&lt;&gt;c__DisplayClass16_0.&lt;BindTopLevelDeclarations&gt;b__0(SyntaxNode x)&#x000D;&#x000A;
       at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()&#x000D;&#x000A;
       at System.Linq.Buffer`1..ctor(IEnumerable`1 source)&#x000D;&#x000A;
       at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)&#x000D;&#x000A;
       at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable`1 items)&#x000D;&#x000A;
       at System.Collections.Immutable.ImmutableArray.ToImmutableArray[TSource](IEnumerable`1 items)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindTopLevelDeclarations(List`1 declarations, Symbol parent)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindCompilationUnit(CompilationUnitSyntax compilationUnit)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.BindRoot(SyntaxNode syntax)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.Bind[TInput,TResult](TInput node, Func`2 bindMethod)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Binding.Binder.Bind(SyntaxNode syntaxRoot, CancellationToken cancellationToken)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Compilation.Compilation.GetSemanticModel(Nullable`1 cancellationToken)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Hlsl.Compilation.Compilation.GetSemanticModelBase(CancellationToken cancellationToken)&#x000D;&#x000A;
       at ShaderTools.CodeAnalysis.Document.&lt;&gt;c__DisplayClass20_2.&lt;&lt;-ctor&gt;b__3&gt;d.MoveNext()&#x000D;&#x000A;
    --- End of stack trace from previous location where exception was thrown 
    ---&#x000D;&#x000A;
       at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)&lt;
    ---&#x000D;&#x000A;&lt;
    ---&#x000D;&#x000A;</description>```
    opened by ngcg 6
  • Unreal files with extension .usf and .ush not parsing correctly.

    Unreal files with extension .usf and .ush not parsing correctly.

    Unreal shader files that are open in VS2019 will parse correctly when the solution is first opened but any other .ush .usf files that are then opened will not parse unless VS2019 is closed and then reopened.

    Also when pasting text into an unreal shader file that appears to have parsed correctly, results in the text being pasted twice into the file.

    I made a private build of HlslTools with the Unreal extensions added but it resulted in no change in outcome apart from the fact that I no longer need to add the extensions in VS2019 Text editor extension options.

    Branch in my fork is here https://github.com/PiezPiedPy/HlslTools/tree/UE4

    opened by PiezPiedPy 6
  • Highlight matching parens feature

    Highlight matching parens feature

    It would be nice for HLSL Tools to highlight matching parens, brackets, and braces when the cursor is placed on one of the pair, similar to VS and other editors.

    opened by Reedbeta 6
  • Macros does not work with #ifdef

    Macros does not work with #ifdef

    I have added my defined by accessing: options.PreprocessorDefines.Add("VERTEX_COLOR")

    Then in my shader if I have #if VERTEX_COLOR it works, but if I have #ifdef VERTEX_COLOR does not work.

    opened by amerkoleci 6
  • Please ignore Raw string literals.

    Please ignore Raw string literals.

    Hi, I'd like to #include my shaders with my source code, unfortunately I can't put R"( and )" around my shader because the syntax high-lighting gets completely removed. Is there anyway it can just ignore the R"( at the start of the code? Thanks.

    opened by DaveHoskins 5
  • Chaos with Syntax and utilities in inactive code areas

    Chaos with Syntax and utilities in inactive code areas

    Most of the features seem to break down when trying to write code inside of an inactive code fragment, such as when blocking code off with preprocessor directives:

    #define X 1
    #ifdef X
      - this area works great
    #else
      - this area throws fits
    #endif
    

    When typing code inside of an inactive portion, the auto-completions and other utilities fail to function correctly. I'm not sure what causes this to happen, but I would recommend only changing the syntax color of inactive areas. It is very common to use preprocessor directives to convert one shader into multiple shaders, so the inactive portion is usually just as important as the active portion.

    Perhaps we could even have an option to completely disable the syntax changes of inactive code, so that all sections appear to be active at once? But if not, we definitely need to be able to write code in them, which is currently not very feasible. For example, even if I have a variable named g declared, if I type "g =", I get "else =".

    Since I'm doing a lot of complaining, I wanted to mention how much I love this addon! It is incredibly useful! Thanks!

    opened by RobertMtx 0
  • Non-existent problems reported

    Non-existent problems reported

    First I was getting a warning for this line of hlsl: r3 = mul(r0.xyz, (float3x4)gWorldToProj); saying:

    Implicit truncation from 'float3x4' to 'float1x4

    Which is clearly wrong, since it's explicit casting, so I cut the cast type to give this (which should cause the warning): r3 = mul(r0.xyz, gWorldToProj); which ended up with this error:

    Variable 'oj' is not declared.

    Which looks like it's ignoring the length of characters I cut from the start of the variable name (it's using the start index before I cut for the token start, rather than after)

    When I paste the cast type back in, the warning doesn't return, but the invalid error remains.

    I don't always get the initial warning though.

    opened by Nintynuts 0
  • Language Server errors

    Language Server errors

    Not entirely sure what has triggered them, but these have come up:

    [Error - 16:25:09] OmniSharp.Extensions.JsonRpc.InputHandler: Failed to handle request textDocument/documentHighlight 38 - System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'position')
       at ShaderTools.CodeAnalysis.Hlsl.Syntax.SyntaxTree.MapRootFilePosition(Int32 position)
       at ShaderTools.CodeAnalysis.ReferenceHighlighting.DocumentHighlightsService.GetDocumentHighlightsAsync(Document document, Int32 position, IImmutableSet`1 documentsToSearch, CancellationToken cancellationToken)
       at ShaderTools.LanguageServer.Handlers.DocumentHighlightHandler.Handle(DocumentHighlightParams request, CancellationToken token)
       at OmniSharp.Extensions.LanguageServer.Server.Pipelines.SemanticTokensDeltaPipeline`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
       at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
       at MediatR.Pipeline.RequestPreProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
       at MediatR.Pipeline.RequestPostProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
       at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
       at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
       at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
       at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
       at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1.<RouteRequest>g__InnerRoute|5_0(IServiceScopeFactory serviceScopeFactory, Request request, TDescriptor descriptor, Object params, CancellationToken token, ILogger logger)
       at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1.RouteRequest(IRequestDescriptor`1 descriptors, Request request, CancellationToken token)
       at OmniSharp.Extensions.JsonRpc.InputHandler.<>c__DisplayClass38_0.<<RouteRequest>b__5>d.MoveNext() | Method='textDocument/documentHighlight' RequestId='38'
    
    [Error - 16:25:09] Request textDocument/documentHighlight failed.
      Message: Internal Error - System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'position')
       at ShaderTools.CodeAnalysis.Hlsl.Syntax.SyntaxTree.MapRootFilePosition(Int32 position)
       at ShaderTools.CodeAnalysis.ReferenceHighlighting.DocumentHighlightsService.GetDocumentHighlightsAsync(Document document, Int32 position, IImmutableSet`1 documentsToSearch, CancellationToken cancellationToken)
       at ShaderTools.LanguageServer.Handlers.DocumentHighlightHandler.Handle(DocumentHighlightParams request, CancellationToken token)
       at OmniSharp.Extensions.LanguageServer.Server.Pipelines.SemanticTokensDeltaPipeline`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
       at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
       at MediatR.Pipeline.RequestPreProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
       at MediatR.Pipeline.RequestPostProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
       at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
       at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
       at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
       at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
       at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1.<RouteRequest>g__InnerRoute|5_0(IServiceScopeFactory serviceScopeFactory, Request request, TDescriptor descriptor, Object params, CancellationToken token, ILogger logger)
       at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1.RouteRequest(IRequestDescriptor`1 descriptors, Request request, CancellationToken token)
       at OmniSharp.Extensions.JsonRpc.InputHandler.<>c__DisplayClass38_0.<<RouteRequest>b__5>d.MoveNext()
      Code: -32603 
    
    [Error - 16:29:14] OmniSharp.Extensions.JsonRpc.InputHandler: Failed to handle request textDocument/hover 3 - System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'index')
     at Microsoft.CodeAnalysis.Text.SourceText.LineInfo.get_Item(Int32 index)
     at Microsoft.CodeAnalysis.Text.TextLineCollection.GetPosition(LinePosition position)
     at ShaderTools.LanguageServer.LanguageServerWorkspace.GetLogicalDocument(TextDocumentPositionParams textDocumentPositionParams)
     at ShaderTools.LanguageServer.Handlers.HoverHandler.Handle(HoverParams request, CancellationToken token)
     at OmniSharp.Extensions.LanguageServer.Server.Pipelines.SemanticTokensDeltaPipeline`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
     at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
     at MediatR.Pipeline.RequestPreProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
     at MediatR.Pipeline.RequestPostProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
     at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
     at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
     at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
     at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
     at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1.<RouteRequest>g__InnerRoute|5_0(IServiceScopeFactory serviceScopeFactory, Request request, TDescriptor descriptor, Object params, CancellationToken token, ILogger logger)
     at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1.RouteRequest(IRequestDescriptor`1 descriptors, Request request, CancellationToken token)
     at OmniSharp.Extensions.JsonRpc.InputHandler.<>c__DisplayClass38_0.<<RouteRequest>b__5>d.MoveNext() | Method='textDocument/hover' RequestId='3'
    
    [Error - 16:29:14] Request textDocument/hover failed.
    Message: Internal Error - System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'index')
     at Microsoft.CodeAnalysis.Text.SourceText.LineInfo.get_Item(Int32 index)
     at Microsoft.CodeAnalysis.Text.TextLineCollection.GetPosition(LinePosition position)
     at ShaderTools.LanguageServer.LanguageServerWorkspace.GetLogicalDocument(TextDocumentPositionParams textDocumentPositionParams)
     at ShaderTools.LanguageServer.Handlers.HoverHandler.Handle(HoverParams request, CancellationToken token)
     at OmniSharp.Extensions.LanguageServer.Server.Pipelines.SemanticTokensDeltaPipeline`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
     at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
     at MediatR.Pipeline.RequestPreProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
     at MediatR.Pipeline.RequestPostProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
     at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
     at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
     at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
     at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
     at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1.<RouteRequest>g__InnerRoute|5_0(IServiceScopeFactory serviceScopeFactory, Request request, TDescriptor descriptor, Object params, CancellationToken token, ILogger logger)
     at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1.RouteRequest(IRequestDescriptor`1 descriptors, Request request, CancellationToken token)
     at OmniSharp.Extensions.JsonRpc.InputHandler.<>c__DisplayClass38_0.<<RouteRequest>b__5>d.MoveNext()
    Code: -32603 
    

    Since I'm not sure what's triggering it, here is the github repo for my VS Code workspace so maybe you can figure it out: https://github.com/Nintynuts/3DMigoto-Splinter-Cell-Blacklist-DX11

    opened by Nintynuts 0
  • Bump underscore and vsce in /src/ShaderTools.VSCode

    Bump underscore and vsce in /src/ShaderTools.VSCode

    Bumps underscore to 1.13.4 and updates ancestor dependency vsce. These dependencies need to be updated together.

    Updates underscore from 1.8.3 to 1.13.4

    Commits
    • a15d1af Update generated files, tag 1.13.4 release
    • 979dfc4 Merge branch 'prepare-1.13.4'
    • fcb149d Add a change log entry for 1.13.4
    • cf6ed6f Bump the version to 1.13.4
    • 75d257f Merge pull request #2959 from petschki/module-federation-version
    • 46d77d3 Fix for webpack module federation "No version" error
    • da06656 Merge pull request #2956 from zackschuster/patch-1
    • adf8838 fix heading nesting
    • 5af5ecb update contributing to clarify how to clone from other sources
    • 6ce24a2 add fsck error workaround to contributing.md #2887
    • Additional commits viewable in compare view
    Maintainer changes

    This version was pushed to npm by jgonggrijp, a new releaser for underscore since your current version.


    Updates vsce from 1.81.1 to 1.103.1

    Release notes

    Sourced from vsce's releases.

    v1.103.1

    1.103.1 (2021-11-04)

    Bug Fixes

    v1.103.0

    1.103.0 (2021-11-03)

    Features

    v1.102.0

    1.102.0 (2021-11-02)

    Bug Fixes

    • detect expired PAT (19f51dc), closes #466
    • normalize relative paths when rewriting links (a537741), closes #535
    • prepublish should run before version bump (535fa75), closes #187

    Features

    • add --no-dependencies flag (d797b8d), closes #439
    • allow --no-update-package-json when providing (a8f432c), closes #596

    v1.101.0

    1.101.0 (2021-11-02)

    Features

    • engineering: add semantic-release (b0fdd41), closes #541
    Commits
    • 32990ce fix: delay import of keytar
    • b8f72c8 feat: make KeytarStore the default
    • 4dc0e69 Merge branch 'main' into keytar
    • b0a1476 eng: update package-lock.json to v2
    • 730030b test: include node 16 and 17
    • a7275d4 Merge branch 'main' into keytar
    • f50212e test: fix package tests on windows
    • 7bc87d5 feat: introduce Keytar store
    • 535fa75 fix: prepublish should run before version bump
    • 768d15b test: fix test failures
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump markdown-it and vsce in /src/ShaderTools.VSCode

    Bump markdown-it and vsce in /src/ShaderTools.VSCode

    Bumps markdown-it to 12.3.2 and updates ancestor dependency vsce. These dependencies need to be updated together.

    Updates markdown-it from 10.0.0 to 12.3.2

    Changelog

    Sourced from markdown-it's changelog.

    [12.3.2] - 2022-01-08

    Security

    [12.3.1] - 2022-01-07

    Fixed

    • Fix corner case when tab prevents paragraph continuation in lists, #830.

    [12.3.0] - 2021-12-09

    Changed

    • StateInline.delimiters[].jump is removed.

    Fixed

    • Fixed quadratic complexity in pathological ***<10k stars>***a***<10k stars>*** case.

    [12.2.0] - 2021-08-02

    Added

    • Ordered lists: add order value to token info.

    Fixed

    • Always suffix indented code block with a newline, #799.

    [12.1.0] - 2021-07-01

    Changed

    • Updated CM spec compatibility to 0.30.

    [12.0.6] - 2021-04-16

    Fixed

    • Newline in alt should be rendered, #775.

    [12.0.5] - 2021-04-15

    Fixed

    • HTML block tags with === inside are no longer incorrectly interpreted as headers, #772.
    • Fix table/list parsing ambiguity, #767.

    [12.0.4] - 2020-12-20

    Fixed

    • Fix crash introduced in 12.0.3 when processing strikethrough (~~) and similar plugins, #742.
    • Avoid fenced token mutation, #745.

    [12.0.3] - 2020-12-07

    Fixed

    ... (truncated)

    Commits

    Updates vsce from 1.81.1 to 2.11.0

    Release notes

    Sourced from vsce's releases.

    v2.11.0

    2.11.0 (2022-08-29)

    Bug Fixes

    Features

    • expose all options to packaging and publishing APIs (#759) (8e193c9)

    v2.10.2

    2.10.2 (2022-08-19)

    Bug Fixes

    • clarify simultaneous use of packagePath and target in vsce publish (#765) (3024d0f), closes #764

    v2.10.1

    2.10.1 (2022-08-19)

    Bug Fixes

    • list all valid targets in documentation for --target (#766) (0940626), closes #763

    v2.10.0

    2.10.0 (2022-07-19)

    Features

    v2.9.3

    2.9.3 (2022-07-15)

    Bug Fixes

    v2.9.2

    2.9.2 (2022-06-21)

    Bug Fixes

    ... (truncated)

    Commits
    • 8e193c9 feat: expose all options to packaging and publishing APIs (#759)
    • 5110bcf fix: correct program path in launch.json (#771)
    • 742720a chore: set up #codereview automation (#768)
    • 3024d0f fix: clarify simultaneous use of packagePath and target in vsce publish (#765)
    • 0940626 fix: list all valid targets in documentation for --target (#766)
    • 27fad23 chore: add branch protection (#767)
    • 9c50aa6 feat: github actions logging (#752)
    • 7e16ed7 fix: support fragments in image URLs (#753)
    • 955c760 build(deps): bump shell-quote from 1.7.2 to 1.7.3 (#746)
    • 57112fd Merge pull request #745 from microsoft/fix-744
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
ShaderConductor is a tool designed for cross-compiling HLSL to other shading languages

ShaderConductor ShaderConductor is a tool designed for cross-compiling HLSL to other shading languages. Features Converts HLSL to readable, usable and

Microsoft 1.5k Dec 29, 2022
Visual Studio Extension that installs additional color themes

Using this Extension Download and install the extension Restart Visual Studio Navigate to Tools > Options > Environment > General and select your colo

Microsoft 328 Dec 19, 2022
A Visual Studio extension containing a collection of tools to help contributing code to the Chromium project.

VsChromium VsChromium is a Visual Studio Extension containing a collection of tools useful for editing, navigating and debugging code. VsChromium was

The Chromium Project 258 Dec 30, 2022
Visual Studio native debugger extension to help debug native applications using Mono.

Unity Mixed Callstack UnityMixedCallstack is a Visual Studio 2017/2019 extension to help debug native applications embedding Mono, like Unity. If you

Unity Technologies 83 Nov 28, 2022
HLSL Parser and Translator for HLSL, GLSL, and MSL.

HLSLParser This is a fork of Unknownworld's hlslparser adapted to our needs in The Witness. We currently use it to translate pseudo-HLSL shaders (usin

null 3 Jul 2, 2022
HLSL Parser and Translator for HLSL, GLSL, and MSL.

HLSLParser This is a fork of Unknownworld's hlslparser adapted to our needs in The Witness. We currently use it to translate pseudo-HLSL shaders (usin

null 315 Dec 25, 2022
Half-Life Singleplayer SDK 2.3, updated to compile with Visual Studio 2019. Provided as-is with no further support. See the README for more information.

Half Life 1 SDK LICENSE Half Life 1 SDK Copyright© Valve Corp. THIS DOCUMENT DESCRIBES A CONTRACT BETWEEN YOU AND VALVE CORPORATION (“Valve”). PLEASE

Sam Vanheer 6 Oct 10, 2022
Sharpmake is an open-source C#-based solution for generating project definition files, such as Visual Studio projects and solutions, GNU makefiles, Xcode projects, etc.

Sharpmake Introduction Sharpmake is a generator for Visual Studio projects and solutions. It is similar to CMake and Premake, but it is designed for s

Ubisoft 779 Dec 23, 2022
High-level interface for low-level programming

Singeli Singeli is now able to compile useful programs to C, but it's very rough around the edges, with poor error reporting. We are beginning to use

Marshall Lochbaum 40 Dec 30, 2022
Bungie's Oni modified so it compiles with Microsoft Visual Studio 2019.

OniFoxed What's this? This is a modified variant of the recently leaked Oni source code so that it compiles under Microsoft Visual Studio 2019 with so

Mark Sowden 59 Dec 2, 2022
A D++ Discord Bot template for Visual Studio 2019 (x64 and x86)

D++ Windows Bot Template A D++ Discord Bot template for Visual Studio 2019 (x64 and x86, release and debug). The result of this tutorial. This templat

brainbox.cc 28 Dec 24, 2022
A Visual Studio template used to create Cobalt Strike BOFs

Introduction Cobalt Strike beacon object files (BOFs) is a feature that added to the beacon in order to allow rapid beacon extendibility in a more OPS

Securify 163 Dec 28, 2022
Visual Studio Test Adapter for Catch2

Test Adapter for Catch2 Within Visual Studio, the Test Explorer is a convenient way to run and debug unit tests. This test adapter adds support for th

null 95 Dec 25, 2022
Useful UE4 Visual Studio extensions.

UE4 Smarter Macro Indenting This extension was designed to fix the unnecessary and annoying "smart" indenting that Visual Studio likes to do around va

Chris Pawlukowsky 250 Dec 16, 2022
An AI for playing NES Tetris at a high level. Based primarily on search & heuristic, with high quality board evaluation through value iteration.

StackRabbit An AI that plays NES Tetris at a high level. Primarily based on search & heuristic, with high-quality board eval through value iteration.

Greg Cannon 244 Jan 5, 2023
Program your micro-controllers in a fast and robust high-level language.

Toit language implementation This repository contains the Toit language implementation. It is fully open source and consists of the compiler, virtual

Toit language 988 Jan 4, 2023
RRxIO - Robust Radar Visual/Thermal Inertial Odometry: Robust and accurate state estimation even in challenging visual conditions.

RRxIO - Robust Radar Visual/Thermal Inertial Odometry RRxIO offers robust and accurate state estimation even in challenging visual conditions. RRxIO c

Christopher Doer 63 Dec 20, 2022
Visual Leak Detector for Visual C++ 2008-2015

Visual Leak Detector Introduction Visual C++ provides built-in memory leak detection, but its capabilities are minimal at best. This memory leak detec

Arkady Shapkin 908 Jan 8, 2023