You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C# has its keywords as case sensitive otherwise this leads to the generation of invalid classnames/file names such as @Event.cs or a class declaration like public class @Event
Thanks for reporting the issue. One of the reasons why I went with case insensitive is because I didn't want to have duplicated entries (e.g. string and String). But if this is causing issues we could: 1. make the hashset case sensitive. 2. duplicate all the entries that need to be. I think this should be a case by case evaluation for each language. While this doesn't seem to be an issue for typescript. I'm not sure whether it will or not for Go and Ruby.
Would you mind taking this on?
Taking a look at the other languages (Go, Ruby), it seems that the reserved name escaping is done by adding a suffix (the string _escaped) rather than a prefix as is done in .Net. So, I don't think this will affect other languages as language rules want identifiers to start with alphabetical characters.
After looking at the code, the approach suggested, might not work as reservedNames are matched with the name of the codeElement (which may already be in lower case to be later converted to the language specific scenario like capitalization)
#657 resolves this by adding the ability to add a blacklist to prevent the reserved names replacement based on the CodeElement type as we may know beforehand that this is unnecessary (e.g a class name that will be capitalized or to prevent the changing of the property value)
The reserved keywords are in a case insensitive collection at the moment as shown below.
kiota/src/Kiota.Builder/Refiners/CSharpReservedNamesProvider.cs
Line 7 in 389e4e2
C# has its keywords as case sensitive otherwise this leads to the generation of invalid classnames/file names such as
@Event.cs
or a class declaration likepublic class @Event
Example here
We might have to consider this as well for languages we know for sure are case-sensitive.
AB#11195
The text was updated successfully, but these errors were encountered: