@exercism/codemirror-lang-lisp 0.0.0-stage → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,123 @@
1
+ import * as _codemirror_language from '@codemirror/language';
2
+ import { LanguageSupport, LRLanguage } from '@codemirror/language';
3
+ import { CompletionSource, Completion, CompletionContext, CompletionResult } from '@codemirror/autocomplete';
4
+ import { EditorState } from '@codemirror/state';
5
+ import { SyntaxNode } from '@lezer/common';
6
+ import { LRParser } from '@lezer/lr';
7
+
8
+ declare const parser: LRParser
9
+
10
+ /**
11
+ A language provider based on the Lezer Lisp parser in this package,
12
+ extended with highlighting and indentation information.
13
+ */
14
+ declare const lispLanguage: LRLanguage;
15
+ /**
16
+ Autocompletion for the special forms the grammar recognises.
17
+ */
18
+ declare const lispCompletion: CompletionSource;
19
+ /**
20
+ Lisp language support, with completion for the special forms and for the
21
+ names declared in the file. Serves
22
+ Common Lisp, Scheme, Racket, Emacs Lisp and the smaller dialects that
23
+ share their reader.
24
+ */
25
+ declare function lisp(): LanguageSupport;
26
+
27
+ /**
28
+ Every name declared in the file that is visible at `pos`: names given by
29
+ `defun`, `defvar` and the like anywhere in the file, and names bound by
30
+ `let`, parameter lists and the other binding forms around `pos`. The name
31
+ under the cursor itself is left out.
32
+ */
33
+ declare function declaredNames(state: EditorState, pos: number): Map<string, Completion>;
34
+ /**
35
+ Completes the names declared in the file that are in scope at the cursor.
36
+ */
37
+ declare function localCompletionSource(context: CompletionContext): CompletionResult | null;
38
+
39
+ /**
40
+ Completes the standard Common Lisp symbols (special operators, macros,
41
+ functions, variables and constants) and snippets for the common forms.
42
+ */
43
+ declare const commonLispBuiltins: CompletionSource;
44
+ /**
45
+ Completes the names declared in the file that are in scope at the cursor.
46
+ On top of the names the grammar marks, it offers the functions written by
47
+ `defstruct`, the accessors named in `defclass`, and `loop` variables.
48
+ */
49
+ declare const commonLispLocals: CompletionSource;
50
+ /**
51
+ Every Common Lisp completion source: the standard symbols, snippets, and
52
+ the names declared in the file.
53
+ */
54
+ declare const commonLispCompletion: readonly CompletionSource[];
55
+ /**
56
+ Common Lisp language support: the shared Lisp grammar with completion for
57
+ Common Lisp.
58
+ */
59
+ declare function commonLisp(): _codemirror_language.LanguageSupport;
60
+
61
+ /**
62
+ Completes the built-in Emacs Lisp special forms, macros, functions and
63
+ variables, and snippets for the common forms.
64
+ */
65
+ declare const emacsLispBuiltins: CompletionSource;
66
+ /**
67
+ Completes the names declared in the file that are in scope at the cursor.
68
+ On top of the names the grammar marks, it offers the functions written by
69
+ `cl-defstruct`, functions named by `defalias`, `cl-loop` variables and
70
+ the error variable of `condition-case`.
71
+ */
72
+ declare const emacsLispLocals: CompletionSource;
73
+ /**
74
+ Every Emacs Lisp completion source: the built-ins, snippets, and the names
75
+ declared in the file.
76
+ */
77
+ declare const emacsLispCompletion: readonly CompletionSource[];
78
+ /**
79
+ Emacs Lisp language support: the shared Lisp grammar with completion for
80
+ Emacs Lisp.
81
+ */
82
+ declare function emacsLisp(): _codemirror_language.LanguageSupport;
83
+
84
+ /**
85
+ The shared Lisp language with the grammar's `lfe` dialect turned on.
86
+ */
87
+ declare const lfeLanguage: _codemirror_language.LRLanguage;
88
+ /**
89
+ Completes LFE's core forms and macros, the Erlang BIFs and operators, the
90
+ common module names, and snippets for the common forms.
91
+ */
92
+ declare const lfeBuiltins: CompletionSource;
93
+ /**
94
+ Completes the functions of an Erlang module, after `lists:` in
95
+ `(lists:foldl ...)` and after the module name in `(: lists foldl ...)`.
96
+ */
97
+ declare const lfeModuleFunctions: CompletionSource;
98
+ /**
99
+ The variables a pattern binds. A bare name binds itself, apart from `_`. In
100
+ a list the head is a constructor, such as `cons` or `tuple`, or a record
101
+ matcher such as `match-person`, and the rest are patterns. In a
102
+ backquoted pattern only the names after `,` bind.
103
+ */
104
+ declare function patternNames(state: EditorState, node: SyntaxNode, out: string[], quasi?: boolean): void;
105
+ /**
106
+ Completes the names declared in the file that are in scope at the cursor.
107
+ On top of the names the grammar marks, it offers the variables bound by
108
+ patterns in clauses, `case`, `receive`, `try`, `let` and comprehensions,
109
+ and the functions written by `defrecord`.
110
+ */
111
+ declare const lfeLocals: CompletionSource;
112
+ /**
113
+ Every LFE completion source: the built-ins, the functions of Erlang
114
+ modules, snippets, and the names declared in the file.
115
+ */
116
+ declare const lfeCompletion: readonly CompletionSource[];
117
+ /**
118
+ Lisp Flavoured Erlang language support: the shared Lisp grammar in its
119
+ `lfe` dialect, with completion for LFE.
120
+ */
121
+ declare function lfe(): _codemirror_language.LanguageSupport;
122
+
123
+ export { commonLisp, commonLispBuiltins, commonLispCompletion, commonLispLocals, declaredNames, emacsLisp, emacsLispBuiltins, emacsLispCompletion, emacsLispLocals, lfe, lfeBuiltins, lfeCompletion, lfeLanguage, lfeLocals, lfeModuleFunctions, lisp, lispCompletion, lispLanguage, localCompletionSource, parser, patternNames };
@@ -0,0 +1,123 @@
1
+ import * as _codemirror_language from '@codemirror/language';
2
+ import { LanguageSupport, LRLanguage } from '@codemirror/language';
3
+ import { CompletionSource, Completion, CompletionContext, CompletionResult } from '@codemirror/autocomplete';
4
+ import { EditorState } from '@codemirror/state';
5
+ import { SyntaxNode } from '@lezer/common';
6
+ import { LRParser } from '@lezer/lr';
7
+
8
+ declare const parser: LRParser
9
+
10
+ /**
11
+ A language provider based on the Lezer Lisp parser in this package,
12
+ extended with highlighting and indentation information.
13
+ */
14
+ declare const lispLanguage: LRLanguage;
15
+ /**
16
+ Autocompletion for the special forms the grammar recognises.
17
+ */
18
+ declare const lispCompletion: CompletionSource;
19
+ /**
20
+ Lisp language support, with completion for the special forms and for the
21
+ names declared in the file. Serves
22
+ Common Lisp, Scheme, Racket, Emacs Lisp and the smaller dialects that
23
+ share their reader.
24
+ */
25
+ declare function lisp(): LanguageSupport;
26
+
27
+ /**
28
+ Every name declared in the file that is visible at `pos`: names given by
29
+ `defun`, `defvar` and the like anywhere in the file, and names bound by
30
+ `let`, parameter lists and the other binding forms around `pos`. The name
31
+ under the cursor itself is left out.
32
+ */
33
+ declare function declaredNames(state: EditorState, pos: number): Map<string, Completion>;
34
+ /**
35
+ Completes the names declared in the file that are in scope at the cursor.
36
+ */
37
+ declare function localCompletionSource(context: CompletionContext): CompletionResult | null;
38
+
39
+ /**
40
+ Completes the standard Common Lisp symbols (special operators, macros,
41
+ functions, variables and constants) and snippets for the common forms.
42
+ */
43
+ declare const commonLispBuiltins: CompletionSource;
44
+ /**
45
+ Completes the names declared in the file that are in scope at the cursor.
46
+ On top of the names the grammar marks, it offers the functions written by
47
+ `defstruct`, the accessors named in `defclass`, and `loop` variables.
48
+ */
49
+ declare const commonLispLocals: CompletionSource;
50
+ /**
51
+ Every Common Lisp completion source: the standard symbols, snippets, and
52
+ the names declared in the file.
53
+ */
54
+ declare const commonLispCompletion: readonly CompletionSource[];
55
+ /**
56
+ Common Lisp language support: the shared Lisp grammar with completion for
57
+ Common Lisp.
58
+ */
59
+ declare function commonLisp(): _codemirror_language.LanguageSupport;
60
+
61
+ /**
62
+ Completes the built-in Emacs Lisp special forms, macros, functions and
63
+ variables, and snippets for the common forms.
64
+ */
65
+ declare const emacsLispBuiltins: CompletionSource;
66
+ /**
67
+ Completes the names declared in the file that are in scope at the cursor.
68
+ On top of the names the grammar marks, it offers the functions written by
69
+ `cl-defstruct`, functions named by `defalias`, `cl-loop` variables and
70
+ the error variable of `condition-case`.
71
+ */
72
+ declare const emacsLispLocals: CompletionSource;
73
+ /**
74
+ Every Emacs Lisp completion source: the built-ins, snippets, and the names
75
+ declared in the file.
76
+ */
77
+ declare const emacsLispCompletion: readonly CompletionSource[];
78
+ /**
79
+ Emacs Lisp language support: the shared Lisp grammar with completion for
80
+ Emacs Lisp.
81
+ */
82
+ declare function emacsLisp(): _codemirror_language.LanguageSupport;
83
+
84
+ /**
85
+ The shared Lisp language with the grammar's `lfe` dialect turned on.
86
+ */
87
+ declare const lfeLanguage: _codemirror_language.LRLanguage;
88
+ /**
89
+ Completes LFE's core forms and macros, the Erlang BIFs and operators, the
90
+ common module names, and snippets for the common forms.
91
+ */
92
+ declare const lfeBuiltins: CompletionSource;
93
+ /**
94
+ Completes the functions of an Erlang module, after `lists:` in
95
+ `(lists:foldl ...)` and after the module name in `(: lists foldl ...)`.
96
+ */
97
+ declare const lfeModuleFunctions: CompletionSource;
98
+ /**
99
+ The variables a pattern binds. A bare name binds itself, apart from `_`. In
100
+ a list the head is a constructor, such as `cons` or `tuple`, or a record
101
+ matcher such as `match-person`, and the rest are patterns. In a
102
+ backquoted pattern only the names after `,` bind.
103
+ */
104
+ declare function patternNames(state: EditorState, node: SyntaxNode, out: string[], quasi?: boolean): void;
105
+ /**
106
+ Completes the names declared in the file that are in scope at the cursor.
107
+ On top of the names the grammar marks, it offers the variables bound by
108
+ patterns in clauses, `case`, `receive`, `try`, `let` and comprehensions,
109
+ and the functions written by `defrecord`.
110
+ */
111
+ declare const lfeLocals: CompletionSource;
112
+ /**
113
+ Every LFE completion source: the built-ins, the functions of Erlang
114
+ modules, snippets, and the names declared in the file.
115
+ */
116
+ declare const lfeCompletion: readonly CompletionSource[];
117
+ /**
118
+ Lisp Flavoured Erlang language support: the shared Lisp grammar in its
119
+ `lfe` dialect, with completion for LFE.
120
+ */
121
+ declare function lfe(): _codemirror_language.LanguageSupport;
122
+
123
+ export { commonLisp, commonLispBuiltins, commonLispCompletion, commonLispLocals, declaredNames, emacsLisp, emacsLispBuiltins, emacsLispCompletion, emacsLispLocals, lfe, lfeBuiltins, lfeCompletion, lfeLanguage, lfeLocals, lfeModuleFunctions, lisp, lispCompletion, lispLanguage, localCompletionSource, parser, patternNames };