Hezkore / deprecated-vscode-blitzmax-support

[Deprecated] VSCode BlitzMax Language Basics
MIT License
11 stars 0 forks source link

Same Line Access Modifiers and the Outline #10

Closed ConcernedCivet closed 4 years ago

ConcernedCivet commented 4 years ago

Setup (place X in matching boxes):

Describe the bug Good Afternoon!

Any function or type that is after an accessor ('Private', 'Public', Etc..) will not show in the outline.

As an example:

Function Foo()
    ...
End Function

will display correctly in the outline, but

Private Function Foo()
    ...
End Function

will not.

I do know that this is probably not standard convention for Max, but it doesn't cause a compiler error and the latest version of BlitzMax (NG) is able to list the items in its outline without issue.

I have also noticed syntax highlighting for hex and binary literals is not working, but the Outline is the one we use the most.

Screenshots image

Thank you for all the work you have been doing on here! At the risk of GitHub getting mad, I have to tell you that this plugin is fucking awesome!

Edit: Bad grammar!

Hezkore commented 4 years ago

Hmm, I'm certainly in no position to tell anyone how to code. (I haven't actively used BlitzMax in about 10 years) But I believe that Private and Public acts as sort of a "block" or "state". Where anything below Private would be private until Public is called. So it's not something you'd specifically assign to one single function.

For example, both test1 and test2 would be private in this case:

Private

Function test1()
    Print( "Hello 1" )
EndFunction

Function test2()
    Print( "Hello 2" )
EndFunction

Even in the following example both functions would be private:

Private Function test1()
    Print( "Hello 1" )
EndFunction

Function test2()
    Print( "Hello 2" )
EndFunction

So I'm not sure I'd like to actively encourage this way of coding by supporting it. Having said that, I feel like as long as BlitzMax allows it; I should support it... I guess I'll have a look at it!

Do you have any example of hex and binary literals not being correctly coloured?

And thank you for using the extension, reporting issues, and bringing a smile to my face!

ConcernedCivet commented 4 years ago

I see what you mean, and I don't want to encourage bad practices or change the language into something it isn't, so I guess that is more of an issue with the way I code in Max.

Here is a screenshot for the hex and binary literals:

image

If I'm not mistaken, they should all be light-blue in this case.

From the bottom two, I'm guessing it's using a fallback where it's checking for the standard 0x hex literal, but to be honest, I don't have the first clue how to setup a plugin for VSC. Hopefully the screenshot helps though!

Hezkore commented 4 years ago

https://github.com/Hezkore/vscode-blitzmax-support/commit/5ced2c1e16ca7771ac82a421529448fbf7c00cce fixes all of these issues. Pushed to marketplace as version 1.29.0.