-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
What's changing
Conditionally add the ca65 keyword CompletionItems to the completion provider, only when a ca65 keyword would actually be valid
Motivation for change
Currently the keywords are just always in the completion list, regardless of where the cursor is; this is poor quality
Background/Notes
A ca65 keyword is valid:
- if it is a control command and is the lhs operand, that is, nothing should precede it on the same line.
- the only thing that can precede it is a label:
sintab: .byte $40, $32
- the only exception to this rule is
.set, which must follow an identifier:
myVar .set 0
- if it is a pseudo variable or pseudo function and is the rhs operand; i.e. it must follow an instruction or control command which requires a parameter (e.g.
.if,.byte,.word,lda).- the one exception here is
.ident, which essentially replaces itself with its arguments, creating an identifier, and thus is valid wherever an identifier would be valid:
.ident(.concat("rice", "_patty")): ; is the same as: rice_patty:
- the one exception here is
so, put another way, there are four categories of valid places a ca65 keyword could be:
- preceded by either nothing or a label
- all control commands except
.set
- all control commands except
- preceded by an instruction or other keyword which requires a parameter
- all pseudo variables & pseudo functions except
.ident
- all pseudo variables & pseudo functions except
- preceded by an identifier
.set
- anywhere an identifier is valid
.ident
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Projects
Status
Ready