@lvce-editor/extension-host-worker 8.29.0 → 8.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extension-api/index.js +182 -9
- package/dist/extension-api/parts/ExtensionApiCommandMap/ExtensionApiCommandMap.js +24 -0
- package/dist/extension-api/parts/Preferences/Preferences.js +11 -0
- package/dist/extension-api/parts/RegisteredSourceControlProvider/RegisteredSourceControlProvider.js +0 -0
- package/dist/extension-api/parts/SourceControl/SourceControl.js +30 -0
- package/dist/extension-api/parts/SourceControlProvider/SourceControlProvider.js +0 -0
- package/dist/extension-api/parts/SourceControlProviderRegistry/SourceControlProviderRegistry.js +154 -0
- package/dist/extension-api/parts/SourceControlProviderRegistrySnapshot/SourceControlProviderRegistrySnapshot.js +0 -0
- package/dist/extensionHostWorkerMain.js +373 -0
- package/extension-api/dist/index.d.ts +3 -0
- package/extension-api/dist/index.js +2 -0
- package/extension-api/dist/parts/CommandMap/CommandMap.d.ts +11 -0
- package/extension-api/dist/parts/ExtensionApiCommandMap/ExtensionApiCommandMap.d.ts +11 -0
- package/extension-api/dist/parts/ExtensionApiCommandMap/ExtensionApiCommandMap.js +12 -0
- package/extension-api/dist/parts/ExtensionApiWorkerCommandMap/ExtensionApiWorkerCommandMap.d.ts +11 -0
- package/extension-api/dist/parts/Preferences/Preferences.d.ts +2 -0
- package/extension-api/dist/parts/Preferences/Preferences.js +7 -0
- package/extension-api/dist/parts/RegisteredSourceControlProvider/RegisteredSourceControlProvider.d.ts +13 -0
- package/extension-api/dist/parts/RegisteredSourceControlProvider/RegisteredSourceControlProvider.js +1 -0
- package/extension-api/dist/parts/SourceControl/SourceControl.d.ts +4 -0
- package/extension-api/dist/parts/SourceControl/SourceControl.js +1 -0
- package/extension-api/dist/parts/SourceControlProvider/SourceControlProvider.d.ts +13 -0
- package/extension-api/dist/parts/SourceControlProvider/SourceControlProvider.js +1 -0
- package/extension-api/dist/parts/SourceControlProviderRegistry/SourceControlProviderRegistry.d.ts +16 -0
- package/extension-api/dist/parts/SourceControlProviderRegistry/SourceControlProviderRegistry.js +139 -0
- package/extension-api/dist/parts/SourceControlProviderRegistrySnapshot/SourceControlProviderRegistrySnapshot.d.ts +5 -0
- package/extension-api/dist/parts/SourceControlProviderRegistrySnapshot/SourceControlProviderRegistrySnapshot.js +1 -0
- package/extension-api/package.json +1 -1
- package/extension-api/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -2
|
@@ -1320,6 +1320,9 @@ const create$7 = rpcId => {
|
|
|
1320
1320
|
};
|
|
1321
1321
|
};
|
|
1322
1322
|
|
|
1323
|
+
const Text = 12;
|
|
1324
|
+
const Reference = 100;
|
|
1325
|
+
|
|
1323
1326
|
const DebugWorker$1 = 55;
|
|
1324
1327
|
const ExtensionManagementWorker = 9006;
|
|
1325
1328
|
const RendererWorker$1 = 1;
|
|
@@ -3202,6 +3205,9 @@ const state$8 = {
|
|
|
3202
3205
|
const registerSourceControlProvider = provider => {
|
|
3203
3206
|
state$8.providers[provider.id] = provider;
|
|
3204
3207
|
};
|
|
3208
|
+
const getRegisteredSourceControlProviderIds$1 = () => {
|
|
3209
|
+
return Object.keys(state$8.providers);
|
|
3210
|
+
};
|
|
3205
3211
|
const getProvider$1 = providerId => {
|
|
3206
3212
|
const provider = state$8.providers[providerId];
|
|
3207
3213
|
if (!provider) {
|
|
@@ -3510,7 +3516,270 @@ const {
|
|
|
3510
3516
|
}
|
|
3511
3517
|
});
|
|
3512
3518
|
|
|
3519
|
+
const SetText = 1;
|
|
3520
|
+
const Replace = 2;
|
|
3521
|
+
const SetAttribute = 3;
|
|
3522
|
+
const RemoveAttribute = 4;
|
|
3523
|
+
const Add = 6;
|
|
3524
|
+
const NavigateChild = 7;
|
|
3525
|
+
const NavigateParent = 8;
|
|
3526
|
+
const RemoveChild = 9;
|
|
3527
|
+
const NavigateSibling = 10;
|
|
3528
|
+
const SetReferenceNodeUid = 11;
|
|
3529
|
+
|
|
3530
|
+
const isKey = key => {
|
|
3531
|
+
return key !== 'type' && key !== 'childCount';
|
|
3532
|
+
};
|
|
3533
|
+
|
|
3534
|
+
const getKeys = node => {
|
|
3535
|
+
const keys = Object.keys(node).filter(isKey);
|
|
3536
|
+
return keys;
|
|
3537
|
+
};
|
|
3538
|
+
|
|
3539
|
+
const arrayToTree = nodes => {
|
|
3540
|
+
const result = [];
|
|
3541
|
+
let i = 0;
|
|
3542
|
+
while (i < nodes.length) {
|
|
3543
|
+
const node = nodes[i];
|
|
3544
|
+
const {
|
|
3545
|
+
children,
|
|
3546
|
+
nodesConsumed
|
|
3547
|
+
} = getChildrenWithCount(nodes, i + 1, node.childCount || 0);
|
|
3548
|
+
result.push({
|
|
3549
|
+
node,
|
|
3550
|
+
children
|
|
3551
|
+
});
|
|
3552
|
+
i += 1 + nodesConsumed;
|
|
3553
|
+
}
|
|
3554
|
+
return result;
|
|
3555
|
+
};
|
|
3556
|
+
const getChildrenWithCount = (nodes, startIndex, childCount) => {
|
|
3557
|
+
if (childCount === 0) {
|
|
3558
|
+
return {
|
|
3559
|
+
children: [],
|
|
3560
|
+
nodesConsumed: 0
|
|
3561
|
+
};
|
|
3562
|
+
}
|
|
3563
|
+
const children = [];
|
|
3564
|
+
let i = startIndex;
|
|
3565
|
+
let remaining = childCount;
|
|
3566
|
+
let totalConsumed = 0;
|
|
3567
|
+
while (remaining > 0 && i < nodes.length) {
|
|
3568
|
+
const node = nodes[i];
|
|
3569
|
+
const nodeChildCount = node.childCount || 0;
|
|
3570
|
+
const {
|
|
3571
|
+
children: nodeChildren,
|
|
3572
|
+
nodesConsumed
|
|
3573
|
+
} = getChildrenWithCount(nodes, i + 1, nodeChildCount);
|
|
3574
|
+
children.push({
|
|
3575
|
+
node,
|
|
3576
|
+
children: nodeChildren
|
|
3577
|
+
});
|
|
3578
|
+
const nodeSize = 1 + nodesConsumed;
|
|
3579
|
+
i += nodeSize;
|
|
3580
|
+
totalConsumed += nodeSize;
|
|
3581
|
+
remaining--;
|
|
3582
|
+
}
|
|
3583
|
+
return {
|
|
3584
|
+
children,
|
|
3585
|
+
nodesConsumed: totalConsumed
|
|
3586
|
+
};
|
|
3587
|
+
};
|
|
3588
|
+
|
|
3589
|
+
const compareNodes = (oldNode, newNode) => {
|
|
3590
|
+
// Check if node type changed - return null to signal incompatible nodes
|
|
3591
|
+
// (caller should handle this with a Replace operation)
|
|
3592
|
+
if (oldNode.type !== newNode.type) {
|
|
3593
|
+
return null;
|
|
3594
|
+
}
|
|
3595
|
+
const patches = [];
|
|
3596
|
+
// Handle reference nodes - special handling for uid changes
|
|
3597
|
+
if (oldNode.type === Reference) {
|
|
3598
|
+
if (oldNode.uid !== newNode.uid) {
|
|
3599
|
+
patches.push({
|
|
3600
|
+
type: SetReferenceNodeUid,
|
|
3601
|
+
uid: newNode.uid
|
|
3602
|
+
});
|
|
3603
|
+
}
|
|
3604
|
+
return patches;
|
|
3605
|
+
}
|
|
3606
|
+
// Handle text nodes
|
|
3607
|
+
if (oldNode.type === Text && newNode.type === Text) {
|
|
3608
|
+
if (oldNode.text !== newNode.text) {
|
|
3609
|
+
patches.push({
|
|
3610
|
+
type: SetText,
|
|
3611
|
+
value: newNode.text
|
|
3612
|
+
});
|
|
3613
|
+
}
|
|
3614
|
+
return patches;
|
|
3615
|
+
}
|
|
3616
|
+
// Compare attributes
|
|
3617
|
+
const oldKeys = getKeys(oldNode);
|
|
3618
|
+
const newKeys = getKeys(newNode);
|
|
3619
|
+
// Check for attribute changes
|
|
3620
|
+
for (const key of newKeys) {
|
|
3621
|
+
if (oldNode[key] !== newNode[key]) {
|
|
3622
|
+
patches.push({
|
|
3623
|
+
type: SetAttribute,
|
|
3624
|
+
key,
|
|
3625
|
+
value: newNode[key]
|
|
3626
|
+
});
|
|
3627
|
+
}
|
|
3628
|
+
}
|
|
3629
|
+
// Check for removed attributes
|
|
3630
|
+
for (const key of oldKeys) {
|
|
3631
|
+
if (!Object.hasOwn(newNode, key)) {
|
|
3632
|
+
patches.push({
|
|
3633
|
+
type: RemoveAttribute,
|
|
3634
|
+
key
|
|
3635
|
+
});
|
|
3636
|
+
}
|
|
3637
|
+
}
|
|
3638
|
+
return patches;
|
|
3639
|
+
};
|
|
3640
|
+
|
|
3641
|
+
const treeToArray = node => {
|
|
3642
|
+
const result = [node.node];
|
|
3643
|
+
for (const child of node.children) {
|
|
3644
|
+
result.push(...treeToArray(child));
|
|
3645
|
+
}
|
|
3646
|
+
return result;
|
|
3647
|
+
};
|
|
3648
|
+
|
|
3649
|
+
const navigateToChild = (patches, currentChildIndex, index) => {
|
|
3650
|
+
if (currentChildIndex === -1) {
|
|
3651
|
+
patches.push({
|
|
3652
|
+
type: NavigateChild,
|
|
3653
|
+
index
|
|
3654
|
+
});
|
|
3655
|
+
return index;
|
|
3656
|
+
}
|
|
3657
|
+
if (currentChildIndex !== index) {
|
|
3658
|
+
patches.push({
|
|
3659
|
+
type: NavigateSibling,
|
|
3660
|
+
index
|
|
3661
|
+
});
|
|
3662
|
+
}
|
|
3663
|
+
return index;
|
|
3664
|
+
};
|
|
3665
|
+
const navigateToParent = (patches, currentChildIndex) => {
|
|
3666
|
+
if (currentChildIndex >= 0) {
|
|
3667
|
+
patches.push({
|
|
3668
|
+
type: NavigateParent
|
|
3669
|
+
});
|
|
3670
|
+
}
|
|
3671
|
+
return -1;
|
|
3672
|
+
};
|
|
3673
|
+
const addTree = (newNode, patches) => {
|
|
3674
|
+
patches.push({
|
|
3675
|
+
type: Add,
|
|
3676
|
+
nodes: treeToArray(newNode)
|
|
3677
|
+
});
|
|
3678
|
+
};
|
|
3679
|
+
const replaceTree = (newNode, patches) => {
|
|
3680
|
+
patches.push({
|
|
3681
|
+
type: Replace,
|
|
3682
|
+
nodes: treeToArray(newNode)
|
|
3683
|
+
});
|
|
3684
|
+
};
|
|
3685
|
+
const diffExistingChild = (oldNode, newNode, patches, currentChildIndex, index) => {
|
|
3686
|
+
const nodePatches = compareNodes(oldNode.node, newNode.node);
|
|
3687
|
+
if (nodePatches === null) {
|
|
3688
|
+
const nextChildIndex = navigateToChild(patches, currentChildIndex, index);
|
|
3689
|
+
replaceTree(newNode, patches);
|
|
3690
|
+
return nextChildIndex;
|
|
3691
|
+
}
|
|
3692
|
+
const hasChildrenToCompare = oldNode.children.length > 0 || newNode.children.length > 0;
|
|
3693
|
+
if (nodePatches.length === 0 && !hasChildrenToCompare) {
|
|
3694
|
+
return currentChildIndex;
|
|
3695
|
+
}
|
|
3696
|
+
const nextChildIndex = navigateToChild(patches, currentChildIndex, index);
|
|
3697
|
+
if (nodePatches.length > 0) {
|
|
3698
|
+
patches.push(...nodePatches);
|
|
3699
|
+
}
|
|
3700
|
+
if (hasChildrenToCompare) {
|
|
3701
|
+
diffChildren(oldNode.children, newNode.children, patches);
|
|
3702
|
+
}
|
|
3703
|
+
return nextChildIndex;
|
|
3704
|
+
};
|
|
3705
|
+
const diffRootNode = (oldNode, newNode, patches) => {
|
|
3706
|
+
const nodePatches = compareNodes(oldNode.node, newNode.node);
|
|
3707
|
+
if (nodePatches === null) {
|
|
3708
|
+
replaceTree(newNode, patches);
|
|
3709
|
+
return;
|
|
3710
|
+
}
|
|
3711
|
+
if (nodePatches.length > 0) {
|
|
3712
|
+
patches.push(...nodePatches);
|
|
3713
|
+
}
|
|
3714
|
+
if (oldNode.children.length > 0 || newNode.children.length > 0) {
|
|
3715
|
+
diffChildren(oldNode.children, newNode.children, patches);
|
|
3716
|
+
}
|
|
3717
|
+
};
|
|
3718
|
+
const diffChildren = (oldChildren, newChildren, patches) => {
|
|
3719
|
+
const maxLength = Math.max(oldChildren.length, newChildren.length);
|
|
3720
|
+
let currentChildIndex = -1;
|
|
3721
|
+
const indicesToRemove = [];
|
|
3722
|
+
for (let i = 0; i < maxLength; i++) {
|
|
3723
|
+
const oldNode = oldChildren[i];
|
|
3724
|
+
const newNode = newChildren[i];
|
|
3725
|
+
if (!oldNode && !newNode) {
|
|
3726
|
+
continue;
|
|
3727
|
+
}
|
|
3728
|
+
if (!oldNode) {
|
|
3729
|
+
currentChildIndex = navigateToParent(patches, currentChildIndex);
|
|
3730
|
+
addTree(newNode, patches);
|
|
3731
|
+
continue;
|
|
3732
|
+
}
|
|
3733
|
+
if (!newNode) {
|
|
3734
|
+
indicesToRemove.push(i);
|
|
3735
|
+
continue;
|
|
3736
|
+
}
|
|
3737
|
+
currentChildIndex = diffExistingChild(oldNode, newNode, patches, currentChildIndex, i);
|
|
3738
|
+
}
|
|
3739
|
+
navigateToParent(patches, currentChildIndex);
|
|
3740
|
+
for (let j = indicesToRemove.length - 1; j >= 0; j--) {
|
|
3741
|
+
patches.push({
|
|
3742
|
+
type: RemoveChild,
|
|
3743
|
+
index: indicesToRemove[j]
|
|
3744
|
+
});
|
|
3745
|
+
}
|
|
3746
|
+
};
|
|
3747
|
+
const diffTrees = (oldTree, newTree, patches, path) => {
|
|
3748
|
+
if (path.length === 0 && oldTree.length === 1 && newTree.length === 1) {
|
|
3749
|
+
diffRootNode(oldTree[0], newTree[0], patches);
|
|
3750
|
+
return;
|
|
3751
|
+
}
|
|
3752
|
+
diffChildren(oldTree, newTree, patches);
|
|
3753
|
+
};
|
|
3754
|
+
|
|
3755
|
+
const removeTrailingNavigationPatches = patches => {
|
|
3756
|
+
// Find the last non-navigation patch
|
|
3757
|
+
let lastNonNavigationIndex = -1;
|
|
3758
|
+
for (let i = patches.length - 1; i >= 0; i--) {
|
|
3759
|
+
const patch = patches[i];
|
|
3760
|
+
if (patch.type !== NavigateChild && patch.type !== NavigateParent && patch.type !== NavigateSibling) {
|
|
3761
|
+
lastNonNavigationIndex = i;
|
|
3762
|
+
break;
|
|
3763
|
+
}
|
|
3764
|
+
}
|
|
3765
|
+
// Return patches up to and including the last non-navigation patch
|
|
3766
|
+
return lastNonNavigationIndex === -1 ? [] : patches.slice(0, lastNonNavigationIndex + 1);
|
|
3767
|
+
};
|
|
3768
|
+
|
|
3769
|
+
const diffTree = (oldNodes, newNodes) => {
|
|
3770
|
+
// Step 1: Convert flat arrays to tree structures
|
|
3771
|
+
const oldTree = arrayToTree(oldNodes);
|
|
3772
|
+
const newTree = arrayToTree(newNodes);
|
|
3773
|
+
// Step 3: Compare the trees
|
|
3774
|
+
const patches = [];
|
|
3775
|
+
diffTrees(oldTree, newTree, patches, []);
|
|
3776
|
+
// Remove trailing navigation patches since they serve no purpose
|
|
3777
|
+
return removeTrailingNavigationPatches(patches);
|
|
3778
|
+
};
|
|
3779
|
+
|
|
3513
3780
|
const state$6 = {
|
|
3781
|
+
instances: Object.create(null),
|
|
3782
|
+
renderedDoms: Object.create(null),
|
|
3514
3783
|
views: Object.create(null)
|
|
3515
3784
|
};
|
|
3516
3785
|
const getViewDisplay = view => {
|
|
@@ -3545,6 +3814,79 @@ const executeViewProvider = async id => {
|
|
|
3545
3814
|
}
|
|
3546
3815
|
return view.create();
|
|
3547
3816
|
};
|
|
3817
|
+
function assertVirtualDomViewInstance(id, instance) {
|
|
3818
|
+
if (!instance || typeof instance !== 'object') {
|
|
3819
|
+
throw new Error(`view ${id} did not return a view instance`);
|
|
3820
|
+
}
|
|
3821
|
+
if (typeof instance.render !== 'function') {
|
|
3822
|
+
throw new TypeError(`view ${id} instance is missing render function`);
|
|
3823
|
+
}
|
|
3824
|
+
}
|
|
3825
|
+
const getVirtualDomInstance = uid => {
|
|
3826
|
+
const instance = state$6.instances[uid];
|
|
3827
|
+
if (!instance) {
|
|
3828
|
+
throw new Error(`view instance ${uid} not found`);
|
|
3829
|
+
}
|
|
3830
|
+
return instance;
|
|
3831
|
+
};
|
|
3832
|
+
const renderDom = async instance => {
|
|
3833
|
+
const dom = await instance.render();
|
|
3834
|
+
if (!Array.isArray(dom)) {
|
|
3835
|
+
throw new TypeError('view render result must be an array');
|
|
3836
|
+
}
|
|
3837
|
+
return dom;
|
|
3838
|
+
};
|
|
3839
|
+
const createViewInstance = async (viewId, uid, context) => {
|
|
3840
|
+
const view = state$6.views[viewId];
|
|
3841
|
+
if (!view) {
|
|
3842
|
+
throw new Error(`view ${viewId} not found`);
|
|
3843
|
+
}
|
|
3844
|
+
if (view.kind !== 'virtualDom') {
|
|
3845
|
+
throw new Error(`view ${viewId} is not a virtual dom view`);
|
|
3846
|
+
}
|
|
3847
|
+
const instance = await view.create({
|
|
3848
|
+
...context,
|
|
3849
|
+
uid,
|
|
3850
|
+
viewId
|
|
3851
|
+
});
|
|
3852
|
+
assertVirtualDomViewInstance(viewId, instance);
|
|
3853
|
+
state$6.instances[uid] = instance;
|
|
3854
|
+
const dom = await renderDom(instance);
|
|
3855
|
+
state$6.renderedDoms[uid] = dom;
|
|
3856
|
+
return {
|
|
3857
|
+
dom,
|
|
3858
|
+
type: 'setDom'
|
|
3859
|
+
};
|
|
3860
|
+
};
|
|
3861
|
+
const dispatchViewEvent = async (uid, event) => {
|
|
3862
|
+
const instance = getVirtualDomInstance(uid);
|
|
3863
|
+
if (typeof instance.handleEvent === 'function') {
|
|
3864
|
+
await instance.handleEvent(event);
|
|
3865
|
+
}
|
|
3866
|
+
const oldDom = state$6.renderedDoms[uid] || [];
|
|
3867
|
+
const newDom = await renderDom(instance);
|
|
3868
|
+
state$6.renderedDoms[uid] = newDom;
|
|
3869
|
+
const patches = diffTree(oldDom, newDom);
|
|
3870
|
+
return {
|
|
3871
|
+
patches,
|
|
3872
|
+
type: 'setPatches'
|
|
3873
|
+
};
|
|
3874
|
+
};
|
|
3875
|
+
const saveViewInstanceState = async uid => {
|
|
3876
|
+
const instance = getVirtualDomInstance(uid);
|
|
3877
|
+
if (typeof instance.saveState !== 'function') {
|
|
3878
|
+
return undefined;
|
|
3879
|
+
}
|
|
3880
|
+
return instance.saveState();
|
|
3881
|
+
};
|
|
3882
|
+
const disposeViewInstance = async uid => {
|
|
3883
|
+
const instance = state$6.instances[uid];
|
|
3884
|
+
if (instance && typeof instance.dispose === 'function') {
|
|
3885
|
+
await instance.dispose();
|
|
3886
|
+
}
|
|
3887
|
+
delete state$6.instances[uid];
|
|
3888
|
+
delete state$6.renderedDoms[uid];
|
|
3889
|
+
};
|
|
3548
3890
|
const getRegisteredViewIds$1 = () => {
|
|
3549
3891
|
return Object.values(state$6.views).map(view => view.id);
|
|
3550
3892
|
};
|
|
@@ -4308,6 +4650,12 @@ const getManifestDiagnosticProviderIds = extension => {
|
|
|
4308
4650
|
}
|
|
4309
4651
|
return extension.diagnosticProviders.map(provider => provider.id).filter(id => typeof id === 'string');
|
|
4310
4652
|
};
|
|
4653
|
+
const getManifestSourceControlProviderIds = extension => {
|
|
4654
|
+
if (!Array.isArray(extension.sourceControlProviders)) {
|
|
4655
|
+
return [];
|
|
4656
|
+
}
|
|
4657
|
+
return extension.sourceControlProviders.map(provider => provider.id).filter(id => typeof id === 'string');
|
|
4658
|
+
};
|
|
4311
4659
|
const getManifestViewIds = extension => {
|
|
4312
4660
|
if (!Array.isArray(extension.views)) {
|
|
4313
4661
|
return [];
|
|
@@ -4343,6 +4691,10 @@ const getNewRegisteredDiagnosticProviderIds = beforeDiagnosticProviderIds => {
|
|
|
4343
4691
|
const before = new Set(beforeDiagnosticProviderIds);
|
|
4344
4692
|
return getRegisteredDiagnosticProviderIds$1().filter(providerId => !before.has(providerId));
|
|
4345
4693
|
};
|
|
4694
|
+
const getNewRegisteredSourceControlProviderIds = beforeSourceControlProviderIds => {
|
|
4695
|
+
const before = new Set(beforeSourceControlProviderIds);
|
|
4696
|
+
return getRegisteredSourceControlProviderIds$1().filter(providerId => !before.has(providerId));
|
|
4697
|
+
};
|
|
4346
4698
|
const getNewRegisteredViewIds = beforeViewIds => {
|
|
4347
4699
|
const before = new Set(beforeViewIds);
|
|
4348
4700
|
return getRegisteredViewIds$1().filter(viewId => !before.has(viewId));
|
|
@@ -4362,6 +4714,9 @@ const getRegisteredHoverProviderIds = () => {
|
|
|
4362
4714
|
const getRegisteredDiagnosticProviderIds = () => {
|
|
4363
4715
|
return getRegisteredDiagnosticProviderIds$1();
|
|
4364
4716
|
};
|
|
4717
|
+
const getRegisteredSourceControlProviderIds = () => {
|
|
4718
|
+
return getRegisteredSourceControlProviderIds$1();
|
|
4719
|
+
};
|
|
4365
4720
|
const getRegisteredViewIds = () => {
|
|
4366
4721
|
return getRegisteredViewIds$1();
|
|
4367
4722
|
};
|
|
@@ -4420,6 +4775,14 @@ const validateIsolatedExtensionDiagnosticProviders = (extension, beforeDiagnosti
|
|
|
4420
4775
|
const registeredDiagnosticProviderIds = getNewRegisteredDiagnosticProviderIds(beforeDiagnosticProviderIds);
|
|
4421
4776
|
validateIsolatedExtensionContribution('diagnostic provider', manifestDiagnosticProviderIds, registeredDiagnosticProviderIds);
|
|
4422
4777
|
};
|
|
4778
|
+
const validateIsolatedExtensionSourceControlProviders = (extension, beforeSourceControlProviderIds) => {
|
|
4779
|
+
if (!extension.isolated) {
|
|
4780
|
+
return;
|
|
4781
|
+
}
|
|
4782
|
+
const manifestSourceControlProviderIds = getManifestSourceControlProviderIds(extension);
|
|
4783
|
+
const registeredSourceControlProviderIds = getNewRegisteredSourceControlProviderIds(beforeSourceControlProviderIds);
|
|
4784
|
+
validateIsolatedExtensionContribution('source control provider', manifestSourceControlProviderIds, registeredSourceControlProviderIds);
|
|
4785
|
+
};
|
|
4423
4786
|
const validateIsolatedExtensionViews = (extension, beforeViewIds) => {
|
|
4424
4787
|
if (!extension.isolated) {
|
|
4425
4788
|
return;
|
|
@@ -4454,6 +4817,7 @@ const activateExtension2 = async (extensionId, extension, absolutePath) => {
|
|
|
4454
4817
|
const beforeDiagnosticProviderIds = getRegisteredDiagnosticProviderIds();
|
|
4455
4818
|
const beforeFormattingProviderIds = getRegisteredFormattingProviderIds();
|
|
4456
4819
|
const beforeHoverProviderIds = getRegisteredHoverProviderIds();
|
|
4820
|
+
const beforeSourceControlProviderIds = getRegisteredSourceControlProviderIds();
|
|
4457
4821
|
const beforeViewIds = getRegisteredViewIds();
|
|
4458
4822
|
await Promise.race([activate(extension), rejectAfterTimeout$1(activationTimeout$1, token)]);
|
|
4459
4823
|
validateIsolatedExtensionCommands(extension, beforeCommandIds);
|
|
@@ -4461,6 +4825,7 @@ const activateExtension2 = async (extensionId, extension, absolutePath) => {
|
|
|
4461
4825
|
validateIsolatedExtensionDiagnosticProviders(extension, beforeDiagnosticProviderIds);
|
|
4462
4826
|
validateIsolatedExtensionFormattingProviders(extension, beforeFormattingProviderIds);
|
|
4463
4827
|
validateIsolatedExtensionHoverProviders(extension, beforeHoverProviderIds);
|
|
4828
|
+
validateIsolatedExtensionSourceControlProviders(extension, beforeSourceControlProviderIds);
|
|
4464
4829
|
validateIsolatedExtensionViews(extension, beforeViewIds);
|
|
4465
4830
|
const endTime = performance.now();
|
|
4466
4831
|
const time = endTime - startTime;
|
|
@@ -5393,7 +5758,11 @@ const TextDocumentSyncFull = 'ExtensionHostTextDocument.syncFull';
|
|
|
5393
5758
|
const TextDocumentSyncIncremental = 'ExtensionHostTextDocument.syncIncremental';
|
|
5394
5759
|
const TextSearchExecuteTextSearchProvider = 'ExtensionHostTextSearch.executeTextSearchProvider';
|
|
5395
5760
|
const TypeDefinitionExecuteTypeDefinitionProvider = 'ExtensionHostTypeDefinition.executeTypeDefinitionProvider';
|
|
5761
|
+
const ViewCreateInstance = 'ExtensionHostView.createInstance';
|
|
5762
|
+
const ViewDispatchEvent = 'ExtensionHostView.dispatchEvent';
|
|
5763
|
+
const ViewDisposeInstance = 'ExtensionHostView.disposeInstance';
|
|
5396
5764
|
const ViewExecute = 'ExtensionHostView.execute';
|
|
5765
|
+
const ViewSaveInstanceState = 'ExtensionHostView.saveInstanceState';
|
|
5397
5766
|
const WorkspaceSetPath = 'Workspace.setWorkspacePath';
|
|
5398
5767
|
|
|
5399
5768
|
class ExecError extends Error {
|
|
@@ -6612,7 +6981,11 @@ const commandMap = {
|
|
|
6612
6981
|
[TextDocumentSyncIncremental]: syncIncremental,
|
|
6613
6982
|
[TextSearchExecuteTextSearchProvider]: executeTextSearchProvider,
|
|
6614
6983
|
[TypeDefinitionExecuteTypeDefinitionProvider]: executeTypeDefinitionProvider,
|
|
6984
|
+
[ViewCreateInstance]: createViewInstance,
|
|
6985
|
+
[ViewDispatchEvent]: dispatchViewEvent,
|
|
6986
|
+
[ViewDisposeInstance]: disposeViewInstance,
|
|
6615
6987
|
[ViewExecute]: executeViewProvider,
|
|
6988
|
+
[ViewSaveInstanceState]: saveViewInstanceState,
|
|
6616
6989
|
[WorkspaceSetPath]: setWorkspacePath,
|
|
6617
6990
|
'ExtensionHostDebug.evaluate': evaluate,
|
|
6618
6991
|
'ExtensionHostDebug.getCallStack': getCallStack,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
export { activate } from './parts/Activation/Activation.ts';
|
|
2
2
|
export { executeCommand } from './parts/ExecuteCommand/ExecuteCommand.ts';
|
|
3
3
|
export { showQuickPick } from './parts/QuickPick/QuickPick.ts';
|
|
4
|
+
export { getPreference, setPreference } from './parts/Preferences/Preferences.ts';
|
|
4
5
|
export { registerCommand } from './parts/CommandRegistry/CommandRegistry.ts';
|
|
5
6
|
export { executeCompletionProvider, executeResolveCompletionItemProvider, getCompletionProviderRegistrySnapshot, registerCompletionProvider, resetCompletionProviderRegistry, } from './parts/Completion/Completion.ts';
|
|
6
7
|
export { executeDiagnosticProvider, getDiagnosticProviderRegistrySnapshot, registerDiagnosticProvider, resetDiagnosticProviderRegistry, } from './parts/Diagnostic/Diagnostic.ts';
|
|
7
8
|
export { executeFormattingProvider, getFormattingProviderRegistrySnapshot, registerFormattingProvider, resetFormattingProviderRegistry, } from './parts/Formatting/Formatting.ts';
|
|
8
9
|
export { exists, mkdir, readDirWithFileTypes, readFile, remove, writeFile } from './parts/FileSystem/FileSystem.ts';
|
|
9
10
|
export { executeHoverProvider, getHoverProviderRegistrySnapshot, registerHoverProvider, resetHoverProviderRegistry } from './parts/Hover/Hover.ts';
|
|
11
|
+
export { executeSourceControlAcceptInput, executeSourceControlAdd, executeSourceControlDiscard, executeSourceControlGenerateCommitMessage, executeSourceControlGetChangedFiles, executeSourceControlGetFeatures, executeSourceControlGetFileBefore, executeSourceControlGetFileDecorations, executeSourceControlGetGroups, executeSourceControlIsActive, registerSourceControlProvider, resetSourceControlProviderRegistry, } from './parts/SourceControl/SourceControl.ts';
|
|
10
12
|
export { createViewInstance, dispatchViewEvent, disposeViewInstance, executeViewProvider, getViewRegistrySnapshot, registerView, resetViewRegistry, saveViewInstanceState, } from './parts/ViewRegistry/ViewRegistry.ts';
|
|
11
13
|
export { createOutputChannel, getOutputChannelRegistrySnapshot, resetOutputChannelRegistry } from './parts/OutputChannel/OutputChannel.ts';
|
|
12
14
|
export { getStatusBarItemProviderRegistrySnapshot, registerStatusBarItemProvider, resetStatusBarItemProviderRegistry, } from './parts/StatusBar/StatusBar.ts';
|
|
@@ -26,5 +28,6 @@ export type { OutputChannel } from './parts/OutputChannelHandle/OutputChannelHan
|
|
|
26
28
|
export type { OutputChannelRegistrySnapshot } from './parts/OutputChannelRegistrySnapshot/OutputChannelRegistrySnapshot.ts';
|
|
27
29
|
export type { RegisteredOutputChannel } from './parts/RegisteredOutputChannel/RegisteredOutputChannel.ts';
|
|
28
30
|
export type { QuickPickItem } from './parts/QuickPickItem/QuickPickItem.ts';
|
|
31
|
+
export type { RegisteredSourceControlProvider, SourceControlProvider, SourceControlProviderRegistrySnapshot, } from './parts/SourceControl/SourceControl.ts';
|
|
29
32
|
export type { ShowQuickPickOptions } from './parts/ShowQuickPickOptions/ShowQuickPickOptions.ts';
|
|
30
33
|
export type { StatusBarItem, StatusBarItemProvider, StatusBarItemProviderHandle, StatusBarItemProviderRegistrySnapshot, } from './parts/StatusBar/StatusBar.ts';
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
export { activate } from "./parts/Activation/Activation.js";
|
|
2
2
|
export { executeCommand } from "./parts/ExecuteCommand/ExecuteCommand.js";
|
|
3
3
|
export { showQuickPick } from "./parts/QuickPick/QuickPick.js";
|
|
4
|
+
export { getPreference, setPreference } from "./parts/Preferences/Preferences.js";
|
|
4
5
|
export { registerCommand } from "./parts/CommandRegistry/CommandRegistry.js";
|
|
5
6
|
export { executeCompletionProvider, executeResolveCompletionItemProvider, getCompletionProviderRegistrySnapshot, registerCompletionProvider, resetCompletionProviderRegistry, } from "./parts/Completion/Completion.js";
|
|
6
7
|
export { executeDiagnosticProvider, getDiagnosticProviderRegistrySnapshot, registerDiagnosticProvider, resetDiagnosticProviderRegistry, } from "./parts/Diagnostic/Diagnostic.js";
|
|
7
8
|
export { executeFormattingProvider, getFormattingProviderRegistrySnapshot, registerFormattingProvider, resetFormattingProviderRegistry, } from "./parts/Formatting/Formatting.js";
|
|
8
9
|
export { exists, mkdir, readDirWithFileTypes, readFile, remove, writeFile } from "./parts/FileSystem/FileSystem.js";
|
|
9
10
|
export { executeHoverProvider, getHoverProviderRegistrySnapshot, registerHoverProvider, resetHoverProviderRegistry } from "./parts/Hover/Hover.js";
|
|
11
|
+
export { executeSourceControlAcceptInput, executeSourceControlAdd, executeSourceControlDiscard, executeSourceControlGenerateCommitMessage, executeSourceControlGetChangedFiles, executeSourceControlGetFeatures, executeSourceControlGetFileBefore, executeSourceControlGetFileDecorations, executeSourceControlGetGroups, executeSourceControlIsActive, registerSourceControlProvider, resetSourceControlProviderRegistry, } from "./parts/SourceControl/SourceControl.js";
|
|
10
12
|
export { createViewInstance, dispatchViewEvent, disposeViewInstance, executeViewProvider, getViewRegistrySnapshot, registerView, resetViewRegistry, saveViewInstanceState, } from "./parts/ViewRegistry/ViewRegistry.js";
|
|
11
13
|
export { createOutputChannel, getOutputChannelRegistrySnapshot, resetOutputChannelRegistry } from "./parts/OutputChannel/OutputChannel.js";
|
|
12
14
|
export { getStatusBarItemProviderRegistrySnapshot, registerStatusBarItemProvider, resetStatusBarItemProviderRegistry, } from "./parts/StatusBar/StatusBar.js";
|
|
@@ -9,6 +9,16 @@ export declare const commandMap: {
|
|
|
9
9
|
'ExtensionApi.executeFormattingProvider': (textDocument: import("../FormattingTextDocument/FormattingTextDocument.ts").TextDocument, ...args: readonly unknown[]) => Promise<readonly import("../FormattingEdit/FormattingEdit.ts").FormattingEdit[]>;
|
|
10
10
|
'ExtensionApi.executeHoverProvider': (textDocument: import("../HoverTextDocument/HoverTextDocument.ts").TextDocument, offset: number, ...args: readonly unknown[]) => Promise<import("../HoverResult/HoverResult.ts").HoverResult | undefined>;
|
|
11
11
|
'ExtensionApi.executeResolveCompletionItemProvider': (textDocument: import("../CompletionTextDocument/CompletionTextDocument.ts").TextDocument, offset: number, name: string, completionItem: import("../CompletionItem/CompletionItem.ts").CompletionItem, ...args: readonly unknown[]) => Promise<import("../CompletionItem/CompletionItem.ts").CompletionItem | undefined>;
|
|
12
|
+
'ExtensionApi.executeSourceControlAcceptInput': (id: string, value: string) => Promise<unknown>;
|
|
13
|
+
'ExtensionApi.executeSourceControlAdd': (id: string, path: string) => Promise<unknown>;
|
|
14
|
+
'ExtensionApi.executeSourceControlDiscard': (id: string, path: string) => Promise<unknown>;
|
|
15
|
+
'ExtensionApi.executeSourceControlGenerateCommitMessage': (id: string) => Promise<unknown>;
|
|
16
|
+
'ExtensionApi.executeSourceControlGetChangedFiles': (id: string) => Promise<readonly unknown[]>;
|
|
17
|
+
'ExtensionApi.executeSourceControlGetFeatures': (id: string) => Promise<unknown>;
|
|
18
|
+
'ExtensionApi.executeSourceControlGetFileBefore': (id: string, uri: string) => Promise<unknown>;
|
|
19
|
+
'ExtensionApi.executeSourceControlGetFileDecorations': (id: string, uris: readonly string[]) => Promise<unknown>;
|
|
20
|
+
'ExtensionApi.executeSourceControlGetGroups': (id: string, cwd: string) => Promise<unknown>;
|
|
21
|
+
'ExtensionApi.executeSourceControlIsActive': (id: string, scheme: string, root: string) => Promise<boolean>;
|
|
12
22
|
'ExtensionApi.executeViewProvider': (id: string) => unknown;
|
|
13
23
|
'ExtensionApi.getCommandRegistrySnapshot': () => import("../CommandRegistrySnapshot/CommandRegistrySnapshot.ts").CommandRegistrySnapshot;
|
|
14
24
|
'ExtensionApi.getCompletionProviderRegistrySnapshot': () => import("../CompletionProviderRegistrySnapshot/CompletionProviderRegistrySnapshot.ts").CompletionProviderRegistrySnapshot;
|
|
@@ -16,6 +26,7 @@ export declare const commandMap: {
|
|
|
16
26
|
'ExtensionApi.getFormattingProviderRegistrySnapshot': () => import("../FormattingProviderRegistrySnapshot/FormattingProviderRegistrySnapshot.ts").FormattingProviderRegistrySnapshot;
|
|
17
27
|
'ExtensionApi.getHoverProviderRegistrySnapshot': () => import("../HoverProviderRegistrySnapshot/HoverProviderRegistrySnapshot.ts").HoverProviderRegistrySnapshot;
|
|
18
28
|
'ExtensionApi.getOutputChannelRegistrySnapshot': () => import("../OutputChannelRegistrySnapshot/OutputChannelRegistrySnapshot.ts").OutputChannelRegistrySnapshot;
|
|
29
|
+
'ExtensionApi.getSourceControlProviderRegistrySnapshot': () => import("../SourceControlProviderRegistrySnapshot/SourceControlProviderRegistrySnapshot.ts").SourceControlProviderRegistrySnapshot;
|
|
19
30
|
'ExtensionApi.getStatusBarItems': () => readonly import("../StatusBarItem/StatusBarItem.ts").StatusBarItem[];
|
|
20
31
|
'ExtensionApi.getViewRegistrySnapshot': () => import("../View/View.ts").ViewRegistrySnapshot;
|
|
21
32
|
'ExtensionApi.saveViewInstanceState': (uid: number) => Promise<unknown>;
|
|
@@ -8,6 +8,16 @@ export declare const commandMap: {
|
|
|
8
8
|
'ExtensionApi.executeFormattingProvider': (textDocument: import("../FormattingTextDocument/FormattingTextDocument.ts").TextDocument, ...args: readonly unknown[]) => Promise<readonly import("../FormattingEdit/FormattingEdit.ts").FormattingEdit[]>;
|
|
9
9
|
'ExtensionApi.executeHoverProvider': (textDocument: import("../HoverTextDocument/HoverTextDocument.ts").TextDocument, offset: number, ...args: readonly unknown[]) => Promise<import("../HoverResult/HoverResult.ts").HoverResult | undefined>;
|
|
10
10
|
'ExtensionApi.executeResolveCompletionItemProvider': (textDocument: import("../CompletionTextDocument/CompletionTextDocument.ts").TextDocument, offset: number, name: string, completionItem: import("../CompletionItem/CompletionItem.ts").CompletionItem, ...args: readonly unknown[]) => Promise<import("../CompletionItem/CompletionItem.ts").CompletionItem | undefined>;
|
|
11
|
+
'ExtensionApi.executeSourceControlAcceptInput': (id: string, value: string) => Promise<unknown>;
|
|
12
|
+
'ExtensionApi.executeSourceControlAdd': (id: string, path: string) => Promise<unknown>;
|
|
13
|
+
'ExtensionApi.executeSourceControlDiscard': (id: string, path: string) => Promise<unknown>;
|
|
14
|
+
'ExtensionApi.executeSourceControlGenerateCommitMessage': (id: string) => Promise<unknown>;
|
|
15
|
+
'ExtensionApi.executeSourceControlGetChangedFiles': (id: string) => Promise<readonly unknown[]>;
|
|
16
|
+
'ExtensionApi.executeSourceControlGetFeatures': (id: string) => Promise<unknown>;
|
|
17
|
+
'ExtensionApi.executeSourceControlGetFileBefore': (id: string, uri: string) => Promise<unknown>;
|
|
18
|
+
'ExtensionApi.executeSourceControlGetFileDecorations': (id: string, uris: readonly string[]) => Promise<unknown>;
|
|
19
|
+
'ExtensionApi.executeSourceControlGetGroups': (id: string, cwd: string) => Promise<unknown>;
|
|
20
|
+
'ExtensionApi.executeSourceControlIsActive': (id: string, scheme: string, root: string) => Promise<boolean>;
|
|
11
21
|
'ExtensionApi.executeViewProvider': (id: string) => unknown;
|
|
12
22
|
'ExtensionApi.getCommandRegistrySnapshot': () => import("../CommandRegistrySnapshot/CommandRegistrySnapshot.ts").CommandRegistrySnapshot;
|
|
13
23
|
'ExtensionApi.getCompletionProviderRegistrySnapshot': () => import("../CompletionProviderRegistrySnapshot/CompletionProviderRegistrySnapshot.ts").CompletionProviderRegistrySnapshot;
|
|
@@ -15,6 +25,7 @@ export declare const commandMap: {
|
|
|
15
25
|
'ExtensionApi.getFormattingProviderRegistrySnapshot': () => import("../FormattingProviderRegistrySnapshot/FormattingProviderRegistrySnapshot.ts").FormattingProviderRegistrySnapshot;
|
|
16
26
|
'ExtensionApi.getHoverProviderRegistrySnapshot': () => import("../HoverProviderRegistrySnapshot/HoverProviderRegistrySnapshot.ts").HoverProviderRegistrySnapshot;
|
|
17
27
|
'ExtensionApi.getOutputChannelRegistrySnapshot': () => import("../OutputChannelRegistrySnapshot/OutputChannelRegistrySnapshot.ts").OutputChannelRegistrySnapshot;
|
|
28
|
+
'ExtensionApi.getSourceControlProviderRegistrySnapshot': () => import("../SourceControlProviderRegistrySnapshot/SourceControlProviderRegistrySnapshot.ts").SourceControlProviderRegistrySnapshot;
|
|
18
29
|
'ExtensionApi.getStatusBarItems': () => readonly import("../StatusBarItem/StatusBarItem.ts").StatusBarItem[];
|
|
19
30
|
'ExtensionApi.getViewRegistrySnapshot': () => import("../View/View.ts").ViewRegistrySnapshot;
|
|
20
31
|
'ExtensionApi.saveViewInstanceState': (uid: number) => Promise<unknown>;
|
|
@@ -5,6 +5,7 @@ import { executeFormattingProvider, getFormattingProviderRegistrySnapshot } from
|
|
|
5
5
|
import { getStatusBarItems } from "../GetStatusBarItems/GetStatusBarItems.js";
|
|
6
6
|
import { executeHoverProvider, getHoverProviderRegistrySnapshot } from "../Hover/Hover.js";
|
|
7
7
|
import { getOutputChannelRegistrySnapshot } from "../OutputChannel/OutputChannel.js";
|
|
8
|
+
import { executeSourceControlAcceptInput, executeSourceControlAdd, executeSourceControlDiscard, executeSourceControlGenerateCommitMessage, executeSourceControlGetChangedFiles, executeSourceControlGetFeatures, executeSourceControlGetFileBefore, executeSourceControlGetFileDecorations, executeSourceControlGetGroups, executeSourceControlIsActive, getSourceControlProviderRegistrySnapshot, } from "../SourceControl/SourceControl.js";
|
|
8
9
|
import { createViewInstance, dispatchViewEvent, disposeViewInstance, executeViewProvider, getViewRegistrySnapshot, saveViewInstanceState, } from "../ViewRegistry/ViewRegistry.js";
|
|
9
10
|
export const commandMap = {
|
|
10
11
|
'ExtensionApi.createViewInstance': createViewInstance,
|
|
@@ -16,6 +17,16 @@ export const commandMap = {
|
|
|
16
17
|
'ExtensionApi.executeFormattingProvider': executeFormattingProvider,
|
|
17
18
|
'ExtensionApi.executeHoverProvider': executeHoverProvider,
|
|
18
19
|
'ExtensionApi.executeResolveCompletionItemProvider': executeResolveCompletionItemProvider,
|
|
20
|
+
'ExtensionApi.executeSourceControlAcceptInput': executeSourceControlAcceptInput,
|
|
21
|
+
'ExtensionApi.executeSourceControlAdd': executeSourceControlAdd,
|
|
22
|
+
'ExtensionApi.executeSourceControlDiscard': executeSourceControlDiscard,
|
|
23
|
+
'ExtensionApi.executeSourceControlGenerateCommitMessage': executeSourceControlGenerateCommitMessage,
|
|
24
|
+
'ExtensionApi.executeSourceControlGetChangedFiles': executeSourceControlGetChangedFiles,
|
|
25
|
+
'ExtensionApi.executeSourceControlGetFeatures': executeSourceControlGetFeatures,
|
|
26
|
+
'ExtensionApi.executeSourceControlGetFileBefore': executeSourceControlGetFileBefore,
|
|
27
|
+
'ExtensionApi.executeSourceControlGetFileDecorations': executeSourceControlGetFileDecorations,
|
|
28
|
+
'ExtensionApi.executeSourceControlGetGroups': executeSourceControlGetGroups,
|
|
29
|
+
'ExtensionApi.executeSourceControlIsActive': executeSourceControlIsActive,
|
|
19
30
|
'ExtensionApi.executeViewProvider': executeViewProvider,
|
|
20
31
|
'ExtensionApi.getCommandRegistrySnapshot': getCommandRegistrySnapshot,
|
|
21
32
|
'ExtensionApi.getCompletionProviderRegistrySnapshot': getCompletionProviderRegistrySnapshot,
|
|
@@ -23,6 +34,7 @@ export const commandMap = {
|
|
|
23
34
|
'ExtensionApi.getFormattingProviderRegistrySnapshot': getFormattingProviderRegistrySnapshot,
|
|
24
35
|
'ExtensionApi.getHoverProviderRegistrySnapshot': getHoverProviderRegistrySnapshot,
|
|
25
36
|
'ExtensionApi.getOutputChannelRegistrySnapshot': getOutputChannelRegistrySnapshot,
|
|
37
|
+
'ExtensionApi.getSourceControlProviderRegistrySnapshot': getSourceControlProviderRegistrySnapshot,
|
|
26
38
|
'ExtensionApi.getStatusBarItems': getStatusBarItems,
|
|
27
39
|
'ExtensionApi.getViewRegistrySnapshot': getViewRegistrySnapshot,
|
|
28
40
|
'ExtensionApi.saveViewInstanceState': saveViewInstanceState,
|
package/extension-api/dist/parts/ExtensionApiWorkerCommandMap/ExtensionApiWorkerCommandMap.d.ts
CHANGED
|
@@ -10,6 +10,16 @@ export declare const commandMap: {
|
|
|
10
10
|
'ExtensionApi.executeFormattingProvider': (textDocument: import("../FormattingTextDocument/FormattingTextDocument.ts").TextDocument, ...args: readonly unknown[]) => Promise<readonly import("../FormattingEdit/FormattingEdit.ts").FormattingEdit[]>;
|
|
11
11
|
'ExtensionApi.executeHoverProvider': (textDocument: import("../HoverTextDocument/HoverTextDocument.ts").TextDocument, offset: number, ...args: readonly unknown[]) => Promise<import("../HoverResult/HoverResult.ts").HoverResult | undefined>;
|
|
12
12
|
'ExtensionApi.executeResolveCompletionItemProvider': (textDocument: import("../CompletionTextDocument/CompletionTextDocument.ts").TextDocument, offset: number, name: string, completionItem: import("../CompletionItem/CompletionItem.ts").CompletionItem, ...args: readonly unknown[]) => Promise<import("../CompletionItem/CompletionItem.ts").CompletionItem | undefined>;
|
|
13
|
+
'ExtensionApi.executeSourceControlAcceptInput': (id: string, value: string) => Promise<unknown>;
|
|
14
|
+
'ExtensionApi.executeSourceControlAdd': (id: string, path: string) => Promise<unknown>;
|
|
15
|
+
'ExtensionApi.executeSourceControlDiscard': (id: string, path: string) => Promise<unknown>;
|
|
16
|
+
'ExtensionApi.executeSourceControlGenerateCommitMessage': (id: string) => Promise<unknown>;
|
|
17
|
+
'ExtensionApi.executeSourceControlGetChangedFiles': (id: string) => Promise<readonly unknown[]>;
|
|
18
|
+
'ExtensionApi.executeSourceControlGetFeatures': (id: string) => Promise<unknown>;
|
|
19
|
+
'ExtensionApi.executeSourceControlGetFileBefore': (id: string, uri: string) => Promise<unknown>;
|
|
20
|
+
'ExtensionApi.executeSourceControlGetFileDecorations': (id: string, uris: readonly string[]) => Promise<unknown>;
|
|
21
|
+
'ExtensionApi.executeSourceControlGetGroups': (id: string, cwd: string) => Promise<unknown>;
|
|
22
|
+
'ExtensionApi.executeSourceControlIsActive': (id: string, scheme: string, root: string) => Promise<boolean>;
|
|
13
23
|
'ExtensionApi.executeViewProvider': (id: string) => unknown;
|
|
14
24
|
'ExtensionApi.getCommandRegistrySnapshot': () => import("../CommandRegistrySnapshot/CommandRegistrySnapshot.ts").CommandRegistrySnapshot;
|
|
15
25
|
'ExtensionApi.getCompletionProviderRegistrySnapshot': () => import("../CompletionProviderRegistrySnapshot/CompletionProviderRegistrySnapshot.ts").CompletionProviderRegistrySnapshot;
|
|
@@ -17,6 +27,7 @@ export declare const commandMap: {
|
|
|
17
27
|
'ExtensionApi.getFormattingProviderRegistrySnapshot': () => import("../FormattingProviderRegistrySnapshot/FormattingProviderRegistrySnapshot.ts").FormattingProviderRegistrySnapshot;
|
|
18
28
|
'ExtensionApi.getHoverProviderRegistrySnapshot': () => import("../HoverProviderRegistrySnapshot/HoverProviderRegistrySnapshot.ts").HoverProviderRegistrySnapshot;
|
|
19
29
|
'ExtensionApi.getOutputChannelRegistrySnapshot': () => import("../OutputChannelRegistrySnapshot/OutputChannelRegistrySnapshot.ts").OutputChannelRegistrySnapshot;
|
|
30
|
+
'ExtensionApi.getSourceControlProviderRegistrySnapshot': () => import("../SourceControlProviderRegistrySnapshot/SourceControlProviderRegistrySnapshot.ts").SourceControlProviderRegistrySnapshot;
|
|
20
31
|
'ExtensionApi.getStatusBarItems': () => readonly import("../StatusBarItem/StatusBarItem.ts").StatusBarItem[];
|
|
21
32
|
'ExtensionApi.getViewRegistrySnapshot': () => import("../View/View.ts").ViewRegistrySnapshot;
|
|
22
33
|
'ExtensionApi.saveViewInstanceState': (uid: number) => Promise<unknown>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ExtensionManagementWorker } from '@lvce-editor/rpc-registry';
|
|
2
|
+
export const getPreference = async (key) => {
|
|
3
|
+
return ExtensionManagementWorker.invoke('Extensions.getPreference', key);
|
|
4
|
+
};
|
|
5
|
+
export const setPreference = async (key, value) => {
|
|
6
|
+
await ExtensionManagementWorker.invoke('Extensions.setPreference', key, value);
|
|
7
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface RegisteredSourceControlProvider {
|
|
2
|
+
readonly acceptInput?: (value: string) => unknown | Promise<unknown>;
|
|
3
|
+
readonly add?: (path: string) => unknown | Promise<unknown>;
|
|
4
|
+
readonly discard?: (path: string) => unknown | Promise<unknown>;
|
|
5
|
+
readonly generateCommitMessage?: () => unknown | Promise<unknown>;
|
|
6
|
+
readonly getChangedFiles: () => readonly unknown[] | Promise<readonly unknown[]>;
|
|
7
|
+
readonly getFeatures?: () => unknown | Promise<unknown>;
|
|
8
|
+
readonly getFileBefore?: (uri: string) => unknown | Promise<unknown>;
|
|
9
|
+
readonly getFileDecorations?: (uris: readonly string[]) => unknown | Promise<unknown>;
|
|
10
|
+
readonly getGroups?: (cwd: string) => unknown | Promise<unknown>;
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly isActive?: (scheme: string, root: string) => boolean | Promise<boolean>;
|
|
13
|
+
}
|
package/extension-api/dist/parts/RegisteredSourceControlProvider/RegisteredSourceControlProvider.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { executeSourceControlAcceptInput, executeSourceControlAdd, executeSourceControlDiscard, executeSourceControlGenerateCommitMessage, executeSourceControlGetChangedFiles, executeSourceControlGetFeatures, executeSourceControlGetFileBefore, executeSourceControlGetFileDecorations, executeSourceControlGetGroups, executeSourceControlIsActive, getSourceControlProviderRegistrySnapshot, registerSourceControlProvider, resetSourceControlProviderRegistry, } from '../SourceControlProviderRegistry/SourceControlProviderRegistry.ts';
|
|
2
|
+
export type { RegisteredSourceControlProvider } from '../RegisteredSourceControlProvider/RegisteredSourceControlProvider.ts';
|
|
3
|
+
export type { SourceControlProvider } from '../SourceControlProvider/SourceControlProvider.ts';
|
|
4
|
+
export type { SourceControlProviderRegistrySnapshot } from '../SourceControlProviderRegistrySnapshot/SourceControlProviderRegistrySnapshot.ts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { executeSourceControlAcceptInput, executeSourceControlAdd, executeSourceControlDiscard, executeSourceControlGenerateCommitMessage, executeSourceControlGetChangedFiles, executeSourceControlGetFeatures, executeSourceControlGetFileBefore, executeSourceControlGetFileDecorations, executeSourceControlGetGroups, executeSourceControlIsActive, getSourceControlProviderRegistrySnapshot, registerSourceControlProvider, resetSourceControlProviderRegistry, } from "../SourceControlProviderRegistry/SourceControlProviderRegistry.js";
|