Add help links for well-known elements
Includes elements such as Import, ItemGroup, PropertyGroup, etc. Also includes well-known tasks.
Relates to tintoy/msbuild-project-tools-server#4
We can also have extension points so that Custom Sdks can have their own help files
like for my Sdk I can include <My.Custom.Sdk>\Docs folder to include my specific props/targets/tasks and for those Sdks that don't have their own Docs folder within their Sdk, We can have one from the Community, into the fallback folder like the one you have for Common props and targets!
I will update those help files in my repo for specific files and my sdk and test them and I'll include a PR later, if you are okay with this idea!
Sure! Might be worth investigating whether there's an "official" way to package help for SDKs too? Or maybe we could add support for parsing XSDs to extract from there?
On Sat, 14 Apr. 2018, 6:02 pm Nirmal Guru, [email protected] wrote:
We can also have extension points so that Custom Sdks can have their own help files
like for my Sdk I can include <My.Custom.Sdk>\Docs folder to include my specific props/targets/tasks and for those Sdks that don't have their own Docs folder within their Sdk, We can have one from the Community, like the one you have for Common props and targets!
I will update those help files in my repo for specific files and my sdk and test them and I'll include a PR later, if you are okay with this idea!
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tintoy/msbuild-project-tools-server/issues/5#issuecomment-381311933, or mute the thread https://github.com/notifications/unsubscribe-auth/ABkezIt_DSbzRS7o09OLtXqfAoY2Weboks5toa0qgaJpZM4TU6jq .
The NuGet team proposed having docs along-side lib and ref folder but they killed the feature in-favour of having docs within lib or ref folder!
Now Sdks have becoming a thing I could ask NuGet team to include docs for Sdk packages, I will do that once my PoC works!
CC: @Nirmal4G - the help links are working now; if I can build you a custom .vsix package would you be willing to try it out and provide feedback?
Yes, I'd be happy too!
I'm already experimenting with help files coming from the SDKs!
@Nirmal4G - here you go:
https://github.com/tintoy/msbuild-project-tools-server/releases/tag/v0.2.34
You'll need to manually uninstall the existing extension and then install this one via the Install from VSIX menu item in the extension list.
Element help is configured here.
Ok, I installed it and the tools are successfully loading and logging in the window but I'm not getting any intellisense or hover contents!?
Also getting this:
[Error - 12:08:09] Failed to provide completions.
System.ArgumentException: Argument cannot be null, empty, or entirely composed of whitespace: 'itemName'.
Parameter name: itemType
at MSBuildProjectTools.LanguageServer.SemanticModel.MSBuildSchemaHelp.ForItemType(String itemType) in D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.SemanticModel.MSBuild\MSBuildSchemaHelp.cs:line 335
at MSBuildProjectTools.LanguageServer.CompletionProviders.ItemMetadataCompletion.<GetElementCompletions>d__5.MoveNext() in D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.Engine\CompletionProviders\ItemMetadataCompletion.cs:line 231
at System.Collections.Generic.List`1.AddEnumerable(IEnumerable`1 enumerable)
at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
at MSBuildProjectTools.LanguageServer.CompletionProviders.ItemMetadataCompletion.<ProvideCompletions>d__3.MoveNext() in D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.Engine\CompletionProviders\ItemMetadataCompletion.cs:line 73
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at MSBuildProjectTools.LanguageServer.Handlers.CompletionHandler.<OnCompletion>d__27.MoveNext() in D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.Engine\Handlers\CompletionHandler.cs:line 193
[Error - 12:08:23] Failed to provide completions.
System.ArgumentException: Argument cannot be null, empty, or entirely composed of whitespace: 'itemName'.
Parameter name: itemType
at MSBuildProjectTools.LanguageServer.SemanticModel.MSBuildSchemaHelp.ForItemType(String itemType) in D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.SemanticModel.MSBuild\MSBuildSchemaHelp.cs:line 335
at MSBuildProjectTools.LanguageServer.CompletionProviders.ItemMetadataCompletion.<GetElementCompletions>d__5.MoveNext() in D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.Engine\CompletionProviders\ItemMetadataCompletion.cs:line 231
at System.Collections.Generic.List`1.AddEnumerable(IEnumerable`1 enumerable)
at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
at MSBuildProjectTools.LanguageServer.CompletionProviders.ItemMetadataCompletion.<ProvideCompletions>d__3.MoveNext() in D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.Engine\CompletionProviders\ItemMetadataCompletion.cs:line 73
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at MSBuildProjectTools.LanguageServer.Handlers.CompletionHandler.<OnCompletion>d__27.MoveNext() in D:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.Engine\Handlers\CompletionHandler.cs:line 193
Hmm, that's odd - sorry, roll back to the official release and I'll investigate in the meanwhile.
Are you able to share the project XML where you saw this error?
If not, can you turn the logging up to Verbose in the extension settings and post the full log when you get that error? From looking at the code, I'm not sure how that error could arise :-/
The project is open source, It's here in the source folder of this MSBuild-Sdks repo!
If not, can you turn the logging up to Verbose in the extension settings
How do I do that?
No worries - if I can open the project file myself you don't need to :)
It's dinner time here in Australia, but I'll have a look at this first thing tomorrow :) Thanks for trying it out so quickly BTW
No problem, I'm working on these projects, anyway!
I can open the project file
Then you need to set env variable MSBuildSdksPath to point to the Source folder of the repo to pickup my custom SDKs
@nirmal4G - was the location where you're seeing the error a PropertyGroupelement inside a Target element (rather than inside the root Project element by any chance? And does it happen with the currently-released version as well?
(I have a theory but am not at my computer to check right now)
Or the same pattern for an ItemGroup...
One thing I've realised while looking into this issue is that PropertyGroup and ItemGroup elements appearing inside Target elements are currently not entirely visible to the project system (because they are only evaluated when the target is built).
It's still possible to parse them (but not to evaluate them) if we extend the semantic model (MSBuildObject and its inheritors) to capture the required information from:
Although we'll need to do a bit more work to match them back up to their originating XML elements to get intellisense working because ProjectPropertyGroupTaskInstance / ProjectItemGroupTaskInstance don't expose that information the way ProjectProperty / ProjectItem do.
We can probably get the information we need via Microsoft.Build.Evaluation.Project::Xml (which is a Microsoft.Build.Construction.ProjectRootElement) which enables us to scan for all PropertyGroup / ItemGroup XML elements within Target elements.
One thing we may need to watch for is whether this additional scanning has a performance impact; I'm hoping not, but we'll have to see.
@Nirmal4G - which project file, specifically, were you having problems with? I've tried opening a couple of the files in your project, and I get full intellisense (completions and tooltips-on-hover).
which project file, specifically, were you having problems with?
*.nuproj and custom SDK based (*.*proj) projects
was the location where you're seeing the error a PropertyGroupelement inside a Target element (rather than inside the root Project element by any chance? And does it happen with the currently-released version as well?
No Target element. Although now that you mention it, the same problem which was happening inside the project root element with SDK attribute defined (with a custom value), is happening inside the target element as well. Nice find!
Thanks, will give it a try in an hour or so
BTW, how are you overriding the msbuild extensions path? Via environment variable?
Oops, you did already say how - sorry only just woke up about 15 mins ago :)
BTW, have you seen this? https://docs.microsoft.com/en-us/visualstudio/msbuild/how-to-use-project-sdk