public override FormattingOptions GetOptions(LSPDocumentSnapshot documentSnapshot) { _indentationManagerService.GetIndentation(documentSnapshot.Snapshot.TextBuffer, explicitFormat: false, out var insertSpaces, out var tabSize, out _); var formattingOptions = new FormattingOptions() { InsertSpaces = insertSpaces, TabSize = tabSize, }; return(formattingOptions); }
public LSPDocumentChangeEventArgs( LSPDocumentSnapshot old, LSPDocumentSnapshot @new, VirtualDocumentSnapshot virtualOld, VirtualDocumentSnapshot virtualNew, LSPDocumentChangeKind kind) { Old = old; New = @new; VirtualOld = virtualOld; VirtualNew = virtualNew; Kind = kind; }
public static bool TryGetDocument(this LSPDocumentManager documentManager, string filePath, out LSPDocumentSnapshot lspDocumentSnapshot) { if (documentManager is null) { throw new ArgumentNullException(nameof(documentManager)); } if (filePath is null) { throw new ArgumentNullException(nameof(filePath)); } if (filePath.StartsWith("/", StringComparison.Ordinal) && RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { filePath = filePath.Substring(1); } var uri = new Uri(filePath, UriKind.Absolute); return(documentManager.TryGetDocument(uri, out lspDocumentSnapshot)); }
public void AddDocument(Uri uri, LSPDocumentSnapshot documentSnapshot) { _documents.Add(uri, documentSnapshot); }
public abstract FormattingOptions GetOptions(LSPDocumentSnapshot documentSnapshot);
public LSPDocumentChangeEventArgs(LSPDocumentSnapshot old, LSPDocumentSnapshot @new, LSPDocumentChangeKind kind) : this(old, @new, virtualOld : null, virtualNew : null, kind) { }