Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Towards xsd-based auto-completion: An html5 CompletionProvider for XML Literals #527

Closed
VBAndCs opened this issue Apr 6, 2020 · 4 comments

Comments

@VBAndCs
Copy link

VBAndCs commented Apr 6, 2020

I added a VbXmlCompletionProvider to this repo
You can add the two files to your Roslyn fork, in the folder Completion/CompletionProviders in the project Microsoft.CodeAnalysis.VisualBasic.Features
It will provide HTML5 auto completion in VB.NET XML Literals, but only inside the <vbxml></vbxml> tag.
I did this for two reasons:

  1. not to mess with other xml literals that doesn't deal with html.
  2. to support Vazor.

I will make a VSIX for this to allow install it as a VS extension (in progress now), but my aim from publishing this, is to allow contributors to build upon to provide a generic XML literals completion provider, based on the xsd that user supplies in the context as this missing feature was described in the docs

@VBAndCs
Copy link
Author

VBAndCs commented Apr 7, 2020

And here is the VSIX installer to add this CompletionProvider to your VS as an extension:
untitled1

Give it a tr, but notice it provide auto completion for HTML5 in VB.NET XML literals only inside vbxml tags:

Dim x = <vbxml>
   <!auto completion for HTML 5 is available here -->
</vbxml>

Note: You can press Ctrl+space after <% to get this block written for you:

         <%= (Function()
                    Return < />
              End Function)()
         %>

where you can write vb conditions to form dynamic HTML parts as you want. You can also use loops but modify the lambda to be Iterator Function and Yield Html tags as you want.
Refer to Vazor ReadMe for more details.
Feedback is appreciated:
https://github.com/VBAndCs/Vazor/issues

@VBAndCs
Copy link
Author

VBAndCs commented Apr 7, 2020

To do:

  1. ZML auto completion.
  2. Tag helpers auto completion.
  3. Also I may reinvent tag helpers to be more suitable for VB.NET and XML literals. This will eliminate the need for Razor engine entirely which means I can drop the Virtual file provider, and process vbxml totally in VB.NET (Real Vazor). In fact this will be faster and more efficient then C# Razor , as there is no need Razor compiler to compile the page to a c# class then use it to generate HTML.

@VBAndCs
Copy link
Author

VBAndCs commented Apr 10, 2020

I told the whole Vazor story here: https://github.com/VBAndCs/Vazor/blob/master/A-Vazor-story.md

@CyrusNajmabadi
Copy link
Member

This doesn't seem to be an issue for the vblang repo. Closing out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants