GithubHelp home page GithubHelp logo

mborik / z80-macroasm-vscode Goto Github PK

View Code? Open in Web Editor NEW
52.0 5.0 11.0 728 KB

Support for Z80 macro-assemblers in Visual Studio Code

Home Page: https://marketplace.visualstudio.com/items?itemName=mborik.z80-macroasm

License: MIT License

TypeScript 100.00%
vscode-extension formatter intellisense problem-matcher syntax-highlighting visual-studio-code vscode z80 z80-assembly z80asm

z80-macroasm-vscode's People

Contributors

alexanderk23 avatar iiivan37 avatar imanolea avatar kolnogorov avatar mborik avatar rgiot avatar thenestruo avatar tomaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

z80-macroasm-vscode's Issues

TASM support?

TASM seems like quite a popular assembler, and the tutorial that I'm following uses it. It isn't listed on the list of compatible assemblers, though - would it be hard to add?

Add support for region folding

This can be achieved by adding this to language.configuration.json:

  "folding": {
    "markers": {
      "start": "^\\s*;\\s*#?region\\b",
      "end": "^\\s*;\\s*#?endregion\\b"
    }
  }

Respect editor settings

Do you check the editor settings (.vscode)?
Seems like the asm editor is inserting tabs instead of spaces as my editor settings say...

Other than that, excellent extension!

sjasm module name is deleted on save

Hello and thanks for the great plugin!

I am having issues with saving files when I use sjasmplus module construct, the module name is erased:

Before saving:

    MODULE name
    ;; code
    ENDMODULE

After saving:

    MODULE
    ;; formatted code
    ENDMODULE

Using version 0.7.1, vscode 1.55.2

Definition not found

Local labels are not always found. E.g.

Bildschirmfoto 2019-03-10 um 11 55 02

The label .l12 is defined locally but it is not found via g1.l12.

Opening of included file

It would be nice if it was possible to open (in a new tab) included files by using a key shortcut when the cursor is on an include line directive (or equivalent) or by CTRL-clicking on the filename.

Snippets in VSCode

Hello.
VSCode has built-in support of snippets.
But the way they are handled by your great extension is not perfect.

Let me explain.

At this gif you can see, how snippets works in SublimeText - they are perfectly formatted and ready to use right after typing it.
Sublime

Now, let's add same snippet into VSC:
snippetTXT

and then try to use it:
VSC

As you can see, snippet is not properly formatted (pay attention to the label) and demands some handwork to get it to the usable state.
And note, please - I've used a very simple example of snippet - look at this one:
basic
In VSCode, we'll need much more formatting work in this case.

So, question is simple: is it possible to solve this problem and use snippets with more efficiency?

M80 accepts `$` in identifiers/labels

I have some old Z80 sources that I wrote for the M80 assembler.

As M80 accepts $-signs in labels I used those, but those are not correctly identified here. My guess would be that this line

      "match": "\\b([a-zA-Z][\\w\\.]+)\\b",

should be changed to

      "match": "\\b([a-zA-Z][\\w\\.$]+)\\b",

(see

"match": "\\b([a-zA-Z][\\w\\.]+)\\b",
)

but I am not experienced with writing extensions so would first see if it was an easy fix for a maintainer.

Label autocompletion seems wrong when using local labels

Let's use this example:

global
	ld hl, global
	ld de,  ; Cursor is before the comment

.local

If I type .l<tab> I expect to obtain .local.
Instead I obtain .global.local that is totally invalid.
global.local would be valid, but it is preferable to not have the global part as we are already in its scope.

Suggestion - update problemmatcher for sjasmplus to filelocation autodetect

Hi there - thanks for this plugin!
I am setting up my environment and I like to locate my .asm files in a subfolder of the main project solution and although the $errmatcher-sjasmplus problem matcher is correctly detecting the error in the assembly output, sjasmplus does not include the relative path when displaying the error:

> Executing task: D:\next\DMTestBong\project\bin\sjasmplus d:\next\DMTestBong\project\src\Project.asm --zxnext=cspect --msg=all <


SjASMPlus Z80 Cross-Assembler v1.14.5 (https://github.com/z00m128/sjasmplus)
Pass 1 complete (0 errors)
Pass 2 complete (0 errors)
Project.asm(17): error: Unrecognized instruction: fred a, bill
Pass 3 complete
Errors: 1, warnings: 0, compiled: 57 lines, work time: 0.031 seconds
The terminal process terminated with exit code: 1

With the $errmatcher-sjasmplus defined as:

{
	"name": "errmatcher-sjasmplus",
	"owner": "z80-macroasm",
	"fileLocation": ["relative", "${workspaceFolder}"],
	"pattern": [
		{
			"regexp": "^(.*)\\(([0-9]+)\\): (error|warning):\\s+(.*)$",
			"file": 1,
			"line": 2,
			"severity": 3,
			"message": 4
		}
	]
},

clicking the error in the Problems list results in an error as the file is assumed to be relative to the workspace folder.

However, if I amend my build task to include the --fullpath switch:

> Executing task: D:\next\DMTestBong\project\bin\sjasmplus d:\next\DMTestBong\project\src\Project.asm --zxnext=cspect --msg=all --fullpath <


SjASMPlus Z80 Cross-Assembler v1.14.5 (https://github.com/z00m128/sjasmplus)
Pass 1 complete (0 errors)
Pass 2 complete (0 errors)
d:\next\DMTestBong\project\src\Project.asm(17): error: Unrecognized instruction: fred a, bill
Pass 3 complete
Errors: 1, warnings: 0, compiled: 57 lines, work time: 0.015 seconds
The terminal process terminated with exit code: 1

Press any key to close the terminal.

This time, clicking the error in the Problems list results in an error as the file is still assumed to be relative to the workspace folder.

However, if I edit the extension package.json to use "autodetect":

{
	"name": "errmatcher-sjasmplus",
	"owner": "z80-macroasm",
	"fileLocation": ["autodetect", "${workspaceFolder}"],
	"pattern": [
		{
			"regexp": "^(.*)\\(([0-9]+)\\): (error|warning):\\s+(.*)$",
			"file": 1,
			"line": 2,
			"severity": 3,
			"message": 4
		}
	]
},

The problem path works whether the .asm file is in the workspace folder or nested lower.

Format of hexadecimal numbers

โš™ Preparation

Add enum-type setting "z80-macroasm.format.hexaNumberStyle" with these options:

  • "no-change"
  • "hash": #1fff | #B45D
  • "motorola": $1fff | $B45D
  • "intel": 1fffh | 0B45Dh
  • "intel-uppercase": 1fffH | 0B45DH
  • "c-style": 0x1fff | 0xB45D

and "z80-macroasm.format.hexaNumberCase" setting of semi-boolean type [ "no-change", true, false ]. True will be uppercased, false lowercased.

๐Ÿ“ Feature description

Formatter implementation will be enhanced to detect and parse hexadecimal numbers in source-code and reformat it into user's preference given by settings defined above.

splitInstructionsByColon: false doesn't work properly

I am the guy who writes many instruction in one line, separated by colon, so, i need to have splitInstructionsByColon set to false.

But eventually, when it's set to false, you just can't write space symbol after colon (because it's trimmed), so it's impossible to type more than one instruction in a line:

main.asm.-.aggregation.-.Visual.Studio.Code.Administrator.2021-12-07.15-46-36.mp4

Work with other file types

I have tried every permutation possible (or so it seems) to get this package to recognise the assembler file extensions I'm using - .Z80. For some reason, it refuses to code-highlight or otherwise work with my Z80 assembly files with the .Z80 extension. I've saved the exact same file as a .ASM file and it works fine with that. I've edited the settings and added .Z80 into the 'Files: include' array (**/*.{z80,asm,inc,s}) and have edited the JSON directly, but to no avail.

Any suggestions?

Recognized symbols not available as definitions (tniASM specific issue?)

Hello!

In my tniASM 0.45 projects (e.g.: the include-heavy msx-msxlib or the much simpler msx-pyramidwarpex) no definitions are available:
image

However, they appear in the outline view:
image

And also appear when I "Go to Symbol in Workspace...":
image

Note 1: In other projects using different assemblers (e.g.: this one that uses Sjasm 0.39) definitions are correctly found and available.

Note 2: I don't know if it is related to this issue or if it is just a red herring, but assembler directives (IFDEF / IFEXIST / ENDIF) are recognized as symbols:
image

Thanks!

Allow to disable asm auto-completion

Hi,

I feel this plug-in almost perfect but for the asm auto-completion, IMHO very intrusive. The asm language is "short" to write, the completion boxes appearing so frequently for short writes can be distracting, and sometimes you have to press even more keys, i.e. when writing "ret", have to press enter 2 times for going to the next line.
Then I see very useful the auto-completion of labels, but not so much for the asm code itself. If I could disable it I'd do.

Thanks for the plug-in to all this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.