{"id":17691273,"url":"https://github.com/genericptr/pascal-language-server","last_synced_at":"2026-02-05T06:32:07.004Z","repository":{"id":61163645,"uuid":"258119971","full_name":"genericptr/pascal-language-server","owner":"genericptr","description":"LSP server implementation for Pascal","archived":false,"fork":false,"pushed_at":"2026-02-01T09:15:11.000Z","size":648,"stargazers_count":74,"open_issues_count":33,"forks_count":29,"subscribers_count":6,"default_branch":"trunk","last_synced_at":"2026-02-01T19:47:40.618Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Pascal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"arjanadriaanse/pascal-language-server","license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/genericptr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-04-23T06:54:14.000Z","updated_at":"2026-02-01T09:14:49.000Z","dependencies_parsed_at":"2026-01-07T05:02:31.362Z","dependency_job_id":null,"html_url":"https://github.com/genericptr/pascal-language-server","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/genericptr/pascal-language-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/genericptr%2Fpascal-language-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/genericptr%2Fpascal-language-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/genericptr%2Fpascal-language-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/genericptr%2Fpascal-language-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/genericptr","download_url":"https://codeload.github.com/genericptr/pascal-language-server/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/genericptr%2Fpascal-language-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29114910,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T05:31:32.482Z","status":"ssl_error","status_checked_at":"2026-02-05T05:31:29.075Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-10-24T12:08:07.614Z","updated_at":"2026-02-05T06:32:06.997Z","avatar_url":"https://github.com/genericptr.png","language":"Pascal","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Pascal Language Server\n\nAn [LSP](https://microsoft.github.io/language-server-protocol/) server\nimplementation for Pascal variants that are supported by [Free\nPascal](https://www.freepascal.org/), including Object Pascal. It uses\n[CodeTools](https://wiki.lazarus.freepascal.org/Codetools) from\nLazarus as backend.\n\n## Features\n\nTo see the full list of implemented server capabilities in the current version use the command:\n\n  `pasls -h`\n\n### Extra commands to be executed with **executeCommand**:\n\n* **pasls.completeCode** Complete code at cursor. Takes DocumentUri and\n  Position as options.\n* **pasls.formatCode** Format current file. Takes documentUri and Config file URI as options. \n  The configuration file is the Jedi Code Formatter configuration file. You\n  can find an example in the Lazarus settings directory **~/.lazarus/jcfsettings.cfg**.\n  An extra example is included in this repository in **Sample-Formatting.cfg**\n\n### Initialization Options\n\nEditors can supply [initialization options](https://microsoft.github.io/language-server-protocol/specifications/specification-3-15/#initialize) to the server, however each client handles this differently so please refer to your editors LSP plugin for more information.\n\nTo see the available list of options in the current version use the command:\n\n  `pasls -h`\n\nClients should include these in their configuration files but you can verify they're up to date using `-h`.\n\nMacros are supported in initialization options. The following macros will be expanded:\n\n- `$(tmpdir)` - Path to your systems temporary directory.\n- `$(root)` - Path to the rootURI as specified by the clients [initialize request](https://microsoft.github.io/language-server-protocol/specifications/specification-3-15/#initialize).\n\nThe following macro formats are valid:\n\n- `$macro`\n- `$MACRO`\n- `$(macro)`\n- `$(MACRO)`\n\n## Clients\n\n### Emacs\n\nTo use the server from `lsp-mode` in Emacs, install the separate\n[`lsp-pascal`](https://github.com/arjanadriaanse/lsp-pascal) module.\n\n### Sublime Text\n\nInstall the [package](\nhttps://github.com/genericptr/pasls-sublime-text) and configure the settings accordingly. Requires the [LSP](https://github.com/sublimelsp/LSP) package.\n\n### Visual Studio Code\n\nInstall the [extension](\nhttps://github.com/genericptr/pasls-vscode) and configure the settings accordingly. You must have the actual language installed before the extension will work.\n\n\n## Building\n\nRequires Free Pascal Compiler version 3.2.0 and Lazarus trunk sources.\n\nTo build using Lazarus, you need to follow the following steps:\n\n* Update or download the sources from gitlab:\n[https://gitlab.com/freepascal.org/lazarus/lazarus](https://gitlab.com/freepascal.org/lazarus/lazarus)\n\n* Open the jcfbase package in the lazarus IDE. It is located in the\n  `components/jcf2` directory.  You can compile this package in the IDE.\n  \n  You need to do this only once, so Lazarus knows about the jcfbase package.\n  (unless you wish to update the Jedi Code Formatter)\n\n* open the `lspprotocol.lpk` package in Lazarus. It is located in the\n  [src/protocol](src/protocol) directory.\n  You can compile this package in the IDE, but this is not needed: The\nLazarus IDE and Lazbuild simply need to know where it is located.\n\n* open the `lspserver.lpk` package in Lazarus. It is located in the\n  [src/serverprotocol](src/serverprotocol) directory.\n  You can compile this package in the IDE, but this is not needed: The\nLazarus IDE and Lazbuild simply need to know where it is located.\n\n* open the `src/standard/pasls.lpi` project file in Lazarus, and compile the\n  program. or use the lazbuid commandline:\n\n```sh\nlazbuild src/standard/pasls.lpi\n```\nThe `lspprotocol.lpk` package and `pasls.lpi` are both in the\n`pascallanguageserver.lpg`project group; if you have project group support enabled,\nthen you can use this to compile this package and the executable.\n\n## Debugging the LSP server\n\n### The problem\n\nVS Code and other editors that use the LSP server start the LSP server and\nsend messages in JSON-RPC style to standard input, and read replies through\nstandard output. This makes the LSP server process hard to debug.\n\n### The solution\nTo solve this, 2 extra projects have been added:\n\n- **paslssock**:  a LSP server that reads messages from a TCP/IP or Unix\n  socket and sends replies back through the socket.\n\n- **paslsproxy**: This is a drop-in replacement for pasls: It is a LSP server\n  that acts as a proxy: it reads messages from standard input (just as\n  pasls), but sends them to a TCP/IP or Unix socket. It reads the replies\n  from the socket and writes them to standard output.\n\nBoth programs have a -h or --help commandline option which will display all\nconfiguration options.\n\n### Configuration  \n\n#### paslssock\nThe paslssock server can read an initialization file with 2 sections, \n`Server` and `CodeTools`. These can be used to set another port on which to\nlisten, and to specify values for the environment variables that are normally sent by the\nclient.\n\n```ini\n[Server]\nPort=10090\n\n[CodeTools]\nCompiler=/usr/local/bin/ppcx64-3.2.2\nFPCDir=/home/michael/FPC/build/svn/tag_3_2_2/fpcsrc\nLazarusDir=/home/michael/projects/lazarus\nTargetOS=linux\nTargetCPU=x86_64\n```\n\nThe default location for this configuration file is `/etc/paslssock.cfg` on unix, and next to the\nexecutable on Windows.\n\n#### paslsproxy\nThe proxy can also be configured with an  initialization file with 1\nsection: `Server`. This can be used to set the port on which the server is\nlistening.\n\n```ini\n[Server]\nPort=10090\n```\n\nThe default location for this configuration file is `/etc/paslsproxy.cfg` on unix, and next to the\nexecutable on Windows.\n\n### Usage\n\n1. Configure the socket process and proxy process. Both can be configured\n   through a command-line option or a configuration file.\n\n   By default the server listens on port 9898 and the proxy connects through\n   this port.\n\n   For both processes you can specify a log file which will log all communication to that logfile.\n\n2. Start the socket server process (in the IDE or debugger of your choice)\n   before you start the editor that uses the language server.\n\n3. Configure VS Code (or any other edit) to use the proxy process instead of the standard pasls executable.\n   Simply replace the full path to pasls to the full path to paslsproxy:\n\n![VS Code: specifying paslsproxy](images/vscodedebug.png)\n\n\n4. Happy debugging !\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenericptr%2Fpascal-language-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgenericptr%2Fpascal-language-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenericptr%2Fpascal-language-server/lists"}