/// <summary> /// A request to resolve the defintion location of a symbol at a given text /// document position.The request's parameter is of type [TextDocumentPosition] /// (#TextDocumentPosition) the response is of type [Definition](#Definition) or a /// Thenable that resolves to such. /// </summary> public virtual Definition OnDefinition(TextDocumentPosition parameters) { throw new ArgumentException("No definition"); }
/// <summary> /// Request to resolve a [DocumentHighlight](#DocumentHighlight) for a given /// text document position.The request's parameter is of type [TextDocumentPosition] /// (#TextDocumentPosition) the request reponse is of type [DocumentHighlight[]] /// (#DocumentHighlight) or a Thenable that resolves to such. /// </summary> public virtual List <DocumentHighlight> OnDocumentHighlight(TextDocumentPosition parameters) { return(null); }
/// <summary> /// Request to request hover information at a given text document position. The request's /// parameter is of type[TextDocumentPosition](#TextDocumentPosition) the response is of /// type[Hover](#Hover) or a Thenable that resolves to such. /// </summary> public virtual Hover OnHover(TextDocumentPosition parameters) { return(null); }
/// <summary> /// Request to request completion at a given text document position. The request's /// parameter is of type[TextDocumentPosition](#TextDocumentPosition) the response /// is of type[CompletionItem[]](#CompletionItem) or a Thenable that resolves to such. /// </summary> public virtual List <CompletionItem> OnCompletion(TextDocumentPosition parameters) { return(null); }
/// <summary> /// A request to resolve the defintion location of a symbol at a given text /// document position.The request's parameter is of type [TextDocumentPosition] /// (#TextDocumentPosition) the response is of type [Definition](#Definition) or a /// Thenable that resolves to such. /// </summary> public virtual Definition OnDefinition(TextDocumentPosition parameters) { return(null); }
/// <summary> /// Signature help represents the signature of something /// callable. There can be multiple signature but only one /// active and only one active parameter. /// </summary> public virtual SignatureHelp OnSignatureHelp(TextDocumentPosition parameters) { return(null); }
// -- Tooltip information on hover -- public override Hover OnHover(TextDocumentPosition parameters) { Uri objUri = new Uri(parameters.uri); if (objUri.IsFile) { // Get compilation info for the current file string fileName = Path.GetFileName(objUri.LocalPath); var fileCompiler = typeCobolWorkspace.OpenedFileCompilers[fileName]; // Find the token located below the mouse pointer var tokensLine = fileCompiler.CompilationResultsForProgram.ProcessedTokensDocumentSnapshot.Lines[parameters.position.line]; var hoveredToken = tokensLine.TokensWithCompilerDirectives.First(token => token.StartIndex <= parameters.position.character && token.StopIndex >= parameters.position.character); // Return a text describing this token if (hoveredToken != null) { string tokenDescription = hoveredToken.TokenFamily.ToString() + " - " + hoveredToken.TokenType.ToString(); return new Hover() { range = new Range(parameters.position.line, hoveredToken.StartIndex, parameters.position.line, hoveredToken.StopIndex + 1), contents = new MarkedString[] { new MarkedString() { language="Cobol", value=tokenDescription } } }; } } return null; }
/// <summary> /// Request to request hover information at a given text document position. The request's /// parameter is of type[TextDocumentPosition](#TextDocumentPosition) the response is of /// type[Hover](#Hover) or a Thenable that resolves to such. /// </summary> public virtual Hover OnHover(TextDocumentPosition parameters) { return null; }
/// <summary> /// Request to resolve a [DocumentHighlight](#DocumentHighlight) for a given /// text document position.The request's parameter is of type [TextDocumentPosition] /// (#TextDocumentPosition) the request reponse is of type [DocumentHighlight[]] /// (#DocumentHighlight) or a Thenable that resolves to such. /// </summary> public virtual List<DocumentHighlight> OnDocumentHighlight(TextDocumentPosition parameters) { return null; }
/// <summary> /// A request to resolve the defintion location of a symbol at a given text /// document position.The request's parameter is of type [TextDocumentPosition] /// (#TextDocumentPosition) the response is of type [Definition](#Definition) or a /// Thenable that resolves to such. /// </summary> public virtual Definition OnDefinition(TextDocumentPosition parameters) { return null; }
/// <summary> /// Request to request completion at a given text document position. The request's /// parameter is of type[TextDocumentPosition](#TextDocumentPosition) the response /// is of type[CompletionItem[]](#CompletionItem) or a Thenable that resolves to such. /// </summary> public virtual List<CompletionItem> OnCompletion(TextDocumentPosition parameters) { return null; }