orlac
orlac
CC#
Created by orlac on 7/11/2024 in #help
Pattern matching `Type` in a way that can be assigned to a `const` variable... is it possible?
anyway, thank you both for the help 👍 . I think the info you gave me should get me past trying to get this type pattern matching to work.
50 replies
CC#
Created by orlac on 7/11/2024 in #help
Pattern matching `Type` in a way that can be assigned to a `const` variable... is it possible?
MS has tons of examples, somehow none of which truly show me how to approach some of this stuff. Just bits and pieces from their examples have slowly guided me towards something that's starting to work when it comes to the VS side of things. Once that's out of the way I should be able to actually sit down and mess around with the language a lot more since I can just implement the inner workings of it all and not have to worry about the scattered docs / examples they have for the SDKs.
50 replies
CC#
Created by orlac on 7/11/2024 in #help
Pattern matching `Type` in a way that can be assigned to a `const` variable... is it possible?
yeah, i know what you mean. this type of thing has been my entire experience with these SDKs so far haha. I ended up needing one library to run the out of process parts of the extension, then had to link (or whatever it'd be called in C# - "referenced" maybe haha) that to another library that runs the other parts of the extension in the same process as VS2022... plus need to wrangle the C++ LSP to get selected symbol information, needed to get a WebView2 working in this weird mixed environment of SDKs, etc etc. The stuff I thought would take the least amount of time have taken over the past few weekends for me haha. At least when this is done a somewhat comprehensive example will be out there for people to use as a reference.
50 replies
CC#
Created by orlac on 7/11/2024 in #help
Pattern matching `Type` in a way that can be assigned to a `const` variable... is it possible?
if that doesn't end up working i may actually mess around with the stuff that article goes over. it doesn't seem to bad. C# as a language is quite nice to mess with whenever i'm not trying to fight my way through the SDKs i need to use and actually get to implement stuff. I think it's the first language I've tried in the past decade that actually has a decent approach to parsing XML
50 replies
CC#
Created by orlac on 7/11/2024 in #help
Pattern matching `Type` in a way that can be assigned to a `const` variable... is it possible?
^ that part... the ResXFileCodeGenerator
50 replies
CC#
Created by orlac on 7/11/2024 in #help
Pattern matching `Type` in a way that can be assigned to a `const` variable... is it possible?
<EmbeddedResource Include="Resources\VSPackage.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>VSPackage.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Resources\VSPackage.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>VSPackage.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
50 replies
CC#
Created by orlac on 7/11/2024 in #help
Pattern matching `Type` in a way that can be assigned to a `const` variable... is it possible?
50 replies
CC#
Created by orlac on 7/11/2024 in #help
Pattern matching `Type` in a way that can be assigned to a `const` variable... is it possible?
the top link is what the resx ends up as after it runs through some special compilation process that VS provides
50 replies
CC#
Created by orlac on 7/11/2024 in #help
Pattern matching `Type` in a way that can be assigned to a `const` variable... is it possible?
50 replies
CC#
Created by orlac on 7/11/2024 in #help
Pattern matching `Type` in a way that can be assigned to a `const` variable... is it possible?
you're talking about code gen like this file, right?... or did you mean something else entirely? https://github.com/vorlac/cppreference-docs-vs-extension/blob/main/CppReferenceDocsExtension/Resources/VSPackage.Designer.cs
50 replies
CC#
Created by orlac on 7/11/2024 in #help
Pattern matching `Type` in a way that can be assigned to a `const` variable... is it possible?
although, now that I think about it, i think some of the resource files worked into the VS SDKs will handle source generation for strings (mostly for localization)... but i'll have to see if these end up working out OK using one of those resource files.
50 replies
CC#
Created by orlac on 7/11/2024 in #help
Pattern matching `Type` in a way that can be assigned to a `const` variable... is it possible?
yeah if it's something where people with actual C# experience would consider a pain, it definitely isn't needed for this project then haha. i'm dealing with enough pain trying to work with the collection of Visual Studio SDKs.... they seem to be in a state where they're in the middle of migrating from a few older SDKs into a newer model. Somehow I think i ended up where i need to use both the old and new SDK for what i'm trying to build.
50 replies
CC#
Created by orlac on 7/11/2024 in #help
Pattern matching `Type` in a way that can be assigned to a `const` variable... is it possible?
ok thanks for all of the info... you cleared up a handful of things for me. time to start hardcoding GUIDS haha
50 replies
CC#
Created by orlac on 7/11/2024 in #help
Pattern matching `Type` in a way that can be assigned to a `const` variable... is it possible?
yep, makes sense
50 replies
CC#
Created by orlac on 7/11/2024 in #help
Pattern matching `Type` in a way that can be assigned to a `const` variable... is it possible?
and yeah i'm pretty sure const is necessary since these get passed into attributes that then do some dark magic involving dependency injection
50 replies
CC#
Created by orlac on 7/11/2024 in #help
Pattern matching `Type` in a way that can be assigned to a `const` variable... is it possible?
i'm a c++ programmer so i'm very out of my element with this stuff lol. i'm guessing anything in the Reflection library also won't be compile time, assuming that's actually what const boils down to in C#... do i have that part right at least?
50 replies
CC#
Created by orlac on 7/11/2024 in #help
Pattern matching `Type` in a way that can be assigned to a `const` variable... is it possible?
and i'm guessing i can't approach it with a similar concept (except with an approach that works :pepe_laugh:)?
50 replies
CC#
Created by orlac on 7/11/2024 in #help
Pattern matching `Type` in a way that can be assigned to a `const` variable... is it possible?
yep haha, damn
50 replies
CC#
Created by orlac on 7/11/2024 in #help
Pattern matching `Type` in a way that can be assigned to a `const` variable... is it possible?
does that just return the variable name or something like that?
50 replies
CC#
Created by orlac on 7/11/2024 in #help
Pattern matching `Type` in a way that can be assigned to a `const` variable... is it possible?
guessing nameof(type) isn't getting the actual typename then lol
50 replies