@eihrteam/xml-lsp 0.0.0-stage → 0.1.0
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.
- package/LICENSE +201 -0
- package/README.md +47 -2
- package/dist/npm/LICENSE +201 -0
- package/dist/npm/ThirdPartyNotices.txt +384 -0
- package/dist/npm/ace-client/index.d.ts +12 -0
- package/dist/npm/ace-client/index.js +15 -0
- package/dist/npm/browser-client/index.d.ts +33 -0
- package/dist/npm/browser-client/index.js +12 -0
- package/dist/npm/cli.js +3 -0
- package/dist/npm/language-server/browser.d.ts +2 -0
- package/dist/npm/language-server/browser.js +41 -0
- package/dist/npm/language-server/index.d.ts +1 -0
- package/dist/npm/language-server/index.js +28 -0
- package/dist/npm/language-server/node-api.d.ts +2 -0
- package/dist/npm/language-server/node-api.js +43 -0
- package/dist/npm/language-server/server.d.ts +9 -0
- package/dist/npm/language-server/worker.d.ts +1 -0
- package/dist/npm/language-server/worker.js +41 -0
- package/dist/npm/language-service/content-model.d.ts +18 -0
- package/dist/npm/language-service/document.d.ts +32 -0
- package/dist/npm/language-service/edits.d.ts +14 -0
- package/dist/npm/language-service/index.d.ts +24 -0
- package/dist/npm/language-service/index.js +28 -0
- package/dist/npm/language-service/intelligence.d.ts +8 -0
- package/dist/npm/language-service/parser.d.ts +68 -0
- package/dist/npm/language-service/schema-model.d.ts +43 -0
- package/dist/npm/language-service/schema.generated.d.ts +2 -0
- package/dist/npm/language-service/validation.d.ts +9 -0
- package/dist/npm/monaco-client/index.d.ts +7 -0
- package/dist/npm/monaco-client/index.js +14 -0
- package/docs/api.md +48 -0
- package/docs/architecture.md +45 -0
- package/docs/editor-integration.md +51 -0
- package/docs/implementation.md +57 -0
- package/docs/releasing.md +30 -0
- package/package.json +128 -4
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ElementDeclaration, Particle } from './schema-model.js';
|
|
2
|
+
type State = readonly number[];
|
|
3
|
+
export declare class ContentModel {
|
|
4
|
+
private readonly graph;
|
|
5
|
+
private readonly end;
|
|
6
|
+
readonly start: State;
|
|
7
|
+
readonly members: ReadonlyMap<string, ElementDeclaration>;
|
|
8
|
+
constructor(particle?: Particle);
|
|
9
|
+
private node;
|
|
10
|
+
private connect;
|
|
11
|
+
private particle;
|
|
12
|
+
private unit;
|
|
13
|
+
private closure;
|
|
14
|
+
advance(state: State, name: string): State;
|
|
15
|
+
candidates(state: State): ElementDeclaration[];
|
|
16
|
+
accepts(state: State): boolean;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Range, type Position } from 'vscode-languageserver-types';
|
|
2
|
+
import { type Issue, type Span, type XmlElement, type XmlTree } from './parser.js';
|
|
3
|
+
export interface XmlDocument {
|
|
4
|
+
uri: string;
|
|
5
|
+
text: string;
|
|
6
|
+
version: number;
|
|
7
|
+
}
|
|
8
|
+
export type TextChange = {
|
|
9
|
+
range?: Range;
|
|
10
|
+
text: string;
|
|
11
|
+
};
|
|
12
|
+
export declare class DocumentState {
|
|
13
|
+
private readonly document;
|
|
14
|
+
private fragments;
|
|
15
|
+
private syntaxTree?;
|
|
16
|
+
private projection?;
|
|
17
|
+
private cachedElements?;
|
|
18
|
+
private cachedIssues?;
|
|
19
|
+
constructor({ uri, version, text }: XmlDocument);
|
|
20
|
+
get version(): number;
|
|
21
|
+
get text(): string;
|
|
22
|
+
get uri(): string;
|
|
23
|
+
update(version: number, changes: readonly TextChange[]): boolean;
|
|
24
|
+
get analysis(): XmlTree;
|
|
25
|
+
get elements(): XmlElement[];
|
|
26
|
+
get issues(): Issue[];
|
|
27
|
+
offset(position: Position): number;
|
|
28
|
+
position(offset: number): Position;
|
|
29
|
+
range(span: Span): Range;
|
|
30
|
+
elementAt(offset: number, inclusiveEnd?: boolean): XmlElement | undefined;
|
|
31
|
+
opaqueAt(offset: number): boolean;
|
|
32
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TextEdit, type CodeAction, type Diagnostic, type DocumentLink, type DocumentSymbol, type FoldingRange, type FormattingOptions, type Position, type Range } from 'vscode-languageserver-types';
|
|
2
|
+
import type { DocumentState } from './document.js';
|
|
3
|
+
import { type Issue } from './parser.js';
|
|
4
|
+
export declare function toDiagnostic(document: DocumentState, issue: Issue): Diagnostic;
|
|
5
|
+
export declare function formatting(document: DocumentState, options: FormattingOptions, range?: Range): TextEdit[];
|
|
6
|
+
export declare function symbols(document: DocumentState): DocumentSymbol[];
|
|
7
|
+
export declare function folding(document: DocumentState, lineOnly: boolean): FoldingRange[];
|
|
8
|
+
export interface LinkedEditingRanges {
|
|
9
|
+
ranges: Range[];
|
|
10
|
+
wordPattern?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function linkedEditing(document: DocumentState, position: Position): LinkedEditingRanges | null;
|
|
13
|
+
export declare function documentLinks(document: DocumentState): DocumentLink[];
|
|
14
|
+
export declare function codeActions(document: DocumentState, range: Range, diagnostics: readonly Diagnostic[]): CodeAction[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CodeAction, CompletionList, Diagnostic, DocumentLink, DocumentSymbol, FoldingRange, FormattingOptions, Hover, Position, Range, TextEdit } from 'vscode-languageserver-types';
|
|
2
|
+
import { type TextChange, type XmlDocument } from './document.js';
|
|
3
|
+
import { type LinkedEditingRanges } from './edits.js';
|
|
4
|
+
import { type CompletionOptions } from './intelligence.js';
|
|
5
|
+
import { schema } from './schema.generated.js';
|
|
6
|
+
export type { TextChange, XmlDocument, CompletionOptions, LinkedEditingRanges };
|
|
7
|
+
export declare const schemaInfo: Readonly<Pick<typeof schema, 'version' | 'hash' | 'source'>>;
|
|
8
|
+
export interface XmlLanguageService {
|
|
9
|
+
openDocument(document: XmlDocument): boolean;
|
|
10
|
+
updateDocument(uri: string, version: number, changes: readonly TextChange[]): boolean;
|
|
11
|
+
closeDocument(uri: string): boolean;
|
|
12
|
+
getVersion(uri: string): number | undefined;
|
|
13
|
+
diagnostics(uri: string): Diagnostic[];
|
|
14
|
+
completion(uri: string, position: Position, options?: CompletionOptions): CompletionList;
|
|
15
|
+
hover(uri: string, position: Position, options?: CompletionOptions): Hover | null;
|
|
16
|
+
formatting(uri: string, options: FormattingOptions, range?: Range): TextEdit[];
|
|
17
|
+
documentSymbols(uri: string): DocumentSymbol[];
|
|
18
|
+
foldingRanges(uri: string, lineOnly?: boolean): FoldingRange[];
|
|
19
|
+
linkedEditing(uri: string, position: Position): LinkedEditingRanges | null;
|
|
20
|
+
documentLinks(uri: string): DocumentLink[];
|
|
21
|
+
codeActions(uri: string, range: Range, diagnostics: readonly Diagnostic[]): CodeAction[];
|
|
22
|
+
dispose(): void;
|
|
23
|
+
}
|
|
24
|
+
export declare function createXmlLanguageService(): XmlLanguageService;
|