-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Language Service for MSBuild #1774
Comments
We have been talking about this for years but I couldn't find an issue to track it. Prior art: @mhutch's https://github.com/mhutch/MonoDevelop.MSBuildEditor. |
Strong desire: an indication of the common but hard-to-diagnose error "you're using Similarly, having visual disambiguation between an item name and a property name could be extremely helpful. |
Not sure if it can be useful, but I have a full-fidelity XML parser with no dependencies: Also the old internal MSBuild source code has a prototype-level MSBuild language service written using ANTLR: Finally, it might be worth following up with XAML folks to see what we can reuse there. XAML language service is pretty powerful. /cc @piotrpMSFT @mlorbetske |
In my head, we'd plug into a project using our current evaluation model. I think it exposes almost all of the information you'd need for both colorization and completion. I hope we wouldn't need to write a grammar from scratch that's a superset of XML. I'm a bit shocked that someone tried! |
Stuff like that could be in a /lint mode. Not necessarily possible for a langauge service to see statically. |
Yeah, good somewhat orthogonal thought. Filed #1777. I think a reasonable language service could have enough information to do this, at least for outside-of-targets definitions . . . if it was evaluating the project in the right environment, which is a big consideration for the language service. Should be easy enough to get "the right environment" when in VS, but potentially harder in other environments. |
Hi - just saw this issue while searching for something else, and figured I'd leave this here for anyone who else who comes across it: https://github.com/tintoy/msbuild-project-tools-vscode/ It's LSP-compatible (currently works with VS Code and Eclipse) so feel free to reuse if it helps. |
(it also has support for parsing and interpreting MSBuild expressions) |
I think at this point @mhutch's language service is the clear winner in terms of functionality: |
Functionality looks the same to me but if that's what best fits your use-case then fair enough :) |
A language service needs a way to discover what items and properties to suggest. That shouldn't be the XSD. The XSD always was a big hack from day one. It is hard to read/grok, big and fat, non contextual, and relies on a single point of truth. In contrast the AvailableItemName concept has been successful because it allowed props/targets to add entries by convention in a simple decentralized way. We could replace the XSDs with a similar convention rooted in the props files. For example |
@danmosemsft make sure you saw https://github.com/mhutch/MonoDevelop.MSBuildEditor. It has videos what it can do. It doesn't use XSD but uses custom logic to intelligently calculate available completion items. We're going to port it to VS editor soon. |
Tagging @panopticoncentral who has been looking at this space lately too. |
Hey, that looks great. I see it uses a json sidecar file - I guess that works too. |
I'd love to hear comments on my MSBuild schema format. Hoping to finalize it soon so folks can start shipping sidecar schemas alongside their targets.. |
Currently, MSBuild gets syntax highlighting in most cases by piggybacking on XML. In Visual Studio, there is also some code completion based on XSDs.
This is better than nothing but doesn't help with the particularly hard parts of MSBuild, like completion of property names or item transforms.
It would be nice if there was a broadly-compatible language service that worked in (at least) VS, VS Code, and VS Mac.
The text was updated successfully, but these errors were encountered: