コード例 #1
0
        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);
        }
コード例 #2
0
 public LSPDocumentChangeEventArgs(
     LSPDocumentSnapshot old,
     LSPDocumentSnapshot @new,
     VirtualDocumentSnapshot virtualOld,
     VirtualDocumentSnapshot virtualNew,
     LSPDocumentChangeKind kind)
 {
     Old        = old;
     New        = @new;
     VirtualOld = virtualOld;
     VirtualNew = virtualNew;
     Kind       = kind;
 }
コード例 #3
0
        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));
        }
コード例 #4
0
 public void AddDocument(Uri uri, LSPDocumentSnapshot documentSnapshot)
 {
     _documents.Add(uri, documentSnapshot);
 }
コード例 #5
0
 public abstract FormattingOptions GetOptions(LSPDocumentSnapshot documentSnapshot);
コード例 #6
0
 public LSPDocumentChangeEventArgs(LSPDocumentSnapshot old, LSPDocumentSnapshot @new, LSPDocumentChangeKind kind)
     : this(old, @new, virtualOld : null, virtualNew : null, kind)
 {
 }