Skip to content

Language Server Protocol implementation for ORCA quantum chemistry software

License

Notifications You must be signed in to change notification settings

OpenQuantumChemistry/orca-lsp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ORCA Language Server

Language Server Protocol (LSP) implementation for ORCA quantum chemistry software.

Features

✅ Implemented

  1. Parser - Parses ORCA .inp files

    • % blocks (%maxcore, %pal, %method, etc.)
    • Simple input lines (! directives)
    • Coordinate sections (* xyz ... *)
  2. LSP Features

    • Diagnostics - Detects invalid keywords and parameters
    • Completion - Auto-complete for methods, basis sets, and blocks
    • Hover - Documentation for keywords on hover
    • Document Symbols - Navigate input file structure
  3. Syntax Highlighting (VSCode extension)

    • ORCA input file grammar
    • Colorization for blocks, keywords, coordinates

🚧 Planned Features

  • Code formatting
  • Semantic highlighting
  • Code actions (quick fixes)
  • Rename refactoring
  • Document links
  • Integration with ORCA output files

Installation

Building from Source

# Clone the repository
git clone https://github.com/newtontech/orca-lsp.git
cd orca-lsp

# Install dependencies
npm install

# Build the server
npm run build

VSCode Extension

cd vscode-extension
npm install
npm run build

Install the extension in VSCode by copying the vscode-extension folder to your extensions directory or using the VSIX package.

Usage

Running the Server

npm start

The server communicates via stdio using the LSP protocol.

VSCode Integration

  1. Install the ORCA LSP extension
  2. Open any .inp file
  3. The language server will start automatically

Configuration

Add to your VSCode settings.json:

{
  "orcaLanguageServer.maxNumberOfProblems": 1000
}

ORCA Input File Support

Supported Elements

Simple Input (!)

! B3LYP def2-TZVP Opt Freq

Supported completions:

  • Methods: HF, DFT functionals (B3LYP, PBE0, M06-2X, etc.), MP2, CCSD(T), CASSCF
  • Basis Sets: Pople (6-31G, 6-311G), Dunning (cc-pVDZ, cc-pVTZ), def2 family
  • Options: Opt, Freq, TightSCF, Grid5, RI, D3BJ, CPCM

Block Input (%)

%maxcore 4000
%pal nprocs 8 end
%scf
  maxiter 200
  converge tight
end

Supported blocks:

  • %maxcore - Memory allocation
  • %pal - Parallelization
  • %scf - SCF convergence
  • %geom - Geometry optimization
  • %basis - Basis set configuration
  • %method - Method settings
  • %mp2, %cc, %casscf - Correlation methods
  • %cpcm - Solvation
  • %freq - Frequency calculations
  • And more...

Coordinates (* xyz)

* xyz 0 1
C  0.0000  0.0000  0.0000
H  0.0000  0.0000  1.0890
H  1.0267  0.0000 -0.3630
H -0.5133 -0.8892 -0.3630
H -0.5133  0.8892 -0.3630
*

Development

Project Structure

orca-lsp/
├── src/
│   ├── server.ts      # LSP server implementation
│   ├── parser.ts      # ORCA input file parser
│   └── keywords.ts    # Keyword database
├── vscode-extension/  # VSCode client extension
├── syntaxes/          # TextMate grammar files
└── package.json

Building

npm run build

Watching for Changes

npm run watch

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

Adding New Keywords

Edit src/keywords.ts to add new:

  • DFT functionals
  • Basis sets
  • Block directives
  • Calculation options

License

MIT License - see LICENSE file.

Acknowledgments

About

Language Server Protocol implementation for ORCA quantum chemistry software

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 100.0%