forked from LeenkxTeam/LNXSDK
Update
This commit is contained in:
79
Kha/Tools/windows_x64/std/haxe/display/Diagnostic.hx
Normal file
79
Kha/Tools/windows_x64/std/haxe/display/Diagnostic.hx
Normal file
@ -0,0 +1,79 @@
|
||||
// from vshaxe
|
||||
package haxe.display;
|
||||
|
||||
import haxe.display.Position.Location;
|
||||
import haxe.display.Position.Range;
|
||||
import haxe.display.JsonModuleTypes;
|
||||
|
||||
enum abstract UnresolvedIdentifierSuggestion(Int) {
|
||||
var UISImport;
|
||||
var UISTypo;
|
||||
}
|
||||
|
||||
enum abstract MissingFieldCauseKind<T>(String) {
|
||||
final AbstractParent:MissingFieldCauseKind<{parent:JsonTypePathWithParams}>;
|
||||
final ImplementedInterface:MissingFieldCauseKind<{parent:JsonTypePathWithParams}>;
|
||||
final PropertyAccessor:MissingFieldCauseKind<{property:JsonClassField, isGetter:Bool}>;
|
||||
final FieldAccess:MissingFieldCauseKind<{}>;
|
||||
final FinalFields:MissingFieldCauseKind<{fields:Array<JsonClassField>}>;
|
||||
}
|
||||
|
||||
typedef MissingFieldCause<T> = {
|
||||
var kind:MissingFieldCauseKind<T>;
|
||||
var args:T;
|
||||
}
|
||||
|
||||
typedef MissingField = {
|
||||
var field:JsonClassField;
|
||||
var type:JsonType<Dynamic>;
|
||||
|
||||
/**
|
||||
When implementing multiple interfaces, there can be field duplicates among them. This flag is only
|
||||
true for the first such occurrence of a field, so that the "Implement all" code action doesn't end
|
||||
up implementing the same field multiple times.
|
||||
**/
|
||||
var unique:Bool;
|
||||
}
|
||||
|
||||
typedef MissingFieldDiagnostic = {
|
||||
var fields:Array<MissingField>;
|
||||
var cause:MissingFieldCause<Dynamic>;
|
||||
}
|
||||
|
||||
typedef MissingFieldDiagnostics = {
|
||||
var moduleType:JsonModuleType<Dynamic>;
|
||||
var moduleFile:String;
|
||||
var entries:Array<MissingFieldDiagnostic>;
|
||||
}
|
||||
|
||||
enum abstract DiagnosticKind<T>(Int) from Int to Int {
|
||||
final DKUnusedImport:DiagnosticKind<Void>;
|
||||
final DKUnresolvedIdentifier:DiagnosticKind<Array<{kind:UnresolvedIdentifierSuggestion, name:String}>>;
|
||||
final DKCompilerError:DiagnosticKind<String>;
|
||||
final DKRemovableCode:DiagnosticKind<{description:String, range:Range}>;
|
||||
final DKParserError:DiagnosticKind<String>;
|
||||
final DeprecationWarning:DiagnosticKind<String>;
|
||||
final InactiveBlock:DiagnosticKind<Void>;
|
||||
final MissingFields:DiagnosticKind<MissingFieldDiagnostics>;
|
||||
}
|
||||
|
||||
enum abstract DiagnosticSeverity(Int) {
|
||||
var Error = 1;
|
||||
var Warning;
|
||||
var Information;
|
||||
var Hint;
|
||||
}
|
||||
|
||||
typedef Diagnostic<T> = {
|
||||
var kind:DiagnosticKind<T>;
|
||||
var range:Range;
|
||||
var severity:DiagnosticSeverity;
|
||||
var args:T;
|
||||
var relatedInformation:Array<DiagnosticRelatedInformation>;
|
||||
}
|
||||
|
||||
typedef DiagnosticRelatedInformation = {
|
||||
var location:Location;
|
||||
var message:String;
|
||||
var depth:Int;
|
||||
}
|
||||
@ -25,6 +25,7 @@ package haxe.display;
|
||||
import haxe.display.JsonModuleTypes;
|
||||
import haxe.display.Position;
|
||||
import haxe.display.Protocol;
|
||||
import haxe.ds.ReadOnlyArray;
|
||||
|
||||
/**
|
||||
Methods of the JSON-RPC-based `--display` protocol in Haxe 4.
|
||||
@ -32,6 +33,12 @@ import haxe.display.Protocol;
|
||||
**/
|
||||
@:publicFields
|
||||
class DisplayMethods {
|
||||
|
||||
/**
|
||||
The request is sent from the client to Haxe to get diagnostics for a specific file, a list of files or the whole project.
|
||||
**/
|
||||
static inline var Diagnostics = new HaxeRequestMethod<DiagnosticsParams, DiagnosticsResult>("display/diagnostics");
|
||||
|
||||
/**
|
||||
The completion request is sent from the client to Haxe to request code completion.
|
||||
Haxe automatically determines the type of completion to use based on the passed position, see `CompletionResultKind`.
|
||||
@ -78,11 +85,20 @@ class DisplayMethods {
|
||||
**/
|
||||
static inline var SignatureHelp = new HaxeRequestMethod<SignatureHelpParams, SignatureHelpResult>("display/signatureHelp");
|
||||
|
||||
/**
|
||||
The metadata request is sent from the client to Haxe to get a list of all registered metadata and their documentation.
|
||||
**/
|
||||
static inline var Metadata = new HaxeRequestMethod<MetadataParams, MetadataResult>("display/metadata");
|
||||
|
||||
/**
|
||||
The defines request is sent from the client to Haxe to get a list of all registered defines and their documentation.
|
||||
**/
|
||||
static inline var Defines = new HaxeRequestMethod<DefinesParams, DefinesResult>("display/defines");
|
||||
|
||||
/*
|
||||
TODO:
|
||||
|
||||
- finish completion
|
||||
- diagnostics
|
||||
- codeLens
|
||||
- workspaceSymbols ("project/symbol"?)
|
||||
*/
|
||||
@ -295,6 +311,7 @@ typedef Metadata = {
|
||||
var platforms:Array<Platform>;
|
||||
var targets:Array<MetadataTarget>;
|
||||
var internal:Bool;
|
||||
var ?origin:String;
|
||||
var ?links:Array<String>;
|
||||
}
|
||||
|
||||
@ -305,6 +322,8 @@ typedef Define = {
|
||||
var parameters:Array<String>;
|
||||
var platforms:Array<Platform>;
|
||||
var links:Array<String>;
|
||||
var ?origin:String;
|
||||
var ?deprecated:String;
|
||||
}
|
||||
|
||||
typedef Keyword = {
|
||||
@ -425,6 +444,17 @@ typedef PatternCompletion<T> = ToplevelCompletion<T> & {
|
||||
var isOutermostPattern:Bool;
|
||||
}
|
||||
|
||||
typedef DiagnosticsParams = {
|
||||
var ?file:FsPath;
|
||||
var ?contents:String;
|
||||
var ?fileContents:Array<{file:FsPath, ?contents:String}>;
|
||||
}
|
||||
|
||||
typedef DiagnosticsResult = Response<ReadOnlyArray<{
|
||||
var file:FsPath;
|
||||
var diagnostics:ReadOnlyArray<Diagnostic<Any>>;
|
||||
}>>
|
||||
|
||||
enum abstract CompletionModeKind<T>(Int) {
|
||||
var Field:CompletionModeKind<FieldCompletionSubject<Dynamic>>;
|
||||
var StructureField;
|
||||
@ -542,6 +572,20 @@ typedef SignatureItem = {
|
||||
|
||||
typedef SignatureHelpResult = Response<Null<SignatureItem>>;
|
||||
|
||||
typedef MetadataParams = {
|
||||
var compiler:Bool;
|
||||
var user:Bool;
|
||||
}
|
||||
|
||||
typedef MetadataResult = Response<Array<Metadata>>;
|
||||
|
||||
typedef DefinesParams = {
|
||||
var compiler:Bool;
|
||||
var user:Bool;
|
||||
}
|
||||
|
||||
typedef DefinesResult = Response<Array<Define>>;
|
||||
|
||||
/** General types **/
|
||||
typedef PositionParams = FileParams & {
|
||||
/** Unicode character offset in the file. **/
|
||||
|
||||
@ -163,6 +163,7 @@ enum abstract JsonBinopKind<T>(String) {
|
||||
var OpInterval;
|
||||
var OpArrow;
|
||||
var OpIn;
|
||||
var OpNullCoal;
|
||||
}
|
||||
|
||||
typedef JsonBinop<T> = {
|
||||
|
||||
@ -41,6 +41,7 @@ class ServerMethods {
|
||||
static inline var ModuleMemory = new HaxeRequestMethod<ModuleParams, Response<HaxeModuleMemoryResult>>("server/memory/module");
|
||||
static inline var Modules = new HaxeRequestMethod<ContextParams, Response<Array<String>>>("server/modules");
|
||||
static inline var Module = new HaxeRequestMethod<ModuleParams, Response<JsonModule>>("server/module");
|
||||
static inline var Type = new HaxeRequestMethod<TypeParams, Response<JsonModuleType<Any>>>("server/type");
|
||||
static inline var Files = new HaxeRequestMethod<ContextParams, Response<Array<JsonServerFile>>>("server/files");
|
||||
static inline var ModuleCreated = new HaxeRequestMethod<FileParams, Response<NoData>>("server/moduleCreated");
|
||||
}
|
||||
@ -97,7 +98,9 @@ typedef JsonModule = {
|
||||
final types:Array<JsonTypePath>;
|
||||
final file:String;
|
||||
final sign:String;
|
||||
final dirty:Null<String>;
|
||||
final dependencies:Array<ModuleId>;
|
||||
final dependents:Array<ModuleId>;
|
||||
}
|
||||
|
||||
typedef JsonServerFile = {
|
||||
@ -108,7 +111,6 @@ typedef JsonServerFile = {
|
||||
}
|
||||
|
||||
/* Memory */
|
||||
|
||||
typedef HaxeMemoryResult = {
|
||||
final contexts:Array<{
|
||||
final context:HaxeServerContext;
|
||||
@ -165,3 +167,8 @@ typedef ContextParams = {
|
||||
typedef ModuleParams = ContextParams & {
|
||||
final path:String;
|
||||
}
|
||||
|
||||
typedef TypeParams = ContextParams & {
|
||||
final modulePath:String;
|
||||
final typeName:String;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user