Eric Streit 75f5e8e12b first commit 3 hafta önce
..
snippets 75f5e8e12b first commit 3 hafta önce
syntaxes 75f5e8e12b first commit 3 hafta önce
.gitignore 75f5e8e12b first commit 3 hafta önce
AUTO_UPPERCASE.md 75f5e8e12b first commit 3 hafta önce
LICENSE.txt 75f5e8e12b first commit 3 hafta önce
language-configuration.json 75f5e8e12b first commit 3 hafta önce
logo.png 75f5e8e12b first commit 3 hafta önce
package.json 75f5e8e12b first commit 3 hafta önce
readme.md 75f5e8e12b first commit 3 hafta önce
test-auto-uppercase.js 75f5e8e12b first commit 3 hafta önce

readme.md

ADW Modula-2 Language Server (LSP)

A high-performance implementation of the Language Server Protocol for the ADW Modula-2 dialect, featuring full support for Object-Oriented extensions including CLASS, INHERIT, and OVERRIDE.

Core Functionality

1. Semantic Analysis

  • Contextual Highlighting: Distinguished rendering for Types, Constants, Variables, and Procedures.
  • Comment Handling: Robust parsing of nested comments (* (* ... *) *) and complex strings to prevent highlighting bleed.

2. Navigation Logic

  • Go to Definition: Resolution of local symbols and cross-file navigation to .def headers.
  • Go to Implementation: Direct mapping from procedure signatures in .def files to the corresponding bodies in .mod files.
  • Symbol Lookup: Comprehensive workspace-wide symbol indexing and search.

3. ADW OOP Support

  • Inheritance Mapping: Resolution of INHERIT chains to provide accurate member completion for base classes.
  • Override Identification: Explicit marking of OVERRIDE methods within the Document Outline.

4. Technical Architecture

  • Indentation-Aware Scoping: Deterministic scope resolution for nested procedures and modules based on block indentation.
  • Asynchronous Indexing: Background processing of all workspace .def and .mod files for non-blocking cross-reference resolution.

Installation

VSIX Package

  1. Obtain the adw-modula2-lsp.vsix file.
  2. In VS Code, navigate to the Extensions view (Ctrl+Shift+X).
  3. Select Install from VSIX... from the local menu and select the file.

Source Build

  1. Clone the repository.
  2. Execute npm install in the root, /client, and /server directories.
  3. Execute npm run compile.
  4. Launch the Extension Development Host via F5.

Project Structure

  • client/: VS Code extension client-side activation and lifecycle management.
  • server/: LSP Server implementation containing the Modula-2 parser and symbol engine.
  • logo.png: Extension identifier icon.

License

This project is licensed under the MIT License. See the LICENSE file for full text.

Automatic keyword uppercasing

Version 0.1.1 automatically uppercases Modula-2 keywords as you edit .mod and .def files. Comments, pragmas, strings, character literals and longer identifiers are protected.

The feature can be disabled with adwModula2.autoUppercaseKeywords, or invoked manually with Modula-2: Uppercase Keywords.

Snippets

The extension provides Modula-2 snippets for modules, definition/implementation modules, procedures, control flow, declarations, imports, records, pointers, and sets. Snippets are available for both .mod and .def files.

Common prefixes include module, definition, implementation, proc, if, ifelse, for, while, repeat, loop, case, record, type, var, const, from, and import.