Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 1.6 KB

editor-setup.md

File metadata and controls

35 lines (24 loc) · 1.6 KB

Editor setup

Astro docs: Editor setup

Astro's own editor setup is unchanged — the Astro extension, the language server, astro check.

For the C#, open the folder in any C# editor. The integration generates .astrosharp/AstroSharpApp.csproj, which globs your src/ and references the NuGet packages you declared, so IntelliSense, go-to-definition and diagnostics all work against the same project the build uses.

Nothing to configure: the project is written on every run, before compilation.

What you get

Because it is a real project referencing the real AstroSharp.dll, the whole surface lights up — [Parameter], IContentLoader, AstroResults, the Astro global inside a .razor file — with the same completion and the same errors the build will produce.

Existing .razor tooling applies unchanged, since these are ordinary Razor components.

Limitations

Never edit .astrosharp/, and do not commit it. It holds a generated .csproj and a generated _Imports.razor, and is recreated on a cold start, so an edit is lost without warning. Add packages through nugetDependencies or the packages option instead.

The project has to exist before the editor is useful, so run astro dev or astro build once after cloning. An editor opened on a fresh checkout sees no project and reports everything as unresolved.

A .razor file's .astro neighbours are opaque to the C# editor, and vice versa. Nothing type-checks a prop passed from an .astro page to a C# component — see TypeScript.