diff options
author | Georgie <george@fivetran.com> | 2016-03-12 19:07:17 -0800 |
---|---|---|
committer | Georgie <george@fivetran.com> | 2016-03-12 19:07:17 -0800 |
commit | 91958bb33589ac7bb986173183a86c030ecd2e79 (patch) | |
tree | f81d842d99e7b6de1fae0db4fb06aff39c087f60 /lib/JavacServices.ts | |
parent | dd17035948a480ecfa4adb0cada52f4dc41ea760 (diff) | |
download | java-language-server-91958bb33589ac7bb986173183a86c030ecd2e79.zip |
Align wire format with vscode
Diffstat (limited to 'lib/JavacServices.ts')
-rw-r--r-- | lib/JavacServices.ts | 113 |
1 files changed, 92 insertions, 21 deletions
diff --git a/lib/JavacServices.ts b/lib/JavacServices.ts index 6ed661b..2a3b93f 100644 --- a/lib/JavacServices.ts +++ b/lib/JavacServices.ts @@ -5,6 +5,7 @@ import PortFinder = require('portfinder'); import Net = require('net'); import * as Maven from './Maven'; import {MavenDependency} from './JavaConfig'; +import * as V from 'vscode'; export function provideJavac(classpath: string[], mavenDependencies: MavenDependency[] = []): Promise<JavacServices> { return new Promise((resolve, reject) => { @@ -45,42 +46,112 @@ export interface RequestLint extends JavacOptions { } export interface RequestAutocomplete extends JavacOptions { - row: number; - column: number; + position: Position; } export interface ResponseLint { messages: LintMessage[]; } +export interface Range { + /** + * The start position. It is before or equal to [end](#Range.end). + * @readonly + */ + start: Position; + + /** + * The end position. It is after or equal to [start](#Range.start). + * @readonly + */ + end: Position; +} + export interface Position { - row: number; - column: number; + /** + * The zero-based line value. + * @readonly + */ + line: number; + + /** + * The zero-based character value. + * @readonly + */ + character: number; } export interface LintMessage { - type: string; + uri: string; + + /** + * The range to which this diagnostic applies. + */ + range: Range; + + /** + * The human-readable message. + */ message: string; - range: { - start: Position; - end: Position; - } + + /** + * A human-readable string describing the source of this + * diagnostic, e.g. 'typescript' or 'super lint'. + */ + source: string; + + /** + * The severity, default is [error](#DiagnosticSeverity.Error). + */ + severity: V.DiagnosticSeverity; } /** The suggestion */ export interface AutocompleteSuggestion { - //Either text or snippet is required - - text: string; - snippet: string; - type: string; - - replacementPrefix?: string; - - rightLabel?: string; - rightLabelHTML?: string; - leftLabel?: string; - description?: string; + /** + * The label of this completion item. By default + * this is also the text that is inserted when selecting + * this completion. + */ + label: string; + + /** + * The kind of this completion item. Based on the kind + * an icon is chosen by the editor. + */ + kind: V.CompletionItemKind; + + /** + * A human-readable string with additional information + * about this item, like type or symbol information. + */ + detail: string; + + /** + * A human-readable string that represents a doc-comment. + */ + documentation: string; + + /** + * A string that should be used when comparing this item + * with other items. When `falsy` the [label](#CompletionItem.label) + * is used. + */ + sortText: string; + + /** + * A string that should be used when filtering a set of + * completion items. When `falsy` the [label](#CompletionItem.label) + * is used. + */ + filterText: string; + + /** + * A string that should be inserted in a document when selecting + * this completion. When `falsy` the [label](#CompletionItem.label) + * is used. + */ + insertText: string; } export interface ResponseAutocomplete { |