News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

VSCode Positron

Started by atomix, Nov 27, 2021, 09:05 PM

Previous topic - Next topic

keytapper

Hi Atomix
I installed VScode for Archlinux. When I try to add your extension it doesn't find it.  :(
Istantanea_2024-05-21_16-37-09.png
Ignorance comes with a cost


keytapper

#222
Quote from: atomix on May 22, 2024, 04:35 AMRead this
Thank you for your well informed help.
It was last thing I could think of. I installed the code-marketplace package and that's all.

Edit

I stumbled in a issue, where are the files from the compilation?
If the source is on the folder other resulting files should be there.

To use within Kate or Notepad++ I use this bash command
#!/usr/bin/bash
var=$1
filepath=$(dirname "$var")
wine "C:\Program Files (x86)\ProtonIDE\PDS\loader.exe" "$var" -z 2>/dev/null
pbefile="${var%.*}".pbe

#if [ -f $pbefile ]; then
#    result=$(grep -ic error $pbefile)
#    xfce4-terminal -H -e cat $pbefile
#    if [ $result != 0 ]; then
#        echo "Press any key to close"
#        read -n 1
#        exit
#    fi
#    sleep 2.0
#fi

The commented part is an attempt to show the results for a little time. But I can't make it work.
Ignorance comes with a cost

atomix

Describe in more detail what exactly does not work and where.

keytapper

Sorry, I've been less specific.
I've a source on the editor and I press F9 (that I replaced by your setting just to keep closer to the original mode).
The output shows
[Running]  wine "/home/user/.wine/drive_c/Program Files (x86)/ProtonIDE/PDS/Loader.exe" "/tmp/test.Bas"
[Done] exited with code=0 in 11.6 seconds
Then I look in the folder /tmp/ and I have
ls test.*
test.Bas
Whereas if I call my compilebas I will see
compilebas test.Bas && ls test.*
    Program Compiled OK. 129 Words used from a possible 4096
    45 Variables used in the 12F1840 from a possible 240

test.asm  test.Bas  test.cof  test.hex  test.lst  test.pbe

Funny is that if I recall the command issued within VScode, it will erase all file but not the source.
So the command issued within VScode is doing as this one
wine "/home/user/.wine/drive_c/Program Files (x86)/ProtonIDE/PDS/Loader.exe" "/tmp/test.Bas" && ls -l test.*
-rw-r--r-- 1 user users 623 23 mag 21.15 test.Bas
If I do this in the shell :
wine "C:\Program Files (x86)\ProtonIDE\PDS\loader.exe" "test.Bas" -z 2>/dev/null && ls -l test.*
    Program Compiled OK. 129 Words used from a possible 4096
    45 Variables used in the 12F1840 from a possible 240
-rw-r--r-- 1 user users 12504 23 mag 21.34 test.asm
-rw-r--r-- 1 user users   623 23 mag 21.15 test.Bas
-rw-r--r-- 1 user users  2811 23 mag 21.34 test.cof
-rw-r--r-- 1 user users   818 23 mag 21.34 test.hex
-rw-r--r-- 1 user users 41565 23 mag 21.34 test.lst
-rw-r--r-- 1 user users   138 23 mag 21.34 test.pbe
It works, therefore the option -z is missing. Just tell me how I can modify the command line and there we are.
Ignorance comes with a cost

atomix

The command line can only be the path to the executable file and does not contain any arguments.

I'll try to finalize this over the weekend.

atomix

#226
New Release 2.4.7

- Added processing of command line arguments during compilation.
- Added calling the "compiler.cmd"  file instead of the compiler  if it is found in the source folder.
- Added calling the "programmer.cmd" file instead of the programmer if it is found in the source folder.

keytapper

#227
The same as I summarized to call a batch file. Which is in facts what I made for my intent as she can see at post #224.
Edit
I thought it was simpler, but probably I took the wrong path. I saw this that is what will gear a batch file within the VScode.
I tried something but I got no results. Maybe it should be formatted within VScode itself. But I'm not familiar with it.
Ignorance comes with a cost

atomix

#228
New Release 2.4.9

- Fixed processing of command file calls on Linux systems.

keytapper

Bravo! Great job!
It's strange how in Windows the command doesn't need the -z option.
I still have many things to know about VScode.
Ignorance comes with a cost

keytapper

Hi Atomix,
I found an issue that is regarding source names with spaces. How to pass the name surrounded by quote?
Ignorance comes with a cost

atomix

in more detail ...

keytapper

wine "/home/user/.wine/drive_c/Program Files (x86)/ProtonIDE/PDS/Loader.exe" "/tmp/test my pgm.Bas"
The passed in source name should be surrounded by quote, this will avoid the name splitting into words.
Ignorance comes with a cost

atomix

You can write quotes in compiler arguments.


atomix

New Release 2.5.0

- Minor updates and fixes.

kcsl

Good evening Atomix,

I've been having a problem with some source code that won't compile, but will not show me the error.
I copied the code into the original Positron editor and it gave me the error "Item 'PUSH_SW' not found"

I've trimmed the code to the minimum so you can see the issue.

Besides this, I'm really liking your VS plug-in. Well done and thanks.

Kind regards,
Joe


    Device 18F25K83     
    Declare Optimiser_Level = 0

    ' Set to External XTAL
    Config_Start       
        FEXTOSC = HS        'HS (crystal oscillator) above 8 MHz; PFM set to high power
        RSTOSC = EXTOSC        'EXTOSC operating per FEXTOSC bits (Device manufacturing default)   
        CLKOUTEN = OFF        'CLKOUT function is disabled
        PR1WAY = OFF        'PRLOCK Bit can be Set And cleared repeatedly
        CSWEN = On            'Writing To NOSC And NDIV is allowed
        FCMEN = OFF            'Fail-Safe Clock Monitor disabled
        MCLRE = EXTMCLR        'If LVP = 0, MCLR Pin is MCLR; If LVP = 1, RE3 pin function is MCLR
        PWRTS = PWRT_OFF    'PWRT is disabled
        MVECEN = Off        'Multi-vector Disable, Vector table used For interrupts
        IVT1WAY = On        'IVTLOCK Bit can be cleared And Set only once
        LPBOREN = OFF        'ULPBOR disabled
        BOREN = NOSLP        'Brown-out Reset enabled While running, disabled in Sleep; SBOREN is ignored
        BORV = VBOR_2P45    'Brown-out Reset Voltage (VBOR) Set To 2.45V
        ZCD = OFF            'ZCD disabled. ZCD can be enabled by setting the ZCDSEN Bit of ZCDCON
        PPS1WAY = OFF        'PPSLOCK Bit can be Set And cleared repeatedly (subject To the unlock sequence)
        STVREN = On            'Stack full/underflow will cause Reset
        Debug = OFF            'Background debugger disabled
        XINST = OFF            'Extended Instruction Set And Indexed Addressing Mode disabled
        WDTCPS = WDTCPS_31    'Divider ratio 1:65536; software control of WDTPS
        WDTE = OFF            'WDT Disabled; SWDTEN is ignored
        WDTCWS = WDTCWS_7    'window always open (100%); software control; keyed access not required
        WDTCCS = SC            'Software Control
        BBSIZE = BBSIZE_512    'Boot Block size is 512 words
        BBEN = OFF            'Boot block disabled
        SAFEN = OFF            'SAF disabled
        WRTAPP = OFF        'Application Block not write protected
        WRTB = OFF            'Configuration registers (300000-30000Bh) not write-protected
        WRTC = OFF            'Boot Block (000000-0007FFh) not write-protected
        WRTD = OFF            'Data EEPROM not write-protected
        WRTSAF = OFF        'SAF not Write Protected
        LVP = On            'Low voltage programming enabled. MCLR/VPP Pin function is MCLR. MCLRE configuration Bit is ignored
        Cp = OFF            'PFM And Data EEPROM Code protection disabled
    Config_End       
    OSCCON1 = %00100000     ' Set clock to 8MHz x 4 = 32MHz

    Declare Xtal 32         

    Input PUSH_SW 
There's no room for optimism in software or hardware engineering.

RGV250

Hi,
You need to let the compiler know what it is, something like
symbol PUSH_SW = porta.0

kcsl

#237
Hi,
Yes I know.... I probably should have been clearer in my explanation.

The issue is that the Positron Plug-in for VS Code doesn't always "show" what the error is.
The code I supplied is a cut down version of the program I was working on that caused the issue.

I had to paste the code into Positron IDE and try the compile there so I could see the details of the programming error.

Joe

There's no room for optimism in software or hardware engineering.

atomix

Positron extension prints all errors from the compiler's standard output rather than from the *.pbe file

What version of Windows do you have?
What is displayed in the window during compilation?

kcsl

So I attempted to compile the faulty code several times and it's very inconsistent.
Sometimes it reports different errors, sometimes not.

After some experimentation I think I've figure it out.

I keep my source code on a network drive as there are several places I work from, so it makes sense to keep the code in one central, secure location.
This approach has been working fine since I first starting using VS and the extension.

The problem seems to be related to the path where the source code is held.
If I put the source in the root of the network drive, it's fine, but try and compile it from the project folder then it's very inconsistent.
It is quite a deep path but it's not ridiculous - 5 folders deep with a total path length of 65 characters.

I'm going to move to a PC in a different location that uses the same network storage and see if it still happens, but clearly, this is my issue and nothing to do with Positron or the extension.

Thanks for your speedy assistance.
Regards,
Joe



There's no room for optimism in software or hardware engineering.