@codingame/monaco-vscode-comments-service-override 4.5.2 → 5.0.1
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/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/comments/browser/comments.contribution.js +13 -5
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsEditorContribution.js +3 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsInputContentProvider.js +43 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-comments-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@5.0.1"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -19,6 +19,7 @@ import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
|
19
19
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
20
20
|
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
21
21
|
import { revealCommentThread } from 'vscode/vscode/vs/workbench/contrib/comments/browser/commentsController';
|
|
22
|
+
import { accessibleViewIsShown, accessibleViewCurrentProviderId } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
22
23
|
|
|
23
24
|
const _moduleId = "vs/workbench/contrib/comments/browser/comments.contribution";
|
|
24
25
|
registerAction2(class Collapse extends ViewAction {
|
|
@@ -73,11 +74,18 @@ registerAction2(class Reply extends Action2 {
|
|
|
73
74
|
id: 'comments.reply',
|
|
74
75
|
title: ( localizeWithPath(_moduleId, 2, "Reply")),
|
|
75
76
|
icon: Codicon.reply,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
precondition: ( (ContextKeyExpr.equals('canReply', true))),
|
|
78
|
+
menu: [{
|
|
79
|
+
id: MenuId.CommentsViewThreadActions,
|
|
80
|
+
order: 100
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: MenuId.AccessibleView,
|
|
84
|
+
when: ( (ContextKeyExpr.and(accessibleViewIsShown, (ContextKeyExpr.equals(
|
|
85
|
+
accessibleViewCurrentProviderId.key,
|
|
86
|
+
"comments"
|
|
87
|
+
))))),
|
|
88
|
+
}]
|
|
81
89
|
});
|
|
82
90
|
}
|
|
83
91
|
run(accessor, marshalledCommentThread) {
|
|
@@ -18,9 +18,12 @@ import { CommentContextKeys } from 'vscode/vscode/vs/workbench/contrib/comments/
|
|
|
18
18
|
import { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from 'vscode/vscode/vs/platform/accessibility/common/accessibility';
|
|
19
19
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
20
20
|
import { accessibilityHelpIsShown, accessibleViewCurrentProviderId } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
21
|
+
import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
22
|
+
import { CommentsInputContentProvider } from './commentsInputContentProvider.js';
|
|
21
23
|
|
|
22
24
|
const _moduleId = "vs/workbench/contrib/comments/browser/commentsEditorContribution";
|
|
23
25
|
registerEditorContribution(ID, CommentController, 1 );
|
|
26
|
+
registerWorkbenchContribution2(CommentsInputContentProvider.ID, CommentsInputContentProvider, 2 );
|
|
24
27
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
25
28
|
id: "editor.action.nextCommentThreadAction" ,
|
|
26
29
|
handler: async (accessor, args) => {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
+
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
+
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
4
|
+
import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
|
|
5
|
+
import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
|
|
6
|
+
import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
|
|
7
|
+
import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
|
|
8
|
+
import { applyTextEditorOptions } from 'vscode/vscode/vs/workbench/common/editor/editorOptions';
|
|
9
|
+
import { SimpleCommentEditor } from 'vscode/vscode/vs/workbench/contrib/comments/browser/simpleCommentEditor';
|
|
10
|
+
|
|
11
|
+
let CommentsInputContentProvider = class CommentsInputContentProvider extends Disposable {
|
|
12
|
+
static { this.ID = 'comments.input.contentProvider'; }
|
|
13
|
+
constructor(textModelService, codeEditorService, _modelService, _languageService) {
|
|
14
|
+
super();
|
|
15
|
+
this._modelService = _modelService;
|
|
16
|
+
this._languageService = _languageService;
|
|
17
|
+
this._register(textModelService.registerTextModelContentProvider(Schemas.commentsInput, this));
|
|
18
|
+
this._register(codeEditorService.registerCodeEditorOpenHandler(async (input, editor, _sideBySide) => {
|
|
19
|
+
if (!(editor instanceof SimpleCommentEditor)) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
if (editor.getModel()?.uri.toString() !== ( input.resource.toString())) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
if (input.options) {
|
|
26
|
+
applyTextEditorOptions(input.options, editor, 1 );
|
|
27
|
+
}
|
|
28
|
+
return editor;
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
async provideTextContent(resource) {
|
|
32
|
+
const existing = this._modelService.getModel(resource);
|
|
33
|
+
return existing ?? this._modelService.createModel('', this._languageService.createById('markdown'), resource);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
CommentsInputContentProvider = ( __decorate([
|
|
37
|
+
( __param(0, ITextModelService)),
|
|
38
|
+
( __param(1, ICodeEditorService)),
|
|
39
|
+
( __param(2, IModelService)),
|
|
40
|
+
( __param(3, ILanguageService))
|
|
41
|
+
], CommentsInputContentProvider));
|
|
42
|
+
|
|
43
|
+
export { CommentsInputContentProvider };
|