File tree 6 files changed +51
-11
lines changed
eclipse/jsdt/ts.eclipse.ide.jsdt.ui
src/ts/eclipse/ide/jsdt/internal/ui/editor
6 files changed +51
-11
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ ProblemTypeScriptHoverDescription= TypeScript Problem
23
23
TypeScriptHover =TypeScript
24
24
TypeScriptHoverDescription =TypeScript
25
25
26
+ context.name.0 = TypeScript View
27
+ context.description.0 = TypeScript View Context
28
+
26
29
# #########################################################################
27
30
# TypeScript Search
28
31
# #########################################################################
Original file line number Diff line number Diff line change 193
193
parentId =" org.eclipse.ui.textEditorScope"
194
194
id =" ts.eclipse.ide.jsdt.ui.typeScriptEditorScope" >
195
195
</context >
196
+ <!-- Not really the scope for the JavScript View.. just extends the editor
197
+ scope for now.
198
+ -->
199
+ <context
200
+ name =" %context.name.0"
201
+ description =" %context.description.0"
202
+ parentId =" ts.eclipse.ide.jsdt.ui.typeScriptEditorScope"
203
+ id =" ts.eclipse.ide.jsdt.ui.typeScriptViewScope" >
204
+ </context >
196
205
</extension >
197
206
198
207
<extension
228
237
<!-- edit -->
229
238
<key
230
239
sequence =" M1+M2+F"
231
- contextId =" ts.eclipse.ide.jsdt.ui.typeScriptEditorScope "
240
+ contextId =" ts.eclipse.ide.jsdt.ui.typeScriptViewScope "
232
241
commandId =" ts.eclipse.ide.jsdt.ui.edit.text.java.format"
233
242
schemeId =" org.eclipse.ui.defaultAcceleratorConfiguration" />
234
243
<!-- alternative for some gtk input modes -->
235
244
<key
236
245
platform =" gtk"
237
246
sequence =" ESC CTRL+F"
238
- contextId =" ts.eclipse.ide.jsdt.ui.typeScriptEditorScope "
247
+ contextId =" ts.eclipse.ide.jsdt.ui.typeScriptViewScope "
239
248
commandId =" ts.eclipse.ide.jsdt.ui.edit.text.java.format"
240
249
schemeId =" org.eclipse.ui.defaultAcceleratorConfiguration" />
241
250
</extension >
Original file line number Diff line number Diff line change @@ -35,5 +35,9 @@ protected void createActions() {
35
35
// PlatformUI.getWorkbench().getHelpSystem().setHelp(action,
36
36
// IJavaHelpContextIds.FORMAT_ACTION);
37
37
}
38
-
38
+
39
+ @ Override
40
+ protected void initializeKeyBindingScopes () {
41
+ setKeyBindingScopes (new String [] { "ts.eclipse.ide.jsdt.ui.typeScriptViewScope" }); //$NON-NLS-1$
42
+ }
39
43
}
Original file line number Diff line number Diff line change 16
16
import org .eclipse .jface .text .contentassist .ContentAssistant ;
17
17
import org .eclipse .jface .text .contentassist .IContentAssistProcessor ;
18
18
import org .eclipse .jface .text .contentassist .IContentAssistant ;
19
+ import org .eclipse .jface .text .formatter .IContentFormatter ;
19
20
import org .eclipse .jface .text .source .ISourceViewer ;
20
21
import org .eclipse .ui .texteditor .ITextEditor ;
21
22
import org .eclipse .wst .jsdt .internal .ui .JavaScriptPlugin ;
27
28
import org .eclipse .wst .jsdt .ui .text .JavaScriptSourceViewerConfiguration ;
28
29
29
30
import ts .eclipse .ide .jsdt .internal .ui .editor .contentassist .TypeScriptCompletionProcessor ;
31
+ import ts .eclipse .ide .jsdt .internal .ui .editor .contentassist .TypeScriptContentAssistInvocationContext ;
32
+ import ts .eclipse .ide .jsdt .internal .ui .editor .format .TypeScriptContentFormatter ;
30
33
31
34
/**
32
35
* Extension of JSDT {@link JavaScriptSourceViewerConfiguration}
@@ -96,4 +99,8 @@ private IDialogSettings getSettings(final String sectionName) {
96
99
return settings ;
97
100
}
98
101
102
+ @ Override
103
+ public IContentFormatter getContentFormatter (ISourceViewer sourceViewer ) {
104
+ return new TypeScriptContentFormatter (getEditor ());
105
+ }
99
106
}
Original file line number Diff line number Diff line change
1
+ package ts .eclipse .ide .jsdt .internal .ui .editor .format ;
2
+
3
+ import org .eclipse .jface .text .IDocument ;
4
+ import org .eclipse .jface .text .IRegion ;
5
+ import org .eclipse .jface .text .formatter .IContentFormatter ;
6
+ import org .eclipse .jface .text .formatter .IFormattingStrategy ;
7
+ import org .eclipse .ui .texteditor .ITextEditor ;
8
+
9
+ public class TypeScriptContentFormatter implements IContentFormatter {
10
+
11
+ public TypeScriptContentFormatter (ITextEditor editor ) {
12
+ // TODO Auto-generated constructor stub
13
+ }
14
+
15
+ @ Override
16
+ public void format (IDocument document , IRegion region ) {
17
+ System .err .println (document .get ());
18
+ }
19
+
20
+ @ Override
21
+ public IFormattingStrategy getFormattingStrategy (String contentType ) {
22
+ return null ;
23
+ }
24
+
25
+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments