/stata-language-server

stata language serve based on pygls, including auto completion, codestyle checking, etc.

Primary LanguagePythonMIT LicenseMIT

Stata-Language-Server

Write your Stata scripts more fluently!

Actions Status

Description

An extension for Stata on VS Code. It provides codestyle checking, goto-definition, syntax tips and auto completion.

Developed based on language server, depending on Third-party Python library pygls.

Note: Python(>=3.6) is required on local system before extension installing. Another extension Stata Enhanced is recommanded for syntax highlight since Stata Language Server doesn't provide this feature.

Supported Features

  • Codestyle Checking

    When editing a stata do-file, the extension will check documents and show bad codestyle using wavy underlines.

    diagnostic

  • Syntax tips while hovering

    When hovering on a complete command, a markdown formatted Syntax Description will appear.

    Note: Not available for 1.abbr. commands(eg: g, gen); 2.docstring included in another command's docstring(eg: replace belongs to generate)

    hover

    Note: Docstring files of this extension are only for academic purpose. The original work copyright belongs to StataCorp LLC. See ThirdPartyNotices.txt for details.

  • Goto Definition(generate varname =)

    Find and jump to the last generate place when right-click a variable name and click Go to Definition. Can match pattern like g(enerate).

    gotoDefinition

  • Syntax auto completion

    Auto-Completion for most stata commands. Only support complete syntax(eg: generate, not g(enerate)).

    completion

Requirements

  • Python >= 3.6

Settings

Setting Name Description Default Value
stataServer.setMaxLineLength Max line length for codestyle checking 120
stataServer.setIndentSpace Indent spaces for codetyle checking 4
stataServer.enableCompletion Turn on/off auto-completion true
stataServer.enableDocstring Turn on/off docstring tips true
stataServer.enableStyleChecking Turn on/off codestyle checking true

Release Notes

Refer to CHANGELOG.md

Issues

Submit issues if you find any bug or have any suggestion.