Microsoft का Python के लिए Type Server Protocol

मूल शीर्षक: Type Server Protocol

यह क्यों महत्वपूर्ण है

TSP Python tooling को modular बनाता है — IDE और editors अलग type server से analysis data ले सकते हैं, जिससे Pylance जैसे tools की निर्भरता कम होगी।

Microsoft ने Pylance के लिए Type Server Protocol (TSP) जारी किया है — यह JSON-RPC आधारित protocol है जो Python workspace का type-analysis data प्रबंधित करता है। वर्तमान संस्करण 0.4.1 है।

Microsoft ने अपने Python language server Pylance के GitHub repository में Type Server Protocol (TSP) का विस्तृत दस्तावेज़ीकरण प्रकाशित किया है। TSP एक JSON-RPC protocol है जो किसी type server से Python analysis data माँगने के लिए उपयोग होता है। यह server workspace का type-analysis state बनाए रखता है और protocol version, snapshots, Python search paths, import resolution तथा type queries जैसी जानकारियाँ देता है।

TSP, Language Server Protocol (LSP) के data shapes और conventions — जैसे Position और Range — का उपयोग करता है। सभी TSP methods में typeServer/ prefix लगता है। Protocol के authoritative artifacts तीन फ़ाइलों में हैं: typeServerProtocol.ts (TypeScript interfaces), tsp.json (machine-readable model), और tsp.schema.json (JSON schema)।

Version history के अनुसार, 0.1.0 से शुरुआत हुई और 0.4.1 तक पहुँचते-पहुँचते multi-connection negotiation और typeServer/connection control request जोड़े गए। 0.x line में minor version changes breaking हो सकते हैं, जबकि patch changes backward compatible रहते हैं। यह protocol अभी विकास के शुरुआती चरण में है।

स्रोत

github.com — मूल लेख पढ़ें →