@redocly/openapi-language-server 0.0.3
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 +3 -0
- package/README.md +14 -0
- package/lib/config.d.ts +28 -0
- package/lib/index.d.ts +13 -0
- package/lib/index.js +80 -0
- package/lib/server/bundle.d.ts +18 -0
- package/lib/server/completion/yaml/KeyCompletion.d.ts +17 -0
- package/lib/server/completion/yaml/LocalFileCompletion.d.ts +4 -0
- package/lib/server/completion/yaml/LocalFolderCompletion.d.ts +6 -0
- package/lib/server/completion/yaml/ValueCompletion.d.ts +23 -0
- package/lib/server/completion/yaml/common.d.ts +7 -0
- package/lib/server/completion/yaml/completion.d.ts +9 -0
- package/lib/server/completion/yaml/context.d.ts +25 -0
- package/lib/server/completion/yaml/insert-snippet-utils.d.ts +15 -0
- package/lib/server/completion/yaml/paths.d.ts +26 -0
- package/lib/server/context-core.d.ts +20 -0
- package/lib/server/documents.d.ts +16 -0
- package/lib/server/external-resolver.d.ts +5 -0
- package/lib/server/hints.d.ts +7 -0
- package/lib/server/openapi-config.d.ts +7 -0
- package/lib/server/openapi-extensions.d.ts +76 -0
- package/lib/server/path.d.ts +8 -0
- package/lib/server/sort.d.ts +43 -0
- package/lib/server/types/completion.d.ts +16 -0
- package/lib/server/types/context-core.d.ts +42 -0
- package/lib/server/utils.d.ts +16 -0
- package/lib/server/validation/index.d.ts +7 -0
- package/package.json +41 -0
package/LICENSE
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Redocly OpenAPI language server
|
|
2
|
+
|
|
3
|
+
Currently, @redocly/openapi-language-server supports these features:
|
|
4
|
+
|
|
5
|
+
- [x] Autocompletion for `yaml` files
|
|
6
|
+
- [x] Validation of `yaml` and `json` files
|
|
7
|
+
|
|
8
|
+
TBD:
|
|
9
|
+
|
|
10
|
+
- Go to definition
|
|
11
|
+
|
|
12
|
+
## Documentation
|
|
13
|
+
|
|
14
|
+
See documentation in the [docs folder](docs).
|
package/lib/config.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TextDocuments } from 'vscode-languageserver/browser';
|
|
2
|
+
import { TextDocument } from 'vscode-languageserver-textdocument';
|
|
3
|
+
import { URI } from 'vscode-uri';
|
|
4
|
+
export interface SupportedLanguage {
|
|
5
|
+
languageId: string;
|
|
6
|
+
filePattern: RegExp;
|
|
7
|
+
}
|
|
8
|
+
export declare const yamlLanguage: SupportedLanguage;
|
|
9
|
+
export declare const jsonLanguage: SupportedLanguage;
|
|
10
|
+
export interface FileSystemProvider {
|
|
11
|
+
readFile(uri: URI, encoding?: string): Promise<string>;
|
|
12
|
+
readDir(uri: URI): Promise<any>;
|
|
13
|
+
stat(uri: URI): Promise<{
|
|
14
|
+
isFile(): boolean;
|
|
15
|
+
isDirectory(): boolean;
|
|
16
|
+
}>;
|
|
17
|
+
exists(uri: URI): Promise<boolean>;
|
|
18
|
+
}
|
|
19
|
+
export declare class Configuration {
|
|
20
|
+
private _fs;
|
|
21
|
+
private _documentManager;
|
|
22
|
+
supportedLanguages: SupportedLanguage[];
|
|
23
|
+
registerFileSystemProvider(fsProvider: FileSystemProvider): void;
|
|
24
|
+
registerDocumentsProvider(documentProvider: TextDocuments<TextDocument>): void;
|
|
25
|
+
get fs(): FileSystemProvider;
|
|
26
|
+
get documents(): TextDocuments<TextDocument>;
|
|
27
|
+
}
|
|
28
|
+
export declare const config: Configuration;
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CompletionItem, CompletionParams, DidChangeWatchedFilesParams } from 'vscode-languageserver/browser';
|
|
2
|
+
import { isConfigFile } from './server/openapi-config';
|
|
3
|
+
import { TextDocument } from 'vscode-languageserver-textdocument';
|
|
4
|
+
import { config } from './config';
|
|
5
|
+
declare class OpenapiLanguageServer {
|
|
6
|
+
onCompletion(params: CompletionParams): Promise<CompletionItem[]>;
|
|
7
|
+
onCompletionResolve(item: CompletionItem): Promise<CompletionItem>;
|
|
8
|
+
validateOpenAPI(textDocument: TextDocument): Promise<import("vscode-languageserver/browser").PublishDiagnosticsParams[]>;
|
|
9
|
+
onDidChangeWatchedFiles(params: DidChangeWatchedFilesParams): Promise<(Promise<import("vscode-languageserver/browser").PublishDiagnosticsParams[]> | Promise<Promise<import("vscode-languageserver/browser").PublishDiagnosticsParams[]>>)[]>;
|
|
10
|
+
onDidConfigChange(): Promise<(Promise<import("vscode-languageserver/browser").PublishDiagnosticsParams[]> | Promise<Promise<import("vscode-languageserver/browser").PublishDiagnosticsParams[]>>)[]>;
|
|
11
|
+
onDidChangeConfiguration(): Promise<(Promise<import("vscode-languageserver/browser").PublishDiagnosticsParams[]> | Promise<Promise<import("vscode-languageserver/browser").PublishDiagnosticsParams[]>>)[]>;
|
|
12
|
+
}
|
|
13
|
+
export { OpenapiLanguageServer, config, isConfigFile };
|