Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language Server for VSCode or other popular IDE's #105

Open
ghost opened this issue Aug 22, 2021 · 5 comments
Open

Language Server for VSCode or other popular IDE's #105

ghost opened this issue Aug 22, 2021 · 5 comments

Comments

@ghost
Copy link

ghost commented Aug 22, 2021

After working on a rather stupidly large project, I find myself wishing for autocompletion and syntax highlighting to make my life easier.
This is a suggestion/request to have someone make this possible.

@ProxyPlayerHD
Copy link

how would that even work? it's a universal assembler, so it's impossible to create any kind of highlighting that would work for any possible CPU you could describe with the Assembler.

the best option you have is to just create your own highlighting for whatever CPU you're working with, or using an IDE that already supports it if you're working with an existing Processor like the 6502, Z80, 68k, ARM, etc

personally i use NP++ as my IDE, and it gives you the ability to add custom highlighting for any custom language.
so for any CPU i use CustomASM for, i have also made custom highlighting for.
it's fairly easy as well, since most of the time only Instruction Mnemonics and Register names are changing between different Processors.
so i can just make highlighting for a new CPU by just importing the XML file (format used by NP++ to store the custom highlight) for some other Processor, tweak those things mentioned above, and then export it with a new name.

@hlorenzi
Copy link
Owner

I think it would indeed be a little difficult to statically decide what's a valid instruction and what's not, but we could just run the assembler over the source files and make it return some kind of syntax report that could be used for highlighting purposes. Now, for autocompletion, I'm not sure how that could work...

In any case, I think doing a Language Server would require the assembler to work off of a configuration file (like package.json or tsconfig.json), which is another thing we'll have to work on!

@ghost
Copy link
Author

ghost commented Aug 28, 2021

Yeah, it would be a bit difficult, especially because of how complex the assembler is. I would use notepad++, but its not available under linux right now. This honestly seems complicated enough to warrant a separate project. Somehow the assembler knows how to match instructions, so it might be a good idea to start the autocompletion/highlighting there.

@hlorenzi
Copy link
Owner

I don't know if you're already using the VSCode basic highlighting extension, but it does more or less what Notepad++ would do.

@parasyte
Copy link

I wrote a syntax definition for Sublime Text: https://github.com/parasyte/sublime-syntax-customasm It is fairly complete, but I'm not certain of its accuracy. (See also #139 which would provide a great reference for improving the accuracy of the syntax parser.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants