{"id":16636605,"url":"https://github.com/grahambates/m68k-lsp","last_synced_at":"2025-03-16T22:31:09.266Z","repository":{"id":38089989,"uuid":"472110311","full_name":"grahambates/m68k-lsp","owner":"grahambates","description":"Language Server Protocol implementation for Motorola 68000 assembly","archived":false,"fork":false,"pushed_at":"2025-03-12T15:39:09.000Z","size":1705,"stargazers_count":26,"open_issues_count":5,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-15T01:14:48.545Z","etag":null,"topics":["68000","amiga","asm","assembly","language-server","language-server-protocol","lsp","m68k"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grahambates.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-20T21:45:31.000Z","updated_at":"2025-03-12T15:39:13.000Z","dependencies_parsed_at":"2024-06-26T21:16:53.449Z","dependency_job_id":"f2fd58e7-1c95-483b-8d28-d25729939c3e","html_url":"https://github.com/grahambates/m68k-lsp","commit_stats":{"total_commits":94,"total_committers":2,"mean_commits":47.0,"dds":"0.021276595744680882","last_synced_commit":"ea0a308f79aba0e7cff8afee71e6749f87f99671"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grahambates%2Fm68k-lsp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grahambates%2Fm68k-lsp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grahambates%2Fm68k-lsp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grahambates%2Fm68k-lsp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grahambates","download_url":"https://codeload.github.com/grahambates/m68k-lsp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243668234,"owners_count":20328042,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["68000","amiga","asm","assembly","language-server","language-server-protocol","lsp","m68k"],"created_at":"2024-10-12T06:22:11.064Z","updated_at":"2025-03-16T22:31:08.905Z","avatar_url":"https://github.com/grahambates.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Motorola 68000 family language server\n\n![example workflow](https://github.com/grahambates/m68k-lsp/actions/workflows/build.yml/badge.svg)\n[![npm version](https://img.shields.io/npm/v/m68k-lsp-server.svg)](https://www.npmjs.com/package/m68k-lsp-server)\n\n[Language Server Protocol](https://github.com/Microsoft/language-server-protocol) implementation for Motorola 68000\nfamily assembly, based on [tree-sitter-m68k](https://github.com/grahambates/tree-sitter-m68k)\n\n- Suitable for use with LSP supporting editors e.g. [Neovim](https://neovim.io/)\n- Includes [VS Code extension](https://marketplace.visualstudio.com/items?itemName=gigabates.m68k-lsp)\n\n## Features\n\n- Auto-completion:\n  - Instruction mnemonics\n  - Assembler directives\n  - Registers\n  - Symbols\n- Code Linting\n  - Parser errors\n  - Processor support\n- Code Folding\n- Document Formatting\n- Document Highlights\n- Document Links\n- Document Symbols\n- Find References\n- Go to definition\n- Hover\n  - Instruction/directive documentation\n  - Symbol info\n- Multiple workspaces\n- Rename Symbols\n- Signature Help\n\n## Installation\n\nInstall the package via npm:\n\n```\nnpm install --global m68k-lsp-server\n```\n\n## Usage\n\n### Neovim\n\nConfigure using [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig)\n\ne.g.\n```lua\nrequire('lspconfig').m68k.setup{\n  on_attach = on_attach,\n  init_options = {\n    includePaths = { '../include', '/home/myuser/includes' },\n    format = {\n      case = {\n        instruction = 'upper'\n      }\n    }\n  }\n}\n```\n\n### Emacs\n\nSee [emacs-m68k](https://github.com/themkat/emacs-m68k)\n\n### Standalone server\n\nStart the server e.g.:\n\n```\nm68k-lsp-server --stdio\n```\n\n## Configuration\n\nThe LSP client can configured using the following settings, either as initialization options, or as a `.m68krc.json` file in your workspace root, for project specific overrides.\n\n### Processors:\n\nLists the processor(s) that your code is targeted at. This controls completion suggestions and provides diagnostics.\n\n```json\n{\n  \"processors\": [\"mc68030\", \"mc68881\"]\n}\n```\n\nDefault: `[\"mc68000\"]`\n\nSupported values:\n`mc68000`\n,`mc68010`\n,`mc68020`\n,`mc68030`\n,`mc68040`\n,`mc68060`\n,`mc68881`\n,`mc68851`\n,`cpu32`\n\n### Include Paths:\n\nAdditional paths to use to resolve include directives. This is equivalent to `INCDIR` in source. It should probably\ninclude anything you pass to vasm `-I` arguments. Can be absolute or relative.\n\n```json\n{\n  \"includePaths\": [\"../include\", \"/home/myuser/includes\"]\n}\n```\n\nDefault: `[]`\n\n### vasm diagnostics:\n\nThe server can use [vasm](http://www.compilers.de/vasm.html) to provide diagnostic messages. When enabled it will assemble source files on save/open and display any errors or warnings.\n\nThe server will use a local `vasmm68k_mot` executable if one exists in your path or is configured in `vasm.binPath`, otherwise it will default to a bundled version complied in Web Assembly.\n\n```json\n{\n  \"vasm\": {\n    \"provideDiagnostics\": true,\n    \"binPath\": \"vasmm68k_mot\",\n    \"args\": [],\n    \"preferWasm\": false,\n    \"exclude\": []\n  }\n}\n```\n\n(defaults)\n\n| Property             | Description                                                                                                     |\n| -------------------- | --------------------------------------------------------------------------------------------------------------- |\n| `provideDiagnostics` | Enable vasm diagnostics                                                                                         |\n| `binPath`            | Filename or full path of vasm executable binary                                                                 |\n| `args`               | Custom arguments to pass to vasm. Include paths and processor(s) from server config will automatically be added |\n| `preferWasm`         | Always use bundled Web Assembly vasm                                                                            |\n| `exclude`            | File patterns to ignore and not build directly e.g. `[\"*.i\"]`                                                   |\n\n### Formatting:\n\nThe language server supports document formatting which can be configured using the following options:\n\n#### Case\n\nEnforce consistency of upper/lower case on elements which are normally case insensitive.\n\n| Option  | Behaviour          |\n| ------- | ------------------ |\n| `upper` | Upper case         |\n| `lower` | Lower case         |\n| `any`   | Do not change case |\n\nThis can either be configured globally for all elements:\n\n```json\n{\n  \"format\": {\n    \"case\": \"lower\"\n  }\n}\n```\n\nor per element type\n\n```json\n{\n  \"format\": {\n    \"case\": {\n      \"instruction\": \"lower\",\n      \"directive\": \"lower\",\n      \"control\": \"upper\",\n      \"sectionType\": \"lower\",\n      \"register\": \"lower\",\n      \"hex\": \"lower\"\n    }\n  }\n}\n```\n\n| Element       | Description                                           |\n| ------------- | ----------------------------------------------------- |\n| `instruction` | Instruction mnemonic/size e.g. `move.w`               |\n| `directive`   | Assembler directive mnemonic/qualifier e.g. `include` |\n| `control`     | Assembler control keywords e.g. `ifeq`/`endc`         |\n| `sectionType` | Section type e.g. `bss`                               |\n| `register`    | Register name e.g. `d0`,`sr`                          |\n| `hex`         | Hexadecimal number literal                            |\n\nDefault: `\"lower\"`\n\n#### Label colon\n\nDetermines whether labels should have a colon suffix.\n\nCan be set for all labels:\n\n```json\n{\n  \"format\": {\n    \"labelColon\": \"on\"\n  }\n}\n```\n\nor individually for global and local labels:\n\n```json\n{\n  \"format\": {\n    \"labelColon\": {\n      \"global\": \"on\",\n      \"local\": \"off\"\n    }\n  }\n}\n```\n\n| Option       | Behaviour                                             |\n| ------------ | ----------------------------------------------------- |\n| `on`         | Add colon                                             |\n| `off`        | Remove colon                                          |\n| `notInline`  | No colon for labels on same line as instruction       |\n| `onlyInline` | Only add colon for labels on same line as instruction |\n| `any`        | Do not change                                         |\n\nDefault: `\"on\"`\n\n#### Operand space\n\nInclude space between operands e.g. ` move d0, d1`. VASM needs `-spaces` or `-phxass` option to support this.\n\n| Option | Behaviour     |\n| ------ | ------------- |\n| `on`   | Add space     |\n| `off`  | Remove space  |\n| `any`  | Do not change |\n\nDefault: `\"off\"`\n\n```json\n{\n  \"format\": {\n    \"operandSpace\": \"off\"\n  }\n}\n```\n\n#### Quotes\n\nQuote style to use for strings and paths.\n\n```json\n{\n  \"format\": {\n    \"quotes\": \"single\"\n  }\n}\n```\n\n| Option   | Behaviour          |\n| -------- | ------------------ |\n| `single` | Single quotes: `'` |\n| `double` | Double quotes: `\"` |\n| `any`    | Do not change      |\n\nDefault: `\"double\"`\n\n#### Align\n\nIndents elements to align by type.\n\n```json\n{\n  \"format\": {\n    \"align\": {\n      \"mnemonic\": 8,\n      \"operands\": 16,\n      \"comment\": 48,\n      \"operator\": 0,\n      \"value\": 0,\n      \"indentStyle\": \"space\",\n      \"tabSize\": 8,\n      \"autoExtend\": \"line\"\n    }\n  }\n}\n```\n\n(defaults)\n\n| Property            | Description                                                                                             |\n| ------------------- | ------------------------------------------------------------------------------------------------------- |\n| `mnemonic`          | Position of instruction/directive mnemonic and size e.g. `move.w`,`include`.                            |\n| `operands`          | Position of operands e.g. `d0,d1`.                                                                      |\n| `comment`           | Position of comment following statement. Comments on their own line are not affected.                   |\n| `operator`          | Position of `=` character in constant assignment                                                        |\n| `value`             | Position of value in constant assignment                                                                |\n| `standaloneComment` | Position / behaviour of comment with no other elements on the same line.                                |\n| `indentStyle`       | Character to use for indent - `tab` or `space`.                                                         |\n| `tabSize`           | Width of tab character to calculate positions when using `tab` indent style.                            |\n| `autoExtend`        | Behaviour when a component exceeds the available space between positions. See below.                    |\n\nOptions for `standaloneComment`:\n\n| Option        | Behaviour                                                                                                            |\n| ------------- | -------------------------------------------------------------------------------------------------------------------- |\n| `\"nearest\"`   | Align to nearest element position (default). E.g. if current position is closest to mnemonic it snaps to that column |\n| `\"ignore\"`    | Don't align                                                                                                          |\n| `elementName` | Align to named element position e.g. `\"label\"`, `\"mnemonic\"`, `\"operands\"`                                           |\n| `number`      | Numeric literal position                                                                                             |\n\nOptions for `autoExtend`:\n\n| Option  | Behaviour                                                                                                                     |\n| ------- | ----------------------------------------------------------------------------------------------------------------------------- |\n| `line`  | Adjust the position for the affected line only                                                                                |\n| `block` | Adjust the position, maintaining alignment for all lines within the same block i.e. code separated by two or more line breaks |\n| `file`  | Adjust the position, maintaining alignment for all lines in the source file                                                   |\n\n#### Trim whitespace\n\nRemove trailing whitespace from lines?\n\n```json\n{\n  \"format\": {\n    \"trimWhitespace\": true\n  }\n}\n```\n\ndefault: `true`\n\n#### Final new line\n\nRequire line break on final line?\n\n```json\n{\n  \"format\": {\n    \"finalNewLine\": true\n  }\n}\n```\n\n#### End-of-line character\n\nNew line type: `lf`, `cr`, `crlf`\n\n```json\n{\n  \"format\": {\n    \"endOfLine\": \"lf\"\n  }\n}\n```\n\ndefault: `lf`\n\n## TODO\n\n- Full documentation for 68010+ instructions\n- Diagnostics\n  - Instruction signatures\n- Amiga or other platform specific docs?\n\n## License\n\nThis project is made available under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrahambates%2Fm68k-lsp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrahambates%2Fm68k-lsp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrahambates%2Fm68k-lsp/lists"}