BlitzMax VSCode extension worklog

Started by Hezkore, June 29, 2019, 20:11:31

Previous topic - Next topic

Hezkore

#45
I've always wanted to make the BlitzMax VSCode extension the only thing the user has to install.
When I say "only thing the user has to install" I basically mean that the extension should install and setup BlitzMax NG for you if you don't currently have it.
It should also notify you of any future updates, and ask if it should download and apply this new update for you.
(BlitzMax Legacy is never being updated, so it doesn't need any of this)

But I'm not quite there yet.
Especially since there's a whole slew of considerations to be made regarding cross-platform compatibility.

I have however made the extension notify you when there's a new BlitzMax NG release available.
It won't download and patch things for you, but it'll at least point you in the right direction.



Pressing 'Yes' will launch the default browser and take you to the download page for BlitzMax NG.
'No' or pressing the X will just close the info window.
And pressing 'Never' will disable the update check at startup.

You can of course disable this any time you'd like by going into settings.



You can also trigger a manual check by using the command (Ctrl + Shift + P) Check for BlitzMax NG Updates.



This update is already out as version 1.20.0.
Simplicity is the ultimate sophistication. 🚀
GitHub
BlitzMax for VSCode
BlitzMax for Vim

DruggedBunny

#46
That's working well here, thanks Hezkore!

iWasAdam

Agreed  - excellent work - this just get better and better

DruggedBunny

Hi Hezkore, is it possible to turn off, or customise, auto-formatting? I've never liked the 'standard' style, like so:

TGLFWWindow.Hint( GLFW_CONTEXT_VERSION_MAJOR, 3 )


... preferring instead a more 'real English' punctuation, like so:

TGLFWWindow.Hint (GLFW_CONTEXT_VERSION_MAJOR, 3)


... but even if I manually change what it's done, it immediately auto-formats it back on the fly! I couldn't see a setting in tasks.json, but I have to admit I don't really know WTF I'm doing!

Also, is there a simple shortcut to run in release mode? I thought I had that working at one point, but can now only do the awkward two-step Ctrl-Shift-B and selecting the build task. I realise these may be limits of the editor, though...

Many thanks!

DruggedBunny

Also not a fan of the enforced newlines after Function/Method! For a single-line function I would typically use this:

Method OnFrameBufferSize( width: Int, height: Int )
glViewport( 0, 0, width, height )
EndMethod


... rather than this:

Method OnFrameBufferSize( width: Int, height: Int )

glViewport( 0, 0, width, height )
EndMethod


Just looks weirdly-spaced to me! Too picky?  :P

Just wondering if there might be a way to customise these things.

Derron

Think "autoformat" is a VS Code setting, not an extension one.


bye
Ron

Hezkore

Yes, as Derron says; you'll have to jump into VSCode settings and disable the auto format options.
Which should be disabled by default actually...
I suspect it's either "Format on save" or "Format while typing" you have enabled.

Also just to clear up some confusion...
tasks.json is only used when you run a "task" such as compiling your application.
The two shortcut buttons in the corner (and also F5) just uses your default set task in tasks.json.

And regarding building and releasing; the "Quick build and run" button in the corner (or F5) always does a quick console debug build, but listens to your settings in tasks.json otherwise.
Use the "Build" button in the corner (or Ctrl Shift B) to fully listen to the tasks.json settings, such as release and GUI app.

This will eventually change with the newer build system and proper debugging though.

And just a tip!
If you don't like Ctrl Shift B for compiling; just change the button for it in key settings.
Also, F6 will run the last task.
So if you just hit Ctrl Shift B once you can use F6 after that.
Simplicity is the ultimate sophistication. 🚀
GitHub
BlitzMax for VSCode
BlitzMax for Vim

DruggedBunny

Ah, thanks, guys, will dig into all that tonight then! Much appreciated!

DruggedBunny

I got the auto-formatting sorted (thanks!), but any idea if there's a way to get the highlighting while having spaces before brackets? I couldn't find a setting in VSCode, so not sure where this is decided.

See screenshot -- note the second line gets highlighted only when the function name has no space after it.

Hezkore

#54
The syntax highlighting works by some fairly simple regex patterns and does not actually parse any of your code.
And I've tried to follow the same rules and coding style that the default modules use when designing these patterns.
But I/you could change the pattern and make the function name detection allow for whitespaces.
However, there might be some unforeseen issues in doing so since ( ) might be used in other places as well, which in turn would make any text before that act as a function name.

If you do change the regex to allow for whitespaces; please tell me how that works out.
Otherwise I'll have a look at it myself sometime in the future.
Simplicity is the ultimate sophistication. 🚀
GitHub
BlitzMax for VSCode
BlitzMax for Vim

Hezkore

#55
@DruggedBunny
I've updated the language regex syntax to better suit your coding style.

And in general I've polished up the task system quite a bit.
There will certainly be lots of issues with this new system as it's almost completely re-written and bound to have some bugs.
But hopefully it will be easier to understand and we can work on fixing the bugs as we go.

The two buttons in the corner should now take care of all your building needs.
(Especially good for those of you having problem remembering the keyboard shortcuts)
The left one builds and runs the app, the second one just builds it.

And it will now always follow your building (`tasks.json`) rules, instead of trying to be smart and setting some stuff automatically.

You can now also build without actually having a task configured, as I'm supplying a default build task if no task is found.
And if the file you're trying to build isn't part of the workspace; it will also use that default task.
Which should work a lot nicer than having to change "source" in `tasks.json` if you just quickly want to build some external file.

The update is already available, VSCode should as always automatically update it for you.
Simplicity is the ultimate sophistication. 🚀
GitHub
BlitzMax for VSCode
BlitzMax for Vim

Derron

Quote from: Hezkore on March 27, 2020, 15:59:39
(Especially good for those of you having problem remembering the keyboard shortcuts)

Dunno whom this might be targeting :)


bye
Ron

Hezkore

#57
Quote from: Derron on March 27, 2020, 16:17:58
Dunno whom this might be targeting :)

I won't name any names but it's you. :))
You aren't the only one though.
Simplicity is the ultimate sophistication. 🚀
GitHub
BlitzMax for VSCode
BlitzMax for Vim

DruggedBunny

Wow, thanks for that -- it's looking good here, much nicer with the highlighting back in!

QuoteYou aren't the only one though.

Oi!

:D

Thanks again!

Hezkore

I've started work on a unique BlitzMax view container.


I'll slowly add new things to the view container over time, but I've at least started work on a "Build Options" tree view.


It should make things easier for those of you who don't like editing the raw `tasks.json` file.
It also makes it pretty clear what options you're editing, as it will display "Workspace: NAME" or "File: NAME" for files that aren't part of the actual workspace.


I've also found a bunch of minor problems with the previous version I pushed.
So I'll hopefully push a new version today, which will also contain this new view container.
Simplicity is the ultimate sophistication. 🚀
GitHub
BlitzMax for VSCode
BlitzMax for Vim