Skip to content

Commit 0f616e1

Browse files
authored
Merge pull request #2715 from codefori/feature/libListReorg
Enable drag and drop support in library list view
2 parents 24055b2 + 1280e21 commit 0f616e1

File tree

6 files changed

+325
-235
lines changed

6 files changed

+325
-235
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2594,7 +2594,7 @@
25942594
},
25952595
{
25962596
"command": "code-for-ibmi.setCurrentLibrary",
2597-
"when": "view == libraryListView && viewItem == library",
2597+
"when": "view == libraryListView && viewItem == library && !listMultiSelection",
25982598
"group": "01libraryActions@01"
25992599
},
26002600
{

src/api/types.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,19 @@ export type IBMiMessages = {
155155
messages: IBMiMessage[]
156156
findId(id: string): IBMiMessage | undefined
157157
}
158+
158159
export const OBJECT_BROWSER_MIMETYPE = "application/vnd.code.tree.objectbrowser";
159160
export const IFS_BROWSER_MIMETYPE = "application/vnd.code.tree.ifsbrowser";
161+
export const LIBRARY_LIST_MIMETYPE = "application/vnd.code.tree.libraryListView";
162+
export const URI_LIST_MIMETYPE = "text/uri-list";
163+
export const URI_LIST_SEPARATOR = "\r\n";
164+
165+
export type ObjectBrowserDrag = {
166+
library: string
167+
object: string
168+
type: string
169+
member?: string
170+
}
160171

161172
export interface WrapResult {
162173
newStatements: string[];

src/extension.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// The module 'vscode' contains the VS Code extensibility API
2-
import { ExtensionContext, commands, languages, window, workspace } from "vscode";
2+
import { commands, ExtensionContext, languages, window, workspace } from "vscode";
33

44
// this method is called when your extension is activated
55
// your extension is activated the very first time the command is executed
@@ -12,6 +12,7 @@ import { GetMemberInfo } from "./api/components/getMemberInfo";
1212
import { GetNewLibl } from "./api/components/getNewLibl";
1313
import { extensionComponentRegistry } from "./api/components/manager";
1414
import { parseErrors } from "./api/errors/parser";
15+
import { CustomCLI } from "./api/tests/components/customCli";
1516
import { onCodeForIBMiConfigurationChange } from "./config/Configuration";
1617
import * as Debug from './debug';
1718
import { IFSFS } from "./filesystems/ifsFs";
@@ -24,7 +25,7 @@ import { CodeForIBMi } from "./typings";
2425
import { VscodeTools } from "./ui/Tools";
2526
import { registerActionTools } from "./ui/actions";
2627
import { initializeConnectionBrowser } from "./ui/views/ConnectionBrowser";
27-
import { LibraryListProvider } from "./ui/views/LibraryListView";
28+
import { initializeLibraryListView } from "./ui/views/LibraryListView";
2829
import { ProfilesView } from "./ui/views/ProfilesView";
2930
import { initializeDebugBrowser } from "./ui/views/debugView";
3031
import { HelpView } from "./ui/views/helpView";
@@ -36,7 +37,6 @@ import { openURIHandler } from "./uri/handlers/open";
3637
import { initializeSandbox, sandboxURIHandler } from "./uri/handlers/sandbox";
3738
import { CustomUI } from "./webviews/CustomUI";
3839
import { SettingsUI } from "./webviews/settings";
39-
import { CustomCLI } from "./api/tests/components/customCli";
4040

4141
export async function activate(context: ExtensionContext): Promise<CodeForIBMi> {
4242
// Use the console to output diagnostic information (console.log) and errors (console.error)
@@ -60,16 +60,13 @@ export async function activate(context: ExtensionContext): Promise<CodeForIBMi>
6060
initializeIFSBrowser(context);
6161
initializeDebugBrowser(context);
6262
initializeSearchView(context);
63+
initializeLibraryListView(context);
6364

6465
context.subscriptions.push(
6566
window.registerTreeDataProvider(
6667
`helpView`,
6768
new HelpView(context)
6869
),
69-
window.registerTreeDataProvider(
70-
`libraryListView`,
71-
new LibraryListProvider(context)
72-
),
7370
window.registerTreeDataProvider(
7471
`profilesView`,
7572
new ProfilesView(context)

0 commit comments

Comments
 (0)