Movatterモバイル変換


[0]ホーム

URL:


⚠️

Security Update: npm classic token creation is now disabled. Existing classic tokens will be revoked onNovember 19, 2025. Migrate to trusted publishing or granular access tokens to avoid disruption.Learn more.

@codemirror/lang-python
TypeScript icon, indicating that this package has built-in type declarations

6.2.1 • Public • Published

[WEBSITE |ISSUES |FORUM |CHANGELOG ]

This package implements Python language support for theCodeMirror code editor.

Theproject page has more information, anumber ofexamples and thedocumentation.

This code is released under anMIT license.

We aim to be an inclusive, welcoming community. To make that explicit,we have acode ofconduct that appliesto communication around the project.

Usage

import{EditorView,basicSetup}from"codemirror"import{python}from"@codemirror/lang-python"constview=newEditorView({parent:document.body,doc:`print("Hello world")`,extensions:[basicSetup,python()]})

API Reference

python() → LanguageSupport

Python language support.

pythonLanguage:LRLanguage

A language provider based on theLezer Pythonparser, extended withhighlighting and indentation information.

globalCompletion:CompletionSource

Autocompletion for built-in Python globals and keywords.

localCompletionSource(contextCompletionContext) → CompletionResult |null

Completion source that looks up locally defined names inPython code.

Readme

Keywords

Package Sidebar

Install

npm i @codemirror/lang-python

Weekly Downloads

902,410

Version

6.2.1

License

MIT

Unpacked Size

37 kB

Total Files

9

Last publish

Collaborators

  • adrianheine
  • marijn

[8]ページ先頭

©2009-2025 Movatter.jp