Vixen
02b45cc4
csharp
public sealed class ShaderDocument

A Raven shader, open for editing, with the front end's complaints against it.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Lex, parse and bind — and stop there. That is where the diagnostics an author can act on come from: an unterminated string, a type that does not exist, a call whose arguments do not fit. Lowering and a backend produce artefacts, and an artefact is not what a keystroke is asking for. Doc 07's shader compiler service is what runs the rest, out of process, when something actually needs SPIR-V.

⚠ One file, no references. The compilation is this tree alone, so a shader that imports another names a symbol the binder cannot resolve and gets a diagnostic for it. Resolving those needs the project's whole shader set and a reference graph, which is the compiler service's model rather than a panel's — and until an editor has it, the honest thing is that cross-file errors are reported and cross-file successes are not yet possible.

⚠ A diagnostic with no location lands on line one. Location.None means the complaint is about the compilation rather than about a span — and dropping those would hide exactly the ones that are hardest to work out from the file.

Fields and properties (2)

  • public const string Extension

    What a Raven shader is written as.

  • public override ICodeTokenizer Tokenizer

Methods (2)

  • public ShaderDocument(EditorProject project, AssetId asset, string path)

    Opens a shader.

  • protected override IReadOnlyList<CodeDiagnostic> Analyse(string text)

    What is wrong with a text, for whatever language this document is.

Used by (5)

  • CodeAnalysisTestsVixen.Editor.AssetEditors.Tests
  • CodeDocumentTestsVixen.Editor.AssetEditors.Tests
  • MarkupDocumentVixen.Editor.AssetEditors
  • ShaderEditorFactoryVixen.Editor.AssetEditors
  • ShaderGraphDocumentVixen.Editor.AssetEditors