Sudden VSCode+BeebAsm "symbol not defined"'s everywhere

developing/porting a new game or gaming framework? post in here!
Post Reply
Arx
Posts: 33
Joined: Sat Aug 20, 2022 10:12 pm
Contact:

Sudden VSCode+BeebAsm "symbol not defined"'s everywhere

Post by Arx »

Opened VSCode to work on the game and suddenly it's an explosion of squiggly yellow underlines... "symbol not defined" says vscode-beebasm.

Seems it's for every symbol I'm using in a script whose definition is in a difference script in the same project. Subsequent labels also get underlined because their addresses are different on the assembly second pass due I think to the offending symbols prior resulting in those instructions not assembling.

Closing and reloading the folder and VSCode itself hasn't helped.

Fortunately, it lets you pick a previous version of BeebVSC. I've reverted to version 0.2.0 from two days previously and the yellow is gone.

EDIT: But now I can't F7 or F9 it!

EDIT EDIT: Gone back to 0.1.2 and now I can.

Anyone else experienced this issue?
tomhelm
Posts: 21
Joined: Fri Jan 19, 2024 5:18 pm
Contact:

Re: Sudden VSCode+BeebAsm "symbol not defined"'s everywhere

Post by tomhelm »

Hi Arx

I don't think you're the only one viewtopic.php?t=28838.

Unfortunately I haven't been able to replicate it with any of my test projects. However, I suspect it is down to existing projects not having a settings.json file which we use to identify the start of the language parsing. This is the same as the target file when compiling with BeebASM.

To get this created, press F10 (or use the Command Palette and search for "BeebVSC: Create new build target"), then select the target file that you compile with BeebASM). This will create a new task in tasks.json, so you may want to revert that file if you already have a custom set up for that. The main thing is to ensure the creation of the settings.json file with a beebvsc.sourceFile setting that points to the build target.

The new functionality has been there since version 0.1.0, however it only seems to have caused problems recently. I think it could be that I tried to put some auto-discovery logic in when a settings.json file wasn't found. Probably it would have been better to just give a message to the user to create it.
Arx
Posts: 33
Joined: Sat Aug 20, 2022 10:12 pm
Contact:

Re: Sudden VSCode+BeebAsm "symbol not defined"'s everywhere

Post by Arx »

Hiya. Thanks for coming back.

Ahh... there was a tasks.json file which I manually edited ages back:

Code: Select all

{
    "version": "2.0.0",
    "command": "cmd",
    "echoCommand": true,
    "args": [
        "/C"
    ],
    "tasks": [
        {
            "label": "make",
            "type": "shell",
            "args": [
                "BeebAsm.exe -v -i MAKE.asm -do EVOLVE.ssd -title EVOLVE -boot LODR"
            ],
            "problemMatcher": {
                "owner": "6502",
                "fileLocation": [
                    "relative",
                    "${workspaceRoot}"
                ],
                "pattern": {
                    "regexp": "^(.*):(\\d+):\\s+(warning|error):\\s+(.*)$",
                    "file": 1,
                    "line": 2,
                    "severity": 3,
                    "message": 4
                }
            },
            "group": {
                "kind": "build",
                "isDefault": false
            }
        },
        {
            "label": "Run 'EVOLVE.ssd' in Emulator",
            "type": "shell",
            "args": [
                "BeebEm.exe EVOLVE.ssd"
            ],
            "problemMatcher": [],
            "group": {
                "kind": "test",
                "isDefault": false
            }
        }
    ]
}
There wasn't a settings.json file, though. I've done an F10, selecting my MAKE.asm file that has all my various INCLUDEs, INCBIN, GUARD, ORG and SAVE etc. for creating the disc image, and EVOLVE.ssd as the target name, matching what was in tasks.json.

The tasks.json file now consists of:

Code: Select all

{
    "version": "2.0.0",
    "command": "cmd",
    "echoCommand": true,
    "args": [
        "/C"
    ],
    "tasks": [
        {
            "label": "make",
            "type": "shell",
            "args": [
                "BeebAsm.exe -v -i MAKE.asm -do EVOLVE.ssd -title EVOLVE -boot LODR"
            ],
            "problemMatcher": {
                "owner": "6502",
                "fileLocation": [
                    "relative",
                    "${workspaceRoot}"
                ],
                "pattern": {
                    "regexp": "^(.*):(\\d+):\\s+(warning|error):\\s+(.*)$",
                    "file": 1,
                    "line": 2,
                    "severity": 3,
                    "message": 4
                }
            },
            "group": {
                "kind": "build",
                "isDefault": false
            }
        },
        {
            "label": "Run 'EVOLVE.ssd' in Emulator",
            "type": "shell",
            "args": [
                "EVOLVE.ssd"
            ],
            "problemMatcher": [],
            "group": {
                "kind": "test",
                "isDefault": false
            }
        },
        {
            "label": "BeebVSC Build Target 'EVOLVE.ssd'",
            "type": "shell",
            "problemMatcher": {
                "owner": "6502",
                "fileLocation": [
                    "relative",
                    "${workspaceRoot}"
                ],
                "pattern": {
                    "regexp": "^(.*):(\\d+):\\s+(warning|error):\\s+(.*)$",
                    "file": 1,
                    "line": 2,
                    "severity": 3,
                    "message": 4
                }
            },
            "command": "BeebAsm.exe",
            "args": [
                "-v",
                "-i",
                "MAKE.asm",
                "-do",
                "EVOLVE.ssd",
                "-boot",
                "LODR"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}
And the newly created settings.json file consists of:

Code: Select all

{
    "beebvsc": {
        "sourceFile": "c:\\Users\\Arx\\Documents\\software_development\\evolve\\MAKE.asm",
        "targetName": "EVOLVE.ssd"
    }
}
And I've noticed that the auto-complete suggestions thing now works again having stopped working a while back. All my labels are popping up.
Post Reply

Return to “new projects in development: games”