1 /* 2 *Copyright (C) 2018 Laurent Tréguier 3 * 4 *This file is part of DLS. 5 * 6 *DLS is free software: you can redistribute it and/or modify 7 *it under the terms of the GNU General Public License as published by 8 *the Free Software Foundation, either version 3 of the License, or 9 *(at your option) any later version. 10 * 11 *DLS is distributed in the hope that it will be useful, 12 *but WITHOUT ANY WARRANTY; without even the implied warranty of 13 *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 *GNU General Public License for more details. 15 * 16 *You should have received a copy of the GNU General Public License 17 *along with DLS. If not, see <http://www.gnu.org/licenses/>. 18 * 19 */ 20 21 module dls.protocol.interfaces.workspace; 22 23 import dls.protocol.interfaces.client : RegistrationOptionsBase; 24 25 class WorkspaceFolder 26 { 27 string uri; 28 string name; 29 } 30 31 class DidChangeWorkspaceFoldersParams 32 { 33 WorkspaceFoldersChangeEvent event; 34 } 35 36 class WorkspaceFoldersChangeEvent 37 { 38 WorkspaceFolder[] added; 39 WorkspaceFolder[] removed; 40 } 41 42 class DidChangeConfigurationParams 43 { 44 import std.json : JSONValue; 45 46 JSONValue settings; 47 } 48 49 class ConfigurationParams 50 { 51 ConfigurationItem[] items; 52 53 this(ConfigurationItem[] items = ConfigurationItem[].init) 54 { 55 this.items = items; 56 } 57 } 58 59 class ConfigurationItem 60 { 61 import std.typecons : Nullable; 62 63 Nullable!string scopeUri; 64 Nullable!string section; 65 66 this(Nullable!string scopeUri = Nullable!string.init, 67 Nullable!string section = Nullable!string.init) 68 { 69 this.scopeUri = scopeUri; 70 this.section = section; 71 } 72 } 73 74 class DidChangeWatchedFilesParams 75 { 76 FileEvent[] changes; 77 } 78 79 class FileEvent 80 { 81 import dls.protocol.definitions : DocumentUri; 82 83 DocumentUri uri; 84 FileChangeType type; 85 } 86 87 enum FileChangeType : uint 88 { 89 created = 1, 90 changed = 2, 91 deleted = 3 92 } 93 94 class DidChangeWatchedFilesRegistrationOptions : RegistrationOptionsBase 95 { 96 FileSystemWatcher[] watchers; 97 98 this(FileSystemWatcher[] watchers = FileSystemWatcher[].init) 99 { 100 this.watchers = watchers; 101 } 102 } 103 104 class FileSystemWatcher 105 { 106 import std.typecons : Nullable; 107 108 string globPattern; 109 Nullable!WatchKind kind; 110 111 this(string globPattern = string.init, Nullable!WatchKind kind = Nullable!WatchKind.init) 112 { 113 this.globPattern = globPattern; 114 this.kind = kind; 115 } 116 } 117 118 enum WatchKind : uint 119 { 120 create = 1, 121 change = 2, 122 delete_ = 4 123 } 124 125 class WorkspaceSymbolParams 126 { 127 string query; 128 } 129 130 class ExecuteCommandParams 131 { 132 import std.json : JSONValue; 133 import std.typecons : Nullable; 134 135 string command; 136 Nullable!(JSONValue[]) arguments; 137 } 138 139 class ExecuteCommandRegistrationOptions : RegistrationOptionsBase 140 { 141 string[] commands; 142 143 this(string[] commands = string[].init) 144 { 145 this.commands = commands; 146 } 147 } 148 149 class ApplyWorkspaceEditParams 150 { 151 import dls.protocol.definitions : WorkspaceEdit; 152 153 WorkspaceEdit edit; 154 155 this(WorkspaceEdit edit = WorkspaceEdit.init) 156 { 157 this.edit = edit; 158 } 159 } 160 161 class ApplyWorkspaceEditResponse 162 { 163 bool applied; 164 }