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

Set Option Infer to ON and on Sub Main remove Private access modifier #50

Closed
elGuille-info opened this issue Dec 2, 2020 · 3 comments
Closed

Comments

@elGuille-info
Copy link

In a small file for console application I found this:
Set Option Infer to On because in for loops the variable isn't assigned a type
For i = 1 To args.Length -1
And in C# the "infer" is default when using var.

I know you can set in the CSharpToVB application, but... it should be as default ON (like Option Strict is).

The Sub Main method was set as Private Sub Main and as a console application (even on WinForms) should be the entry point.

On the Editor will be a good idea to use another font type for view the code (Cosnsolas, etc.) or at least an option to set the font.

These are my 2 cents :-)
Thanks!

Guillermo
(#evolveVB #evolucionarVB)

@paul1956
Copy link
Owner

@elGuille-info Thanks for the feedback

You can set the Option defaults any way you want under Options/Advanced Options.. and the app will remember. You can also select what you want included in each file. So I am not going to change this. If I ever have an installer it could set the defaults or I could force user to it on First Run.

I agree about Consolas and will change in next update and allow user to set Font for the session. I will save it when VS supports settings fully in a future update,

Not sure how to fix Sub Main I do special case it as below. If you can recommend a solution open a separate issue and I will look at it

If Me.IsModule AndAlso
  methodNameToken.ValueText = "Main" AndAlso
  node.Modifiers.Count = 1 AndAlso
  node.Modifiers(0).IsKind(CS.SyntaxKind.StaticKeyword) Then
  modifiers = PublicModifier.ToList
Else
    modifiers = ConvertModifiers(node.Modifiers, Me.IsModule, If(containingType?.IsInterfaceType() = True, TokenContext.Local, TokenContext.Member)).ToList
End If

@elGuille-info
Copy link
Author

You can set the Option defaults any way you want under Options/Advanced Options.. and the app will remember. You can also select what you want included in each file. So I am not going to change this. If I ever have an installer it could set the defaults or I could force user to it on First Run.

Yes, I know, but if you are converting from C# to VB, and the user doesn't set OPTION INFER to ON then can get erros because C# always use the equivalent Option Infer On.
Or at least set Option Infer On and Option Strict On by default.

Guillermo

@paul1956
Copy link
Owner

paul1956 commented Dec 12, 2020

@elGuille-info I changed default but it will not change any existing installations (its the way setting works). Option Strict on is already the default.

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