Skip to content

Commit 2c7ad54

Browse files
committed
feat: remove ts dependencies
1 parent e0f5f8f commit 2c7ad54

File tree

2 files changed

+100
-1
lines changed

2 files changed

+100
-1
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@coze-editor/code-language-typescript",
5+
"comment": "remove ts dependencies",
6+
"type": "minor"
7+
}
8+
],
9+
"packageName": "@coze-editor/code-language-typescript",
10+
"email": "[email protected]"
11+
}

packages/text-editor/code-language-typescript/src/as.ts

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,95 @@
22
// SPDX-License-Identifier: MIT
33

44
import { CompletionItemKind } from 'vscode-languageserver-types';
5-
import { ScriptElementKind } from 'typescript';
5+
6+
/**
7+
* Copied from TypeScript 5.8.2
8+
*/
9+
enum ScriptElementKind {
10+
unknown = '',
11+
warning = 'warning',
12+
/** predefined type (void) or keyword (class) */
13+
keyword = 'keyword',
14+
/** top level script node */
15+
scriptElement = 'script',
16+
/** module foo {} */
17+
moduleElement = 'module',
18+
/** class X {} */
19+
classElement = 'class',
20+
/** var x = class X {} */
21+
localClassElement = 'local class',
22+
/** interface Y {} */
23+
interfaceElement = 'interface',
24+
/** type T = ... */
25+
typeElement = 'type',
26+
/** enum E */
27+
enumElement = 'enum',
28+
enumMemberElement = 'enum member',
29+
/**
30+
* Inside module and script only
31+
* const v = ..
32+
*/
33+
variableElement = 'var',
34+
/** Inside function */
35+
localVariableElement = 'local var',
36+
/** using foo = ... */
37+
variableUsingElement = 'using',
38+
/** await using foo = ... */
39+
variableAwaitUsingElement = 'await using',
40+
/**
41+
* Inside module and script only
42+
* function f() { }
43+
*/
44+
functionElement = 'function',
45+
/** Inside function */
46+
localFunctionElement = 'local function',
47+
/** class X { [public|private]* foo() {} } */
48+
memberFunctionElement = 'method',
49+
/** class X { [public|private]* [get|set] foo:number; } */
50+
memberGetAccessorElement = 'getter',
51+
memberSetAccessorElement = 'setter',
52+
/**
53+
* class X { [public|private]* foo:number; }
54+
* interface Y { foo:number; }
55+
*/
56+
memberVariableElement = 'property',
57+
/** class X { [public|private]* accessor foo: number; } */
58+
memberAccessorVariableElement = 'accessor',
59+
/**
60+
* class X { constructor() { } }
61+
* class X { static { } }
62+
*/
63+
constructorImplementationElement = 'constructor',
64+
/** interface Y { ():number; } */
65+
callSignatureElement = 'call',
66+
/** interface Y { []:number; } */
67+
indexSignatureElement = 'index',
68+
/** interface Y { new():Y; } */
69+
constructSignatureElement = 'construct',
70+
/** function foo(*Y*: string) */
71+
parameterElement = 'parameter',
72+
typeParameterElement = 'type parameter',
73+
primitiveType = 'primitive type',
74+
label = 'label',
75+
alias = 'alias',
76+
constElement = 'const',
77+
letElement = 'let',
78+
directory = 'directory',
79+
externalModuleName = 'external module name',
80+
/**
81+
* <JsxTagName attribute1 attribute2={0} />
82+
* @deprecated
83+
*/
84+
jsxAttribute = 'JSX attribute',
85+
/** String literal */
86+
string = 'string',
87+
/** Jsdoc @link: in `{@link C link text}`, the before and after text "{@link " and "}" */
88+
link = 'link',
89+
/** Jsdoc @link: in `{@link C link text}`, the entity name "C" */
90+
linkName = 'link name',
91+
/** Jsdoc @link: in `{@link C link text}`, the link text "link text" */
92+
linkText = 'link text',
93+
}
694

795
/*
896
* Copyright (C) 2018 TypeFox and others.

0 commit comments

Comments
 (0)