{"id":22393086,"url":"https://github.com/nemethf/pyls-bess","last_synced_at":"2025-03-26T22:22:01.821Z","repository":{"id":145233620,"uuid":"244676402","full_name":"nemethf/pyls-bess","owner":"nemethf","description":"Bess plugin for the python-language-server","archived":false,"fork":false,"pushed_at":"2020-07-17T18:02:38.000Z","size":159,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T04:14:55.484Z","etag":null,"topics":["bess","language-server","lsp","pyls"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nemethf.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}},"created_at":"2020-03-03T15:45:58.000Z","updated_at":"2020-07-17T18:28:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"a4101c01-ba65-4d19-86f9-c4cdb893de5f","html_url":"https://github.com/nemethf/pyls-bess","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemethf%2Fpyls-bess","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemethf%2Fpyls-bess/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemethf%2Fpyls-bess/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nemethf%2Fpyls-bess/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nemethf","download_url":"https://codeload.github.com/nemethf/pyls-bess/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245743528,"owners_count":20665117,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bess","language-server","lsp","pyls"],"created_at":"2024-12-05T04:22:36.569Z","updated_at":"2025-03-26T22:22:01.795Z","avatar_url":"https://github.com/nemethf.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Bess plugin for pyls\n====================\n\n\npyls-bess is a simple plugin for\n[pyls](https://github.com/palantir/python-language-server).\n\nThe [Bess](https://github.com/NetSys/bess) scripting/configuration\nlanguage is basically python with some syntactic sugar and global\nvariables.  pyls-bess relies on\n[bess-gen-doc](https://github.com/nemethf/bess-gen-doc) for the global\nvariables (see [globals.py](pyls_bess/bess_doc/globals.py) and\n[globals.min.json.gz](pyls_bess/bess_doc/globals.min.json.gz)).  It uses\nvery simple heuristics to understand the syntactic sugar.\n\npyls-bess should work with any text editor supporting the [language\nserver protocol](https://langserver.org/), however I only tested it\nwith emacs/[eglot](https://github.com/joaotavora/eglot).\n\n## Features\n\n* Documentation help of a bess module\n\n  ![bess-obj-doc](resources/bess-obj-doc.png)\n\n* Documentation help for a method argument\n\n  ![bess-arg-doc](resources/bess-arg-doc.png)\n\n* Jump to definition / references.  In case of multiple references, the\n  default order of the references is \"project\", \"cpp_definition\",\n  \"mclass\", \"protobuf\", \"examples\".\n\n  ![bess-refs](resources/bess-refs.png)\n\n* Completion of the global variable `bess`\n\n  ![bess-auto-complete-bess](resources/bess-auto-complete-bess.png)\n\n* Completion of a module instance\n\n  ![bess-auto-complete-mod](resources/bess-auto-complete-mod.png)\n  \n  \n* Type checking with [mypy](https://github.com/tomv564/pyls-mypy)\n\n  ![mypy](https://raw.githubusercontent.com/wiki/nemethf/pyls-bess/mypy.png)\n\n  The mypy plugin detects that `Queue().get_status()['dequeue']` is\n  incorrect because the return value of `get_status` has no key\n  `dequeue`.  Pyls, however, cannot currently complete the possible\n  keys.  Moreover, completing `Queue().get_status().` incorrectly\n  lists the possible dictionary keys as properties.  But at least it\n  helps to find out `dequeue` should be changed to `dequeued`.\n\n  \n## Installation\n\nInstall with `pip3 install .`.\n\n## Configuration\n\npyls-bess defines three configuration variables.\n\n`bess.source_directory` sets the location of bess itself.  If this\nvarialbe is not set, pyls-bess falls back to the BESS environment\nvariable.\n\n`bess.definitions` and `bess.refereneces` define lists of reference\ntypes.  The server searches for definitions/references considering the\nlists in order.  The possible reference types are `project`,\n`cpp_definition`, `mclass`, `protobuf`, and `examples`.\n\nThe bess-specific configuration variables can be append to an existing\nsetup.cfg, tox.ini, or pycodestyle.cfg file.  Alternatively, it can be\nplaced in a separate .bessls file at the root of the project, or in a\nuser-level configuration file named bessls in\n[XDG_CONFIG_HOME](https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.8.html)\n(usually ~/.config).  With the following example, pyls-bess searches\nthe current project (workspace) and then the module_msg.proto file for\nreferences.  If bessls found references in the proto file it returns\nthe file as /opt/bess/protobuf/module_msg.proto.\n\n```\n[bess]\nreferences = project, protobuf\nsource_directory = /opt/bess\n```\n\n## Configuration of Emacs/eglot\n\nAdding the following lines to the [Emacs initialization\nfile](https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html)\nis enough.\n\n```elisp\n(setenv \"BESS\" \"/opt/bess\")\n\n(define-derived-mode bess-mode python-mode \"bess\")\n(add-to-list 'auto-mode-alist '(\"\\\\.bess\\\\'\" . bess-mode))\n(with-eval-after-load 'eglot\n  (add-to-list 'eglot-server-programs '(bess-mode . (\"pyls\"))))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnemethf%2Fpyls-bess","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnemethf%2Fpyls-bess","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnemethf%2Fpyls-bess/lists"}