Ooops
April 03, 2020, 12:20:16 PM

Author Topic: BlitzMax VSCode extension worklog  (Read 5210 times)

Offline Hezkore

  • Full Member
  • ***
  • Posts: 109
Re: BlitzMax VSCode extension worklog
« Reply #45 on: January 18, 2020, 10:06:47 AM »
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.
Keep it simple.

Offline DruggedBunny

  • Jr. Member
  • **
  • Posts: 27
Re: BlitzMax VSCode extension worklog
« Reply #46 on: January 18, 2020, 01:56:34 PM »
That's working well here, thanks Hezkore!

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 1547
Re: BlitzMax VSCode extension worklog
« Reply #47 on: January 19, 2020, 06:40:16 AM »
Agreed  - excellent work - this just get better and better

Offline DruggedBunny

  • Jr. Member
  • **
  • Posts: 27
Re: BlitzMax VSCode extension worklog
« Reply #48 on: March 13, 2020, 05:08:26 AM »
Hi Hezkore, is it possible to turn off, or customise, auto-formatting? I've never liked the 'standard' style, like so:

Code: [Select]
TGLFWWindow.Hint( GLFW_CONTEXT_VERSION_MAJOR, 3 )

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

Code: [Select]
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!

Offline DruggedBunny

  • Jr. Member
  • **
  • Posts: 27
Re: BlitzMax VSCode extension worklog
« Reply #49 on: March 13, 2020, 05:41:34 AM »
Also not a fan of the enforced newlines after Function/Method! For a single-line function I would typically use this:

Code: [Select]
Method OnFrameBufferSize( width: Int, height: Int )
glViewport( 0, 0, width, height )
EndMethod

... rather than this:

Code: [Select]
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.

Offline Derron

  • Hero Member
  • *****
  • Posts: 2818
Re: BlitzMax VSCode extension worklog
« Reply #50 on: March 13, 2020, 06:16:18 AM »
Think "autoformat" is a VS Code setting, not an extension one.


bye
Ron

Offline Hezkore

  • Full Member
  • ***
  • Posts: 109
Re: BlitzMax VSCode extension worklog
« Reply #51 on: March 13, 2020, 07:22:28 AM »
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.
Keep it simple.

Offline DruggedBunny

  • Jr. Member
  • **
  • Posts: 27
Re: BlitzMax VSCode extension worklog
« Reply #52 on: March 13, 2020, 08:11:03 AM »
Ah, thanks, guys, will dig into all that tonight then! Much appreciated!

Offline DruggedBunny

  • Jr. Member
  • **
  • Posts: 27
Re: BlitzMax VSCode extension worklog
« Reply #53 on: March 15, 2020, 08:25:32 PM »
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.

Offline Hezkore

  • Full Member
  • ***
  • Posts: 109
Re: BlitzMax VSCode extension worklog
« Reply #54 on: March 16, 2020, 05:19:47 AM »
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.
Keep it simple.

Offline Hezkore

  • Full Member
  • ***
  • Posts: 109
Re: BlitzMax VSCode extension worklog
« Reply #55 on: March 27, 2020, 03:59:39 PM »
@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.
Keep it simple.

Offline Derron

  • Hero Member
  • *****
  • Posts: 2818
Re: BlitzMax VSCode extension worklog
« Reply #56 on: March 27, 2020, 04:17:58 PM »
(Especially good for those of you having problem remembering the keyboard shortcuts)

Dunno whom this might be targeting :)


bye
Ron

Offline Hezkore

  • Full Member
  • ***
  • Posts: 109
Re: BlitzMax VSCode extension worklog
« Reply #57 on: March 27, 2020, 06:37:38 PM »
Dunno whom this might be targeting :)

I won't name any names but it's you. :))
You aren't the only one though.
Keep it simple.

Offline DruggedBunny

  • Jr. Member
  • **
  • Posts: 27
Re: BlitzMax VSCode extension worklog
« Reply #58 on: March 27, 2020, 11:03:30 PM »
Wow, thanks for that -- it's looking good here, much nicer with the highlighting back in!

Quote
You aren't the only one though.

Oi!

 :D

Thanks again!

Offline Hezkore

  • Full Member
  • ***
  • Posts: 109
Re: BlitzMax VSCode extension worklog
« Reply #59 on: March 28, 2020, 12:29:41 PM »
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.
Keep it simple.

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal