From c31817f44a250018d5b10573d85033c352f3e61c Mon Sep 17 00:00:00 2001 From: kagami Date: Sat, 3 Feb 2024 00:14:37 +0800 Subject: [PATCH] Add type definitions for IDE service --- libs/ide_services/types.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 libs/ide_services/types.py diff --git a/libs/ide_services/types.py b/libs/ide_services/types.py new file mode 100644 index 0000000..577bb9f --- /dev/null +++ b/libs/ide_services/types.py @@ -0,0 +1,24 @@ +from typing import List +from pydantic import BaseModel + + +class Position(BaseModel): + line: int # 0-based + character: int # 0-based + + +class Range(BaseModel): + start: Position + end: Position + + +class Location(BaseModel): + abspath: str + range: Range + + +class SymbolNode(BaseModel): + name: str + kind: str + range: Range + children: List["SymbolNode"]