Skip to content

koxudaxi/t-linter-pycharm-plugin

Repository files navigation

TLinter PyCharm Plugin

License: MIT JetBrains Plugin

TLinter provides syntax highlighting for PEP 750 template strings in PyCharm.

Installation

Install directly from the JetBrains Marketplace:

Or install from within PyCharm:

  1. Go to Settings/PreferencesPlugins
  2. Search for "TLinter"
  3. Click Install

Features

  • 🎨 Automatic language injection for template strings with type annotations
  • 📝 Support for Annotated[Template, "language"] pattern
  • 🔤 Type alias support (e.g., type html = Annotated[Template, "html"])
  • 🔍 Function parameter type inference
  • 🌐 Support for HTML, SQL, JSON, YAML, JavaScript, TypeScript, CSS, and more

Syntax Highlighting Example

Usage

from typing import Annotated
from string.templatelib import Template

# Define variables for the templates
title = "Welcome"
content = "Hello, World!"
user_id = 123
message = "Important notification"

# Automatic HTML syntax highlighting
page: Annotated[Template, "html"] = t"""
<!DOCTYPE html>
<html>
    <body>
        <h1>{title}</h1>
        <p>{content}</p>
    </body>
</html>
"""

# SQL highlighting
query: Annotated[Template, "sql"] = t"SELECT * FROM users WHERE id = {user_id}"

# Type alias support
type html = Annotated[Template, "html"]
content: html = t"<div>{message}</div>"

License Requirements

While this plugin itself is free and open source, certain language injection features depend on your PyCharm edition:

Community Edition (Free)

The following languages are supported in PyCharm Community Edition:

  • HTML/XML - Full syntax highlighting and code assistance
  • JSON - Full syntax highlighting and validation
  • YAML - Full syntax highlighting and validation

Professional Edition (Paid License Required)

Advanced language support requires PyCharm Professional Edition:

  • SQL - Database tools and SQL dialect support are Professional-only features
  • JavaScript/TypeScript - JS/TS support requires the Professional edition
  • CSS - Advanced CSS features are part of the Web development toolset

For detailed information about PyCharm editions and their features, visit JetBrains PyCharm Comparison.

Note: The plugin will still inject these languages in Community Edition, but you won't get syntax highlighting, code completion, or error detection without the corresponding language support from PyCharm Professional.

About

No description, website, or topics provided.

Resources

License

MIT, Apache-2.0 licenses found

Licenses found

MIT
LICENSE
Apache-2.0
LICENSE_apache_version_2.txt

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published