donaldhays / rgbds-vscode Goto Github PK
View Code? Open in Web Editor NEWVisual Studio Code language extension for RGBDS GBZ80 Assembly
License: MIT License
Visual Studio Code language extension for RGBDS GBZ80 Assembly
License: MIT License
ld a,[c]
is corrected to ld a,[bc]
automatically...
RGBDS supports hli
and hld
in addition to hl+
and hl-
. Also, a
is optional in many instructions involving it.
Or maybe I'm doing something wrong?
Here's my project structure :
root
|- src (main.asm, memory.asm,)
|- include (hardware.inc)
build.bat
in main.asm at the top I have :
include "include/hardware.inc"
include "src/memory.asm"
And in my settings.json
"rgbdsz80.includePath": [
"src/",
"include/"
]
My build.bat builds from the root, so all the files I include are included relative to the root, instead of the current file :
"../asm/rgbasm" -o tmp/temp.o src/main.asm
"../asm/rgblink" -o build.gb tmp/temp.o
"../asm/rgbfix" -v -p 0 build.gb
I couldn't get auto completion for included files working in this config. I tried multiple entries in rgbdsz80.includePath to no avail :
Thank you!
ISSOtm - Today at 11:21 PM
Although I don't mind symbols in a branch not appearing in others that much, the constants and macros branches are always included, and I really use these a lot.
My idea would be to construct a tree of the files included
Such that non-exported symbols in files declared before the current one in its parents (if any) are added to Intellisense
That was a long descriptor.
Dovuro - Today at 11:24 PM
Hmmm. I think that's reasonable.
So a.asm includes b.asm and then c.asm. And so we make it so that c.asm can see everything declared in b.asm, as well as any symbols declared in a.asm prior to the include statement of c.asm?(edited)
https://open-vsx.org is an alternative marketplace for extensions, since alternative builds (codium, code oss) of vs code are not allowed to use microsoft's marketplace.
I instaled the last version on VSCode and the extension stops being activated for .asm source files after I close/reopen the source folder. It works consistently with .sm83 extension, though.
Any ideas?
According to the man 5 rgbasm
: 'anything that follows a "*" that is placed right at the start of a line is a comment'. rgbds does not currently support this kind of comments. That is an obscure feature of rgbds, maybe. But it shouldn't be too hard to implement .
It seems the language.keyword.preprocessor
group is missing a few directives, namely FATAL
and ASSERT
.
Syntax highlighting seems to break when introducing a _
separator into numeric literals.
This is valid RGBASM syntax and should probably be highlighted.
Not a huge issue, but probably an easy fix so I thought I'd mention this.
The newest version of the gbdev maintained hardware.inc recently updated to use the RGBDS v0.5.0 DEF
syntax. This seems to break this extension's ability to read the include file. Swapping back to a previous version of the hardware.inc file prior to this change makes it work again. However, to keep up to date I think it'd be good to support the currently maintained version.
Please let me know if you need any other information.
https://rgbds.gbdev.io/docs/v0.7.0/rgbasm.5#SYNTAX
[label:] [instruction [:: instruction ...]] [; comment]
Multiple instructions on one line can be separated by double colons ‘::’.
ld a, [hli] :: LD H, [HL] :: Ld l, a
I'm worried about this one. The extension is mostly a random ad hoc mashup of regexes. I fear multiple instructions per line may break fundamental assumptions.
Though, when playing with the new syntax, it looks like the only immediately obviously wrong thing is that I don't get instruction completion hints after the first instruction? So maybe it won't be that bad?
https://rgbds.gbdev.io/docs/v0.7.0/rgbasm.5#SYMBOLS
Symbol names can contain ASCII letters, numbers, underscores ‘_’, hashes ‘#’ and at signs ‘@’. However, they must begin with either a letter or an underscore. Additionally, label names can contain up to a single dot ‘.’, which may not be the first character.
https://rgbds.gbdev.io/docs/v0.7.0/rgbasm.5#SECTIONS
The current section can be ended without starting a new section by using ENDSECTION. This directive will clear the section context, so you can no longer write code until you start another section. It can be useful to avoid accidentally defining code or data in the wrong section.
https://rgbds.gbdev.io/docs/v0.7.0/rgbasm.5#INCHARMAP
Name Operation INCHARMAP(str) Returns 1 if str has an entry in the current charmap, and 0 otherwise.
Listed at the end of https://rednex.github.io/rgbds/rgbasm.5.html there are a number of function-like preprocessor keywords that aren't recognized. They should be.
The extension's autocapitalization features incorrectly changes preprocessor directives that it finds within label names.
For example, if my language.keyword.preprocessor
is set to "upper"
, then I cannot save a file with a routine called MemSet
, because it incorrectly gets changed to MemSET
. Only the label itself is changed (not where it is referenced), breaking labels since they are case-sensitive.
https://rgbds.gbdev.io/docs/v0.7.0/rgbasm.5#String_expressions
Raw strings are prefixed by a hash ‘#’. Inside them, backslashes and braces are treated like regular characters, so they will not be expanded as macro arguments, interpolated symbols, or escape sequences. For example, the raw string
#"\t\1{s}\"
is equivalent to the regular string\\t\\1\{s}\\
. (Note that this prevents raw strings from including the double quote character.) Raw strings also may be contained in triple quotes for them to be multi-line, so they can include literal newline or quote characters (although still not three quotes in a row).
https://code.visualstudio.com/api/references/vscode-api#DocumentSymbol
The DocumentSymbol
type supports children, which allows vscode to understand symbol hierarchies. This is used both for the outline view and breadcrumb bar.
Intuitively, I can think of three levels of hierarchy that may make sense:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.