Skip to content

ADFA-4851 | Python-Tools: syntax highlighting and code completion for .py files - #119

Merged
Daniel-ADFA merged 4 commits into
mainfrom
feat/ADFA-4851-python-language-server
Oct 6, 2026
Merged

Daniel-ADFA merged 4 commits into
mainfrom
feat/ADFA-4851-python-language-server

Conversation

@Daniel-ADFA

@Daniel-ADFA Daniel-ADFA commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

ADFA-4851

Python-Tools implements LanguageExtension: tree-sitter highlighting for .py and pylsp completion, diagnostics and formatting, installed offline from a pinned wheelhouse.

Depends on appdevforall/CodeOnTheGo#2099. Draft until that merges and the update-libs bot brings LanguageExtension into libs/plugin-api.jar; CI cannot compile it before then.

… .py files

Python-Tools implements LanguageExtension: it ships the tree-sitter Python grammar
(0.23.6, built per ABI from the checksummed npm tarball) with its highlights query, and
runs pylsp on the device for completion, pyflakes diagnostics and yapf formatting.

pylsp and the Flask template's packages come from a bundled wheelhouse pinned in
python-bundle.lock (URL + SHA-256), installed with pip --no-index, so neither needs a
network connection. min_ide_version moves to 26.41 and native.code is requested for the
grammar library.
@Daniel-ADFA
Daniel-ADFA marked this pull request as ready for review October 5, 2026 12:25
Comment thread plugins/Python-Tools/build.gradle.kts
- A failed or cancelled requirements install no longer re-arms the automatic
  sync. toolbarActionsToHide() runs on every toolbar refresh, so an offline
  project re-ran a 300 s pip install and re-showed the failure toast on nearly
  every refresh. The sync now runs once per project open; the failure toast
  points at Install requirements for a retry.
- downloadTreeSitterGrammar declares the grammar version, URL and sha256 as
  task inputs, so changing any of them re-runs the download instead of the
  task staying up to date on a stale grammar.
- The wheelhouse is extracted through <name>.partial and renamed into place, so
  a copy interrupted by a kill or a full disk never leaves a truncated wheel at
  the final name for later activations to skip and pip to reject.
toolbarActionsToHide() can only hide the Gradle actions in
ToolbarActionIds.BUILD_HIDEABLE, which do not include Quick Build
(ide.editor.build.quickBuild), so it stayed on the toolbar of a Python
project. Implement UIExtension and return it from
getHiddenToolbarActionIds() while a Python project is open, as Go-Tools
does.
@Daniel-ADFA
Daniel-ADFA merged commit dcab101 into main Oct 6, 2026
1 check passed
@Daniel-ADFA
Daniel-ADFA deleted the feat/ADFA-4851-python-language-server branch October 6, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants