ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

LSP-nimlangserver

by sublimelsp ST4

A convenience package for the official Nim language server.

Details

Installs

  • Total 105
  • Win 34
  • Mac 21
  • Linux 50
Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11
Windows 0 0 0 0 1 0 0 0 0 2 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1
Linux 0 0 1 1 1 1 1 0 0 1 0 1 0 0 3 1 1 0 0 0 0 1 0 0 1 0 2 0 0 0 1 1 0 0 0 0 1 2 0 1 0 1 1 1 0 0

Readme

Source
raw.​githubusercontent.​com

LSP-nimlangserver

A helper package that manages the nimlangserver language server.

LSP Features

Installation

Install the following packages via Package Control: 1. LSP 2. LSP-nimlangserver 3. Nim for syntax highlighting. 4. Debugger for Debugging Nim programs. 5. Terminus for running debugger tasks.

Configuration

You can edit the global settings by opening the Preferences: LSP-nimlangserver Settings from the Command Palette.

You can also have a project-specific configuration. Run the Project: Edit Project from the Command Palette and edit the following in the settings object.

{
    // folders: [
    //   ...
    // ]
    "settings": {
        "LSP": {
            "nimlangserver": {
                "settings": {
                    //Setting-here
                }
            }
        }
    }
}

Applicable Selectors

This language server operates on views with the source.nim base scope.

Server Management

If the "binary" setting is set to a non-empty string (the default), then it will try to find the server binary in your system. If it fails, then it will prompt you to download it from Github. The server binary is automatically downloaded to $CACHE/Package Storage/LSP-nimlangserver.

Debugging

The Debugger package enables debugging Nim programs (among others). Some setup is required however.

Debugger

Setting Up

  • Read the README
  • The adapter to install is lldb.
  • Example configurations for debugging the current file:
{
    // folders: [
    //   ...
    // ]
    "debugger_configurations":
    [
        {
            "name": "Launch",
            "program": "${file_path}/${file_base_name}",
            "pre_debug_task": "Nim: compile for debugging",
            // "preRunCommands": ["command script import --allow-reload \"<PATH_TO_NIM_INSTALLATION_DIR>/tools/debug/nimlldb.py\""] // improves values representation (but may be buggy).
            "args": [],
            "cwd": "${file_path}"
        },
    ],
    "debugger_tasks": [
        {
            "name": "Nim: compile for debugging",
            "shell_cmd": "nim c -g ${file}",
            "file_regex": "^(.+.nim)\\((\\d+), (\\d+)\\) (.*)",
            "line_regex": "Error:"
        }
    ]
}
  • You may also define tasks and configurations globally:
    • Run Preferences: Debugger Settings from the command palette.
    • Add the task or configuration to the global_debugger_tasks or the global_debugger_configuration settings respectively.