May 25, 2020, 09:07:56 AM

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

Offline DruggedBunny

  • Jr. Member
  • **
  • Posts: 58
Re: BlitzMax VSCode extension worklog
« Reply #60 on: March 28, 2020, 08:26:11 PM »
That looks pretty cool, especially the per-program switching.

Online Hezkore

  • Full Member
  • ***
  • Posts: 121
  • Juicy 🍑
Re: BlitzMax VSCode extension worklog
« Reply #61 on: April 02, 2020, 04:07:44 PM »
I've added a "samples tree" to the view container.
It'll make viewing the BlitzMax samples a lot easier.
It also lists samples for any module by looking in folders named "samples", "examples", "tests" and "docs".



And for those of you who don't want anything extra visible in the view container; you can just right click and hide it.



This is already available in version 1.25.0.
VSCode should automatically update the extension for you.
Keep it simple. 🚀
GitHub
BlitzMax for VSCode

Online Hezkore

  • Full Member
  • ***
  • Posts: 121
  • Juicy 🍑
Re: BlitzMax VSCode extension worklog
« Reply #62 on: April 12, 2020, 06:59:11 PM »
The BlitzMax view container got some polished this weekend.
It now has a new welcome screen (a new VSCode feature!).
And the samples tree will now load even if there's no BlitzMax project/file open.



The 'Appstub' option in the Build Options view now actually scans all of your modules for available appstub modules.
It will then present them in a quick pick list.
Which is a lot easier than having to remember and manually write those module names in!



Oh and we've somehow managed to surpass 300 downloads. 🤔

Anyways, the update is already available as version 1.26.0.
Keep it simple. 🚀
GitHub
BlitzMax for VSCode

Offline Derron

  • Hero Member
  • *****
  • Posts: 2969
Re: BlitzMax VSCode extension worklog
« Reply #63 on: April 12, 2020, 08:13:48 PM »
300 total or for latest release?

Good job.

Bye
Ron

Offline DruggedBunny

  • Jr. Member
  • **
  • Posts: 58
Re: BlitzMax VSCode extension worklog
« Reply #64 on: April 12, 2020, 08:53:17 PM »
I just updated (VSCode also updated today) and I don't get the blue Open Folder/File buttons, and my Samples/Modules dropdowns are both empty. It was showing an error about checking a log, but not where the log was -- but it's no longer giving me that message either.

I noticed the missing Samples/Modules thing after the last update but forgot to post! But it hasn't just started with this update, that's never worked for me.

If it helps, my samples are at:
Code: [Select]
D:\DevTools\Blitz\BlitzMaxNG\samples and you can see in the screenshot that it finds Blitz no problem (and runs fine!) -- it is running the right copy too.

I also have BlitzMax in my %PATH% at:
Code: [Select]
D:\DevTools\Blitz\BlitzMaxNG\bin

Online Hezkore

  • Full Member
  • ***
  • Posts: 121
  • Juicy 🍑
Re: BlitzMax VSCode extension worklog
« Reply #65 on: April 12, 2020, 09:54:18 PM »
300 total or for latest release?
Total downloads.

I just updated (VSCode also updated today) and I don't get the blue Open Folder/File buttons
You'll only get the welcome view if you have no workspace, files or folders open.
I have very little control (read 'no control') over that welcome view though, so very little can go wrong.
I just write the plain text in the extension info and VSCode presents it when it's needed (when Build Options is empty).
So I'm guessing you're just not in a state right now where VSCode would present that welcome view.
You'll see it eventually. :)

my Samples/Modules dropdowns are both empty
Thanks for letting me know!
You can post all your issues over at GitHub: https://github.com/Hezkore/vscode-blitzmax-support/issues
(But here is also fine)
I've pushed a new update (1.26.1) which hopefully fixes your issue.
Keep it simple. 🚀
GitHub
BlitzMax for VSCode

Offline DruggedBunny

  • Jr. Member
  • **
  • Posts: 58
Re: BlitzMax VSCode extension worklog
« Reply #66 on: April 12, 2020, 11:10:41 PM »
Hmm, still no joy! On looking up where the log file is, I found the VSC developer tools thing, which does show this:

Code: [Select]
EntryNotFound (FileSystemError):
at massageError (c:\Users\James\.vscode\extensions\hezkore.blitzmax-1.26.1\out\samplesTree.js:35:43)
at handleResult (c:\Users\James\.vscode\extensions\hezkore.blitzmax-1.26.1\out\samplesTree.js:27:20)
at c:\Users\James\.vscode\extensions\hezkore.blitzmax-1.26.1\out\samplesTree.js:66:51
at FSReqCallback.oncomplete (fs.js:153:23)

I see the sample scanning code in
Code: [Select]
c:\Users\James\.vscode\extensions\hezkore.blitzmax-1.26.1\out\samplesTree.js, but can't really follow it!

The error seems to be pointing to
Code: [Select]
handleResult(resolve, reject, error, normalizeNFC(children))) in
Code: [Select]
function readdir(path). At least, that seems to be what sits at samplesTree.js:66:51.

No idea if that's any use!

Online Hezkore

  • Full Member
  • ***
  • Posts: 121
  • Juicy 🍑
Re: BlitzMax VSCode extension worklog
« Reply #67 on: April 13, 2020, 02:14:19 AM »
Alright, so the VSCode 'FileSystemProvider' is unnecessarily over-engineered.
(especially for our samples tree)
Most of the issues with the samples tree comes from that code.
I've converted the samples tree to use a custom tree data provider, which should be much easier to understand and debug.
The whole thing got about 170 lines thinner while removing methods we don't even use, and the tree even loads faster.
Hopefully your issue has also been fixed DruggedBunny.
If not; please post the issue on GitHub so that we can track down the problem in a contained conversation. :)

Version 1.26.2 has been pushed to the marketplace.
Keep it simple. 🚀
GitHub
BlitzMax for VSCode

Online Hezkore

  • Full Member
  • ***
  • Posts: 121
  • Juicy 🍑
Re: BlitzMax VSCode extension worklog
« Reply #68 on: April 13, 2020, 09:04:48 PM »
I've done some more work on the welcome screen.
There's now a new message/button if the user hasn't yet set his BlitzMax path.



The normal 'Open Folder/File' screen is shown after a path has been set.



But once an empty folder has been opened you'll have the option to generate a new project.



Any time your workspace/folder is empty you'll have the 'Generate Project' button.
But you can of course still generate a project the old way, which is by right clicking in your explorer:



Or by using the command palette (Ctrl Shift P) and typing 'Generate Project'.
You can read more about generating projects in one of my older posts:
https://www.syntaxbomb.com/index.php/topic,5824.msg33514.html#msg33514

But overall I feel like this streamlines the whole thing nicely.
Basically our unique BlitzMax view container will now guide you through the entire process.

Version 1.27.1 has been pushed to the marketplace.
Keep it simple. 🚀
GitHub
BlitzMax for VSCode

Offline Brucey

  • Full Member
  • ***
  • Posts: 127
Re: BlitzMax VSCode extension worklog
« Reply #69 on: April 14, 2020, 09:36:26 AM »
Is the BlitzMax path workspace specific?  i.e. I work with *at least* two versions of BlitzMax (so I generally have a couple of MaxIDEs open at the same time each pointing to their own local BlitzMax)

So obviously it would be nice if I could accomplish the same in VSCode... :-)

Offline Derron

  • Hero Member
  • *****
  • Posts: 2969
Re: BlitzMax VSCode extension worklog
« Reply #70 on: April 14, 2020, 09:48:32 AM »
To avoid having to setup these paths each time it should have a "default BlitzMax Path" which it uses for new workspaced but could be adjusted (dropdown, settings dialogue...)


bye
Ron

Online Hezkore

  • Full Member
  • ***
  • Posts: 121
  • Juicy 🍑
Re: BlitzMax VSCode extension worklog
« Reply #71 on: April 14, 2020, 02:08:14 PM »
Is the BlitzMax path workspace specific?  i.e. I work with *at least* two versions of BlitzMax (so I generally have a couple of MaxIDEs open at the same time each pointing to their own local BlitzMax)

You have a bunch of options to get this working Brucey.

If you want to switch BlitzMax installation on the fly; I would recommend just using the 'setPath' command and bind it to a key.
Just jump into 'Preferences' > 'Keyboard Shortcuts' and then click the little icon in the corner to edit the raw JSON file.
You can then add something like:
Code: [Select]
{
"key": "ctrl+numpad1",
"command": "blitzmax.setPath",
"args": "D:\\Applications\\BlitzMaxNG"
},
{
"key": "ctrl+numpad2",
"command": "blitzmax.setPath",
"args": "D:\\Applications\\BlitzMaxLegacy"
}
Pressing 'Ctrl Num1' will now switch the extension over the NG, while pressing 'Ctrl Num2' would switch to Legacy.
And if you instead use the 'selectPath' command you'll get a popup asking for the path to your BlitzMax folder.
(which could be useful sometimes)

Since it's just a command; you can use it however you want, but I feel like a keyboard shortcut is the simplest.
You could also create a new separate VSCode extension that organizes all of your BlitzMax installations.
It could then use the 'setPath' command to switch automatically for you.
Which is kind of what Derron is talking about.
(Go make that extension now Derron :P)

Your second option would be to use a different BlitzMax installation based on folder.
All of your VSCode/extension settings are stored globally, but you can overwrite them per workspace/folder.
So if you just open a folder containing your source files, then jump into 'Settings', you'll see the 'Workspace' tab in your settings window.



Any changes there will overwrite your existing settings and will only apply for that workspace.

There's also a third way to handle this, which is by having a "multi-root workspace".
I'll admit that it's highly experimental and not a lot of extensions supports it, but I at least try to support it.
Basically you open a folder, like always, but then go into 'File' and select 'Add Folder to Workspace...'.
This will create a proper and real workspace. (everything else is just a folder in reality)
And at that point you'll get another tab in your settings window where you can select things per workspace folder.
So you could at that point work on a NG and Legacy application at the same time, inside the same window, without having to switch around.



Things like the samples tree will get confused and not know which version to use.
But you should still be able to compile just fine using any number of BlitzMax versions.
Keep it simple. 🚀
GitHub
BlitzMax for VSCode

Offline Derron

  • Hero Member
  • *****
  • Posts: 2969
Re: BlitzMax VSCode extension worklog
« Reply #72 on: April 14, 2020, 03:01:24 PM »
Weren't these workspaces a bit troublesome in the past (the ones in which I was not able to compile something and you wrote about them not being supported for now)?

It looks at least like a good way to allow multiple "blitzmax setups". Maybe the extension could store the last used X paths inserted there? So that you either enter a new one or use a dropdown to select a previous one. Maybe easier to do than to properly manage/configure different setups via dialogues ?


bye
Ron

Online Hezkore

  • Full Member
  • ***
  • Posts: 121
  • Juicy 🍑
Re: BlitzMax VSCode extension worklog
« Reply #73 on: April 14, 2020, 03:56:38 PM »
Weren't these workspaces a bit troublesome in the past (the ones in which I was not able to compile something and you wrote about them not being supported for now)?
They've always been supported. :)
What I wrote to you about them was "...it could potentially go very wrong and be very confusing if you're new to VSCode".
And that's still partly true because each root folder inside your workspace will have its own 'tasks.json' and settings.
Managing one 'tasks.json' has been very confusing for some people, so having multiple ones would make things a lot more complex.
But I feel like the Build Options view has somewhat mitigated this issue and made things a lot clearer for everyone.
I'd still suggest you don't use them if you don't have to, mainly to keep things simple.
A simple folder will be good enough in most cases.

Maybe the extension could store the last used X paths inserted there? So that you either enter a new one or use a dropdown to select a previous one. Maybe easier to do than to properly manage/configure different setups via dialogues ?
I could certainly let you enter multiple paths for your BlitzMax installations, then have a button somewhere (or have a keyboard shortcut) display a quick pick list of all available BlitzMax installations.
But I feel like this whole thing is somewhat of a niche feature that not a lot of people would use...
It might even potentially confuse new users, especially if they've managed to switch without knowing how to switch back or something.
And I'm not sure I want to spend any more time on features that anyone hardly uses. :(

Which is why I feel like a separate extension, specifically made for this, might be a better idea.

The extension could display a nice HTML view for adding and selecting BlitzMax installations.
And allow for keyboard shortcuts and quick buttons somewhere on the UI.
It would just need to use our 'setPath' command and it'll instantly work.
But it's a lot of work for something that only one or two users might actually use. ¯\_(ツ)_/¯
Keep it simple. 🚀
GitHub
BlitzMax for VSCode

Offline Brucey

  • Full Member
  • ***
  • Posts: 127
Re: BlitzMax VSCode extension worklog
« Reply #74 on: April 14, 2020, 04:15:42 PM »
Quote
But it's a lot of work for something that only one or two users might actually use.
Pfff. That's pretty much all I do with BlitzMax - make stuff that possibly only one or two users might actually use. So I'm not sure what you are trying to say, exactly?  8)

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal